Some ports (like `bc` with history enabled) sensibly set the termios
character size to 8 bits.
Previously, we left the character size value (given by the bitmask
CSIZE) as zero by default (meaning 5 bits per character), and returned
ENOTIMPL whenever someone modified it. This was dumb.
Add option to reverse primary and secondary buttons in Mouse Settings.
- WindowServer.ini: add default entry
- switch-mouse-buttons.png: new icon for settings entry
- Mouse.gml/MouseWidget.*: new settings dialog
- ClientConnection/WindowManager/Server: window message for settings
- EventLoop.cpp: swap buttons 1 and 2 if settings are on
From what I think, the array should consist of point indexes that have
been matched instead of just the last one.
For example, these are the array contents after searching 'file' for
'File Manager':
- Before: [ 3 ]
- Now: [ 0, 1, 2, 3 ]
Besides that, this greatly improves the scoring logic, as it can now
calculate bonuses.
Closes: #8310
There was a lot of `VERIFY_NOT_REACHED` error handling going on. Fixed
most of those.
A bit of a caveat is that after every `evaluate` call for expressions
that are part of a statement the error status of the `SQLResult` return
value must be called.
Filters matching rows by doing a table scan and evaluating the `WHERE`
expression for every row.
Does not use indexes, for one because they do not exist yet.
Mostly just calls the appropriate methods on the Value objects.
Exception are the `Concatenate` (string concat), and the logical `and`
and `or` operators which are implemented directly in
`BinaryOperatorExpression::evaluate`
The behaviour of the various operators is supposed to mimic that of
the same operators in PostgreSQL; the '+' operator for example will
successfully add '98' (string) and 2 (integer), but not 'foo' and 2.
Also removed some redundant const& parameter declarations for
intrinsic types (ints and doubles etc). Passing those by const& doesn't
make a lot of sense.
To support situations like this:
function foo() { throw 1; }
try {
foo();
} catch (e) {
}
Each unwind context now keeps track of its origin executable.
When an exception is thrown, we return from run() immediately if the
nearest unwind context isn't in the current executable.
This causes a natural unwind to the point where we find the
catch/finally block(s) to jump into.
We were missing some "break" statements, causing us to actually finish
executing everything within "try" blocks before actually jumping to the
"catch" and/or "finally" blocks.
Previously, we assumed that the `.text` segment was loaded at vaddr 0 in
shared object, which is not the case with `-z separate-code` enabled.
Because we didn't do the right calculations to translate an address from
a performance event into its value within the ELF file, Profiler would
try to disassemble out-of-bounds memory locations, leading to a crash.
This commit also changes `LibraryMetadata` to apply to a loaded library
as a whole, not just to one of its segments (like .text or .data). This
lets us simplify the interface, as we no longer have to worry about
`text_base`.
Fixes#10628
Since our executables are position-independent, the address values
extraced from processes don't correspond to their values within the ELF
file. We have to offset the absolute addresses by the load base address
to get the relative symbol that we need for disassembly.
Now that the kernel is compiled as a PIE, all addresses are relative to
the loaded base address, so Symbolication::kernel_base has to be
subtracted off from the absolute addresses if we want to symbolicate
them.
Also add a test to prevent this from happening again. There were two
bugs:
* The number of bytes just after processing the last value was written,
instead of the number of bytes after skipping remaining whitespace.
Confirmed by testing against GNU's `scanf()` since the man page
leaves something to be desired.
* The number of bytes was written to the wrong variable argument; i.e.
the first argument was overwritten.
Used these commands to test it:
printf 'HTTP/1.0 200 OK\r\n%s\r\n\r\n%s' 'Content-Length: 4' \
'well hello friends!' | nc -lN 0.0.0.0 8000
pro http://0.0.0.0:8000
(Actually, this also needs a Content-Encoding header, as response
streaming is disabled then. It didn't fit in the title.)
We were creating too small buffer -- instead of assigning the total
received buffer size, we were using the Content-Length value.
As you can see, the m_buffered_size might now exceed the Content-Length
value, but that will be handled in next commits, regardless if
the response can be streamed or not. :^)
Here's a minimal code that caused crash before:
printf 'HTTP/1.0 200 OK\r\n%s\r\n%s\r\n\r\n%s' \
'Content-Encoding: anything' 'Content-Length: 3' \
':^)AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' | nc -lN 0.0.0.0 8000
pro http://0.0.0.0:8000
Previously we assumed there were less kernel samples than user samples,
by implicitly using the kernel histogram size for indicies to the user
histogram. Such a profile can be reproduced by profiling a very short
lived program like true: `profile -c true`
Beforehand we were dividing the frame width by the profile length in ms
and then dividing the frame width by the result once more, which is
equivalent to (but slower) just using the length in ms directly, aside
from the case in which the profile is less than 1 ms long, in which
case this would trigger undefined behaviour due to the division by zero
This function implements CSS color syntax, which is case-insensitive in
HTML contexts. Making it insensitive here means not having to remember
to do it in every user, (many of the HTML elements do not do this,) and
means they don't have to produce a lowercase copy of the input string
before passing it.