Commit graph

20954 commits

Author SHA1 Message Date
Andreas Kling 0bf3df28b9 LibDebug: Memoize resolved paths in DebugInfo::prepare_lines()
When loading debug info, we encounter the same filename over and over
(since files usually have many lines!) and we were wasting a ton of
time re-checking if the filename was part of the Toolchain or libgcc,
along with some other checks.

This patch makes prepare_lines() significantly faster by memoizing
the result of these checks per filename.

This makes "bt 12" ~25% faster (from 850ms to 650ms on my machine.) :^)
2021-05-23 23:01:11 +02:00
Josh Perry d27616cf36 Hearts: Allow player to set their name
Added a new settings dialog to Hearts with a textbox to allow the
player to set a name, which is persisted in the Hearts config file.
2021-05-23 20:43:53 +01:00
Brian Gianforcaro e706de8f91 LibM: Fix linking with LibM when compiling Userland without -O2
While playing with conditionally disabling -O2 optimization when
building the Userland subdirectory, I discovered that we can no longer
link errors without -O2. This happens as LibM.so doesn't link to
anything else, resulting in no stack protector implementation. It
appears that optimization somehow avoids this problem?

To fix this inject LibC/ssp.cpp as we do with in dynamic loader.
2021-05-23 20:17:00 +01:00
Daniel Bertalan d23425bfc0 LibC: Use \010 for erasing instead of \0177
We ignore \0177 in the terminal -- as the ANSI standard dictates.

Fixes #7415
2021-05-23 19:32:31 +02:00
Gunnar Beutner 39f0739381 LibC+UE: Keep more unused chunked blocks around
Previously each malloc size class would keep around a limited number of
unused blocks which were marked with MADV_SET_VOLATILE which could then
be reinitialized when additional blocks were needed.

This changes malloc() so that it also keeps around a number of blocks
without marking them with MADV_SET_VOLATILE. I termed these "hot"
blocks whereas blocks which were marked as MADV_SET_VOLATILE are called
"cold" blocks because they're more expensive to reinitialize.

In the worst case this could increase memory usage per process by
1MB when a program requests a bunch of memory and frees all of it.

