The internal reuse of FixedMemoryStream makes this straightforward.
There alread is one user of the new API, demonstrating the need for this
change beyond what I said out to use it for :^)
Since it will become a stream in a little bit, it should behave like all
non-trivial stream classes, who are not primarily intended to have
shared ownership to make closing behavior more predictable. Across all
uses of MappedFile, there is only one use case of shared mapped files in
LibVideo, which now uses the thin SharedMappedFile wrapper.
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.
One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
Instead of assuming the virtual offset will be 8 hex digits (which is OK
for 32 bit values), just use the ":p" modifier to ensure it prints the
virtual offset as a pointer, so if the code is compiled for 64 bit CPUs,
it will use 16 hex digits accordingly.
StringView was used where possible. Some utilities still use libc
functions which expect null-terminated strings, so String objects were
used there instead.
This mainly does two things,
1. Removes spaces after commas
2. Elides "0x" and leading zeros in most contexts
Remaining differences are:
1. objdump always has memory size annotations
We lack these and probably have some annotations wrong
2. Boolean check names
We use jump-zero, while objdump uses jump-equal for example
3. We sometimes add "00 00" symbols, which objdump elides
4. We always demangle (This is a good thing)
5. We always resolve relocations (This is a good thing)
6. We seem to detect some symbols differently/incorrectly
This prints 7 instruction bytes per line, which is enough for most
x86-64 instructions (rex+opcode+mod/rm+imm32) and is also what
objdump uses.
Co-authored-by: Simon Wanner <skyrising@pvpctutorials.de>
Previously <AK/Function.h> also included <AK/OwnPtr.h>. That's about to
change though. This patch fixes a few build problems that will occur
when that change happens.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *