Age | Commit message (Collapse) | Author |
|
These API's are used in a variety of ways when building the die cache.
Each AbbreviationEntry has vector and other members, so avoid copying
it at all costs.
|
|
This algorithm is both iterative and recursive, so allocating on every
recursion, or when iterating each child is extremely costly.
Instead allow the on stack DIE to be re-initialized so it can be reused.
|
|
When parsing the libraries of the debugee process, we previously
assumed that the region that's called `<library name>: .text` was also
the base of the ELF file.
However, since we started linking with `-z separate-code`, this is no
longer the case - our executables have a read-only segment before the
.text segment, and that segment is actually at the base of the ELF.
This broke inserting breakpoints with the debugger since they were
inserted at a wrong offset.
To fix that, we now use the address of the first segment in the memory
map for the ELF's base address (The memory map is sorted by address).
|
|
|
|
This helps us avoid weird truncation issues and fixes a bug on Clang
builds where truncation while reading caused the DIE offsets following
large LEB128 numbers to be incorrect. This removes the need for the
separate `LongUnsignedNumber` type.
|
|
This LineProgram instruction is emitted by Clang. Although we currently
have no use for it (it's mostly a debugger feature), we need to handle
this opcode, as otherwise CrashReporter wouldn't work.
|
|
This is required to avoid copying the image where otherwise a reference
would be enough.
|
|
|
|
This fixes displaying 64-bit addresses in readelf and also fixes
showing backtraces from core dumps on x86_64.
|
|
This commit makes LibRegex (mostly) capable of operating on any of
the three main string views:
- StringView for raw strings
- Utf8View for utf-8 encoded strings
- Utf32View for raw unicode strings
As a result, regexps with unicode strings should be able to properly
handle utf-8 and not stop in the middle of a code point.
A future commit will update LibJS to use the correct type of string
depending on the flags.
|
|
|
|
|
|
This fixes a couple of warnings emitted by Clang.
|
|
|
|
The LexicalPath instance methods dirname(), basename(), title() and
extension() will be changed to return StringView const& in a further
commit. Due to this, users creating temporary LexicalPath objects just
to call one of those getters will recieve a StringView const& pointing
to a possible freed buffer.
To avoid this, static methods for those APIs have been added, which will
return a String by value to avoid those problems. All cases where
temporary LexicalPath objects have been used as described above haven
been changed to use the static APIs.
|
|
|
|
This enables building more of the userspace applications for x86_64.
|
|
|
|
This function returns the source position of a given address in the
program. If that address exists in an inline chain, then it also returns
the source positions that are in the chain.
|
|
This function returns a DIE object from the cache with the given offset
in the debug_info section.
|
|
This function returns the die object whose address range intersects
with the given address.
This function will also construct the DIE cache, if it hasn't been
constructed yet.
|
|
There is one cache that indexes DIE objects by the start address of
their range, and another cache that indexes by their offset in the
debug_info section.
Both caches are implemented with RedBlackTree, and are optional - they
will only be populated if 'build_cached_dies' is invoked.
|
|
In the current implementation, only DIE objects that are created via
DIE::for_each_child() will have parent offsets.
DIE objects that are created with CompilationUnit::get_die_at_offset()
do not currently store a parent offset.
We may improve this in the future, but this is enough for what we
currently need.
|
|
In some contexts, it's helpful to also know the "Attribute Form",
in addition to the "Attribute Type".
An example for such context is the interpretation of the
"DW_AT_high_pc" attribute, which has different meaning if the form
is an address or a constant.
|
|
This function returns the directory path & filename for a given file
index.
|
|
Previously, the LineProgram objects were short-lived, and only created
inside DebugInfo::prepare_lines() to create a vector of sorted LineInfo
data.
However, Dwarf::LineProgram also contains other useful data, such as
index-to-string mapping of source directories and filenames.
This commit makes each Dwarf::CompilationUnit own its
Dwarf::LineProgram.
DebugInfo::prepare_lines() then iterates over the compilation units to
prepare its sorted vector of lines.
|
|
This fixes an issue were some LibDebug objects (for example,
Dwarf::CompilationUnit) held a reference to their parent
Dwarf::DwarfInfo object, which was constructed on the stack and later
moved to the heap.
|
|
|
|
|
|
|
|
|
|
Let's make it a bit more clear when we're appending the elements from
one vector to the end of another vector.
|
|
Avoid promotion of static strings to AK::String, instead use
AK::StringView and operator ""sv, to force string view's instead
which avoids allocation of String. This code path isn't hot enough
that it makes a huge difference, but every bit counts.
|
|
This shaves another ~15% off of "bt 12" on my machine :^)
|
|
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.) :^)
|
|
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.
|
|
These two header files relied on transitive header includes.
|
|
This code path is very hot, and since we're seeing a lot of the same
strings repeatedly (and they're heading into a FlyString for storage)
let's construct those using FlyString(StringView) to avoid temporary
String objects.
|
|
|
|
We were using ELF::Image::section(0) to indicate the "undefined"
section, when what we really wanted was just Optional<Section>.
So let's use Optional instead. :^)
|
|
...and make it an enum class so people don't omit "OpenMode".
|
|
This adds support for the basic_block register to the Dwarf line
number state machine.
|
|
|
|
|
|
|
|
While symbolicating a crash dump for UserspaceEmulator I came across
another data form we didn't support.
ImplicitConst encodes a LEB128 value in the abbreviation record
rather than - like all other values - in the .debug_info section.
|
|
|
|
|
|
|
|
|