Also, in order to make more efficient use of these unused blocks
they're now shared between size classes.
2021-05-23 19:31:39 +02:00
Tobias Christiansen bd2b17a70e LibGfx: Replace ellipse drawing algorithm
The new one is way more naive and not as fancy as the old one, but it
doesn't crash when trying to draw circles.
This algorithm just sweeps the angles required by the call, makes sure
each segment is at most 1 (pixel) long and just uses the standard
parameterization to find the coordinates of each point on the ellipse.
2021-05-23 18:28:27 +02:00
Gunnar Beutner 6a194869cf Hearts: Add key combinations to letting the AI play for you
A single card can be played with F10 while Shift-F10 toggles the AI
for the current as well as all future tricks.
2021-05-23 18:15:36 +02:00
Gunnar Beutner 2dfced2501 Hearts: Let the AI prefer lead cards for which other cards are in play
When picking a lead card the AI should avoid playing cards where it
knows that no other player has a lower value card of the same type.
2021-05-23 18:15:36 +02:00
Gunnar Beutner 647d0f9f8a Hearts: Fix sorting function for lead cards
The pick_lead_card() function sometimes picks the incorrect card
because the sorted_hand vector wasn't being sorted properly.
2021-05-23 18:15:36 +02:00
Brendan Coles efef77a154 HexEditor: Add 'Go to Offset...' dialog 2021-05-23 18:13:49 +02:00
Jean-Baptiste Boric dd6921bfc6 LibProtocol: Fix non-constant usage of PAGE_SIZE 2021-05-23 18:10:29 +02:00
Jean-Baptiste Boric d92b6423bf Utilities: Fix test-unveil INT_MAX include 2021-05-23 18:10:29 +02:00
Jean-Baptiste Boric 8e6241b78b LookupServer: Fix missing POSIX includes 2021-05-23 18:10:29 +02:00
Jean-Baptiste Boric 5ced9a3dfb ImageDecoder: Fix narrowing cast of loop count 2021-05-23 18:10:29 +02:00
Jean-Baptiste Boric 4d332f3930 Utilities: Fix fgrep assertion include 2021-05-23 18:10:29 +02:00
Idan Horowitz fd68e606e7 CI: Make BuggieBot reply to pull requests that fail the commit linter
This should help reduce the repeating "Please check the contributing
guide" replies from reviewers.
2021-05-23 18:09:54 +02:00
Andreas Kling 873eb47d2b ps: Sort output by PID :^) 2021-05-23 11:26:19 +02:00
Andreas Kling a1e133cc6b LibCore: Make ProcessStatisticsReader return results in a Vector
The HashMap API was overkill and made using this less ergonomic than
it should be.
2021-05-23 11:10:15 +02:00
Andreas Kling a345a1f4a1 Userland: Mark subclasses of IPC::{Client,Server}Connection final 2021-05-23 09:53:55 +02:00
Andreas Kling c1c252ddb2 LibIPC: Remove unnecessary IPC::ServerConnection::handshake()
This is no longer used by any of our IPC pairs.
2021-05-23 09:53:55 +02:00
Andreas Kling 2eceabdcfd LibGUI: Handle fast_greet stuff in WindowServerConnection constructor
Move the from handshake() to the constructor (and move the constructor
out-of-line while we're at it.)

This prepares getting rid of the handshake() mechanism since this is
the only remaining user.
2021-05-23 09:53:55 +02:00
Andreas Kling 0af69e8917 HackStudio: Greet language servers asynchronously
There's no need to wait for a response after we've sent the project
path to a newly connected language server.
2021-05-23 09:53:55 +02:00
Andreas Kling 67b47d62f3 WebContent: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling 6b2f24018d RequestServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling bf33b5df6e WebSocket: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling 03df8882df InspectorServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling 78b57fcea3 NotificationServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling 5424372d50 AudioServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling e7fc46879e LaunchServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling de07dab184 ImageDecoder: Remove unnecessary greet() message
This didn't do anything except induce an IPC stall during startup.
2021-05-23 09:53:55 +02:00
Brian Gianforcaro 6ebec090c3 Userland: Allow nc to connect by hostname instead of just address
Allow the user to pass in a hostname to the connect functionality
instead of just an ip address. The call to gethostbyname(..) handles
both seamlessly for us.

Update the argument name / usage message accordingly.
2021-05-23 09:19:16 +02:00
Brian Gianforcaro 2b10c34f5c Meta: Clarify atomic commits in CONTRIBUTING.md 2021-05-23 08:38:30 +02:00
Daniel Bertalan 8262d6fc68 Utilities: Implement stty
This commit adds support for most of the useful POSIX-defined features.
This will come in handy when dealing with serial terminals that are
implemented in #7260.

Unfortunately, it isn't possible to use `Core::ArgsParser` due to the
oddity of the input format. Most of this code is therefore just data
wrangling and parsing.
2021-05-23 09:04:24 +04:30
Brian Gianforcaro 529a8664f4 Userland: Tweak the visual display of the bt utility
This patch adds a few minor visual features to the `bt` utility:
- Number each frame of the back trace.
- Color the address based on if it's in kernel or user space.
- Add a "frames:" heading to visually seperate the thread id.
- Rename "tid: <tid>" -> "thread: <tid>" as it's more visually
  appealing since it aligns vertically with "frames:"
- Add a visual " | " seperate between the address and symbol name.
2021-05-23 09:00:13 +04:30
Andreas Kling 786f6841b3 SystemMonitor: Remove "Inspect Process" action from context menu
Since everyone opts out of being inspectable by default now, let's not
offer inspection from the menu since it will fail in a default setup.
2021-05-22 23:30:40 +02:00
Andreas Kling c9e849a968 LibCore: Make all processes opt out of InspectorServer by default
This functionality, while neat, isn't really something you need enabled
all the time. Let's make it opt-in instead. Pass MakeInspectable::Yes
to the Core::EventLoop constructor if you want your program to become
inspectable.
2021-05-22 23:30:40 +02:00
Carlos César Neves Enumo 76a07b31e4 TextEditor: Prevent pasting with empty clipboard
Prevent erasing selected text when pasting with empty clipboard
2021-05-22 23:23:30 +02:00
Daniel Bertalan 282d0ebbec LibVT: Fix UTF-8 handling in OSC sequences
Previously, we would ignore bytes in the `0x80..0xff` range when parsing
OSC strings. This caused terminal titles and hyperlinks containing
non-ASCII characters to fail. Also added is extending the UTF-8 fail
functionality for C1 control codes, since we do not handle those.

Fixes #7377
2021-05-22 23:23:08 +02:00
Andreas Kling 62819df713 Profiler: Allow scaling the timeline with Ctrl+MouseWheel :^) 2021-05-22 23:20:31 +02:00
Andreas Kling 3dfc3e362b LibGUI: Make GUI::Variant stringify floats with 2 decimals
The extremely high default precision was obnoxious in user interfaces.
2021-05-22 23:08:23 +02:00
Andreas Kling 4a843f7405 Profiler: Allow scrolling through full range of profile timeline
We were not taking the width of the process headers into account when
computing the scrollable content size of the timeline.

Fix this by passing the header width to AbstractScrollableWidget's
set_size_occupied_by_fixed_elements().
2021-05-22 23:02:51 +02:00
Andreas Kling 29e00cda2e Profiler: Add a "Show Disassembly" action (and hide it by default) 2021-05-22 22:49:19 +02:00
Andreas Kling 863ac3af97 Profiler: Add some helpful debug output if a process is missing
I've had a couple of instances where a profile was missing process
creation events for a PID. I don't know how to reproduce it yet,
so this patch merely adds a helpful debug message so you know why
Profiler is failing to load the file.
2021-05-22 22:23:52 +02:00
Andreas Kling cefb321da4 Kernel: Print a message to debug log after writing a perfcore file 2021-05-22 22:23:52 +02:00
Andreas Kling 8a5c78e93b Profiler: Split the call tree into one subtree per process
This patch adds an additional level of hierarchy to the call tree:
Every process gets its own top-level node. :^)

Before this, selecting multiple processes would get quite confusing
as all the call stacks from different processes were combined together
into one big tree.
2021-05-22 22:23:52 +02:00
NonStandardModel 65a341b82f
Base: Fix numeric keypad in slovenian keymap
Numeric keypad map was off-by-one.
2021-05-22 21:00:08 +01:00
Andreas Kling 9676548800 SystemMonitor: Symbolicate process stacks in a background thread
Use a Threading::BackgroundAction to symbolicate stacks. This avoids
blocking the main thread and keeps the GUI running (mostly.)
2021-05-22 19:57:19 +02:00
Andreas Kling b5d73c834f Userland: Rename LibThread => LibThreading
Also rename the "LibThread" namespace to "Threading"
2021-05-22 18:54:22 +02:00
Andreas Kling 5729b4e9a5 SystemMonitor: Don't unveil /tmp/portal/symbol
This portal doesn't exist after SymbolServer has been removed.
2021-05-22 18:54:22 +02:00
Andreas Kling 5d6252b29e LibSymbolication: Rename Client.{cpp,h} => Symbolication.{cpp,h} 2021-05-22 18:54:22 +02:00