mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:47:34 +00:00
LibDebug: Add DebugInfo::get_source_position_with_inlines
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 commit is contained in:
parent
835efa1b6a
commit
a45b5ccd96
2 changed files with 84 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
* Copyright (c) 2020-2021, Itamar S. <itamar8910@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -95,6 +95,12 @@ public:
|
|||
|
||||
Optional<SourcePosition> get_source_position(u32 address) const;
|
||||
|
||||
struct SourcePositionWithInlines {
|
||||
Optional<SourcePosition> source_position;
|
||||
Vector<SourcePosition> inline_chain;
|
||||
};
|
||||
SourcePositionWithInlines get_source_position_with_inlines(u32 address) const;
|
||||
|
||||
struct SourcePositionAndAddress {
|
||||
String file;
|
||||
size_t line;
|
||||
|
@ -115,6 +121,9 @@ private:
|
|||
static bool is_variable_tag_supported(const Dwarf::EntryTag& tag);
|
||||
void add_type_info_to_variable(const Dwarf::DIE& type_die, const PtraceRegisters& regs, DebugInfo::VariableInfo* parent_variable) const;
|
||||
|
||||
Optional<Dwarf::LineProgram::DirectoryAndFile> get_source_path_of_inline(const Dwarf::DIE&) const;
|
||||
Optional<uint32_t> get_line_of_inline(const Dwarf::DIE&) const;
|
||||
|
||||
NonnullOwnPtr<const ELF::Image> m_elf;
|
||||
String m_source_root;
|
||||
FlatPtr m_base_address { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue