Commit Graph

10894 Commits

Author SHA1 Message Date
Andreas Kling
ca93c22ae2 LibGUI: Turn GUI::Application::the() into a pointer
During app teardown, the Application object may be destroyed before
something else, and so having Application::the() return a reference was
obscuring the truth about its lifetime.

This patch makes the API more honest by returning a pointer. While
this makes call sites look a bit more sketchy, do note that the global
Application pointer only becomes null during app teardown.
2020-07-04 16:54:55 +02:00
Andreas Kling
f7577585a6 AK: Add Weakable::revoke_weak_ptrs()
This allows you to clear all the WeakPtrs pointing at a Weakable *now*
instead of waiting until the Weakable is destroyed.
2020-07-04 16:23:52 +02:00
Andreas Kling
1dd1595043 LibGUI: Make GUI::Application a Core::Object
Having this on the stack makes whole-program teardown iffy. Turning it
into a Core::Object allows anyone who needs it to extends its lifetime.
2020-07-04 14:05:57 +02:00
Andreas Kling
0d577ab781 Kernel: Add "child added" and "child removed" InodeWatcher events
The child name is not yet accessible to userspace, but will be in a
future patch.
2020-07-04 13:37:51 +02:00
Andreas Kling
ea17d2d3da Kernel: Remove debug spam in finalizer task 2020-07-04 13:00:48 +02:00
Andreas Kling
c6c71b0fcc LibGUI: Respect per-index font when computing TreeView item rects
This makes the selected (currently shown in bold) item in HackStudio's
project file view show up at the correct position.
2020-07-04 11:01:43 +02:00
Petr Akhlamov
188c83328f
Meta: Add ALT Linux packages to BuildInstructions.md (#2688) 2020-07-04 10:51:16 +02:00
AnotherTest
b6853a118a Meta: Show the outputs of failing tests in travis 2020-07-04 10:49:48 +02:00
AnotherTest
29e00b637e LibC: Implement cf{g,s}et{i,o}speed 2020-07-04 10:49:36 +02:00
AnotherTest
9609539236 Kernel: Change the value of SO_KEEPALIVE to reflect LibC's constant
This change was partially introduced in 861eb8d, which changed the
constant in LibC without changing the one in the kernel.
2020-07-04 10:49:36 +02:00
AnotherTest
aa7148af89 strace: Use ArgsParser for argument processing 2020-07-04 10:49:36 +02:00
Andreas Kling
ccdaa1bea9 LibWeb: Insert newlines at <br> and block boundaries in copied text :^)
To make the plain text we copy out from LibWeb look at least somewhat
like its original form, let's insert newlines at <br> elements and when
we exit a block-level element.

This is far from perfect, but seems to work pretty okay.
2020-07-03 21:34:12 +02:00
Andreas Kling
f7ef6c65b4 LibWeb: Add a "select all" action to the Web::PageView
This works by finding the very first and very last LayoutText nodes
in the layout tree and then setting the selection bounds to those two
nodes. For some reason it gets glitchy if we set the very first and
very last *LayoutNode* as the selection bounds, but I didn't feel like
investigating that too closely right now.
2020-07-03 21:34:12 +02:00
Andreas Kling
eec22acb8e LibGUI: Add GUI::CommonActions::make_select_all_action() :^) 2020-07-03 21:34:12 +02:00
Andreas Kling
8001a85fc7 Browser: Don't crash when inspecting an anonymous LayoutNode
Not all LayoutNodes have a corresponding DOM node.
2020-07-03 21:34:12 +02:00
Andreas Kling
f87881e198 LibWeb: Implement basic text copying :^)
You can now press Ctrl+C to copy the selected text in a Web::PageView
to the system clipboard. Very cool!
2020-07-03 21:34:12 +02:00
Andreas Kling
da66d99566 Base: Add TextEditor to the quick-launch area in the Taskbar :^)
I'm always starting text editors by opening a Terminal and typing "te"
which is a bit silly when I can have an icon for it instead!
2020-07-03 21:34:12 +02:00
Tom
0f2530524e Kernel: Remove /proc/PID/regs
There isn't an easy way to retreive all register contents anymore,
so remove this functionality. We do have the ability to trace
processes, so it shouldn't really be needed anymore.
2020-07-03 21:16:56 +02:00
Tom
bb84fad0bf Kernel: Fix retreiving frame pointer from a thread
If we're trying to walk the stack for another thread, we can
no longer retreive the EBP register from Thread::m_tss. Instead,
we need to look at the top of the kernel stack, because all threads
not currently running were last in kernel mode. Context switches
now always trigger a brief switch to kernel mode, and Thread::m_tss
only is used to save ESP and EIP.

Fixes #2678
2020-07-03 21:16:56 +02:00
Nico Weber
6d5bd8c76b LibC: Minor style fix for getresuid/getresgid 2020-07-03 19:37:28 +02:00
Nico Weber
cbbd55bd6b LibC: Remove a few comments now that we have man pages for this. 2020-07-03 19:37:28 +02:00
Nico Weber
1f323076f0 Add man pages for seteuid() and friends.
Also add an overview page that explains the general concepts.
2020-07-03 19:37:28 +02:00
Tom
9b4e6f6a23 Kernel: Consolidate features into CPUFeature enum
This allows us to consolidate printing out all the CPU features
into one log statement. Also expose them in /proc/cpuinfo
2020-07-03 19:32:34 +02:00
Tom
e373e5f007 Kernel: Fix signal delivery
When delivering urgent signals to the current thread
we need to check if we should be unblocked, and if not
we need to yield to another process.

We also need to make sure that we suppress context switches
during Process::exec() so that we don't clobber the registers
that it sets up (eip mainly) by a context switch. To be able
to do that we add the concept of a critical section, which are
similar to Process::m_in_irq but different in that they can be
requested at any time. Calls to Scheduler::yield and
Scheduler::donate_to will return instantly without triggering
a context switch, but the processor will then asynchronously
trigger a context switch once the critical section is left.
2020-07-03 19:32:34 +02:00
Tom
a308b176ce Kernel: Allow recursion when writing to the debug log
This allows printing in the case e.g. a page fault happens
during a log statement
2020-07-03 19:32:34 +02:00
Tom
3cc0e86cd8 Kernel: Change kmalloc lock to be recursive
If the heap code dumps a stack trace (e.g. out of memory) then
it may recursively call into it. Rather than deadlocking, allow
recursion.
2020-07-03 19:32:34 +02:00
Tom
038dd9f30e AK: Serialize entire log statements
Prior to this, we wrote to the log every time the << operator
was used, which meant that only these parts of the log statement
were serialized. If the thread was preempted, or especially with
multiple CPUs the debug output was hard to decipher. Instead, we
buffer up the log statements. To avoid allocations we'll attempt
to use stack space, which covers most log statements.
2020-07-03 19:32:34 +02:00
Tom
57b61b2dde Kernel: Split initialization of Processor structure
We need to very early on initialize the Processor structure so
that we can use RecursiveSpinLock early on.
2020-07-03 19:32:34 +02:00
Tom
137e1dc7bd AK: Fixes for atomic pointers 2020-07-03 19:32:34 +02:00
Matthew Olsson
6af3fff0c2 LibJS: Reformat run-tests.sh output
- Use emojis instead of the pass/fail text
- Fix the new version of the script to run inside Serenity
- Don't print erroneous output after 'Output:'; start on a newline
instead
- Skip 'run-tests.sh' while testing
2020-07-03 19:30:13 +02:00
Matthew Olsson
d5beaa497f Base: Add green check mark and red X emojis 2020-07-03 19:30:13 +02:00
Matthew Olsson
97634d0678 LibJS: Hide interpreter exception debug output behind a flag 2020-07-03 19:30:13 +02:00
Matthew Olsson
6cb6e47779 cut: Accept input from stdin if no files are given 2020-07-03 19:30:13 +02:00
Matthew Olsson
4c48c9d69d LibJS: Reorganize tests into subfolders 2020-07-03 19:30:13 +02:00
Matthew Olsson
21064a1883 LibJS: Use correct MarkedValueList append method 2020-07-03 19:30:13 +02:00
Matthew Olsson
02debd8a6d LibJS: Remove extra colon in run-tests.sh output 2020-07-03 19:30:13 +02:00
Sahan Fernando
0ba9651e6e LibC: Replace Berkley's qsort() with AK::dual_pivot_quick_sort() wrapper 2020-07-03 19:29:36 +02:00
Andreas Kling
80d800e6d4 LibIPC: Don't assert on short writes in IPC::ClientConnection
This stops servers from crashing when a client's socket buffer becomes
full and we can't post any more messages to it. Normally this means the
client process is hanged/spinning, but I suppose this could also happen
under severe system load.

It's unclear to me what a better solution here would be. We can't keep
buffering messages indefinitely if the client is just never going to
receive them anyway. At some point we have to cut our losses, and it
seems pretty reasonable to let the kernel socket buffer be the cutoff.

It will be the responsibility of the individual server implementations
to avoid sending messages to clients that may be unable to handle them.
2020-07-03 14:05:09 +02:00
Andreas Kling
a98712035c Kernel: Fix non-blocking write() blocking instead of short-writing
If a partial write succeeded, we could then be in an unexpected state
where the file description was non-blocking, but we could no longer
write to it.

Previously, the kernel would block in that state, but instead we now
handle this as a proper short write and return the number of bytes
we were able to write.

Fixes #2645.
2020-07-03 13:54:18 +02:00
Maciej Zygmanowski
fc79fefb5e WindowServer: Don't crash when invalid resolution requested 2020-07-03 12:31:40 +02:00
Linus Groh
1bc326f63b FileManager: Add "Open Terminal here..." action to menu and toolbar
Currently it's only available in the context menu, which isn't quite
obvious.
2020-07-03 12:29:18 +02:00
Linus Groh
33ca151eb0 FilePicker: Add folder icon to location box
It looks good in FileManager so it will also look good here :^)

FileManager commit: b8a50e9
2020-07-03 12:28:12 +02:00
Linus Groh
f8fa495d67 FilePicker: Make the location box 2px taller
This mimics a recent change to the FileManager's location box.

FileManager commit: 3d5233a
2020-07-03 12:28:12 +02:00
Andreas Kling
47f5b24cc8 Kernel: Remove no-longer-used GDT selector from Thread
Now that we use software context switching, each thread no longer has
its own GDT entry (yay!) so we can get rid of this Thread member. :^)
2020-07-02 21:50:42 +02:00
Andreas Kling
e7393bfb7b Profiler: Turn the "choose a process" functionality into a GUI::Dialog
This feels a bit nicer and make it possible to reuse this in other
places as well. :^)
2020-07-02 20:46:59 +02:00
Nico Weber
526ca68786 SystemMonitor: Correctly check error of posix_spawn()
posix_spawn() has a bit of a whacky API in that it doens't return
0 on success and -1 on failure while writing the error code to
errno -- it instead returns 0 on success and the error code on
error.

So assign the return value to errno so that perror() does the
right thing.
2020-07-02 20:34:06 +02:00
Andreas Kling
f5d920eb2e Profiler: Make the RunningProcessesModel actually sortable
GUI::TableView looks at data(Model::Role::Sort) to know which order
things should be in.
2020-07-02 07:35:11 +02:00
Andreas Kling
a44e52cc14 SystemMonitor: Add "profile process" menu action :^)
You can now start profiling a process directly from SystemMonitor!
This is really neat.
2020-07-01 21:08:16 +02:00
Andreas Kling
d4c92bd1b7 Profiler: Allow specifying a PID to profile with --pid 2020-07-01 21:07:53 +02:00
Andreas Kling
8d52e200ee Profiler: If run without arguments, let user select process from a list
We now show a list of running processes that the user can choose from.
After choosing one, we start profiling it and show a timer with a stop
button that the user has to press to stop profiling.
2020-07-01 20:49:51 +02:00