Instead of using a low-level, proprietary API inside LibGfx, let's use
Core::AnonymousBuffer which already abstracts anon_fd and offers a
higher-level API too.
We had two functions for doing mostly the same thing. Combine both
of them into String::find() and use that everywhere.
Also add some tests to cover basic behavior.
This commit introduces support for 3 new escape sequences:
1. Stop blinking cursor mode
2. `DECTCEM` mode (enable/disable cursor)
3. `DECSCUSR` (set cursor style)
`TerminalWidget` now supports the following cursor types: block,
underline and vertical bar. Each of these can blink or be steady.
`VirtualConsole` ignores these (just as we were doing before).
Pull out the Label updating code into its own function.
Ideally, we should probably transform this code to use its own widget
rather than doing this all in-line.
I.e., having a `FontSettingWidget` that that ties the FontPicker, Label
and Button into its own little widget, so that we can stay extendible in
the main widget and reduce duplication some more!
Previously, the font was applied to the Labels but the name wasn't
updated on initial startup.
This meant that the Label's content was only correct in the default
state but not if the user changed the defaults.
When building userland with UBSAN enabled (#7434), we were getting
spammed to death by unaligned access errors.
Fix these by adding 2 bytes of padding to the FontFileHeader struct,
and adjusting all our font files to match the new format. :^)
Right clicking on back or forward will now show a context menu with
URLs to navigate to. Also added an optional argument for the number of
steps in go_back() and go_forward().
This replaces the types of m_int_value and m_frac_value with
Checked<u64> which makes it possible to check if the value overflowed
when entering a digit. If that happens, the digit will just be ignored.
This fixes#1263.
This changes the keydown_event handler to use codepoints instead of key
codes for comparison if possible. This is so the functionality still
works as intended with keyboard layouts where e.g. typing '+' actually
results in KeyCode::Key_ExclamationPoint rather than KeyCode::Key_Plus.
This also removes the unnecessary call to atoi().
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.) :^)
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.
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.
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.
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.
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.
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.
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.