summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibDebug/Dwarf
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibDebug/Dwarf')
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.cpp2
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.h4
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/CompilationUnit.cpp2
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/CompilationUnit.h10
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/DIE.cpp8
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/DIE.h10
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp16
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h6
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/Expression.cpp2
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/Expression.h2
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/LineProgram.h2
11 files changed, 32 insertions, 32 deletions
diff --git a/Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.cpp b/Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.cpp
index bbc00fdeb9..ed5ad5ad03 100644
--- a/Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.cpp
+++ b/Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.cpp
@@ -11,7 +11,7 @@
namespace Debug::Dwarf {
-AbbreviationsMap::AbbreviationsMap(const DwarfInfo& dwarf_info, u32 offset)
+AbbreviationsMap::AbbreviationsMap(DwarfInfo const& dwarf_info, u32 offset)
: m_dwarf_info(dwarf_info)
, m_offset(offset)
{
diff --git a/Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.h b/Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.h
index a753479991..f1a5459c73 100644
--- a/Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.h
+++ b/Userland/Libraries/LibDebug/Dwarf/AbbreviationsMap.h
@@ -17,7 +17,7 @@ class DwarfInfo;
class AbbreviationsMap {
public:
- AbbreviationsMap(const DwarfInfo& dwarf_info, u32 offset);
+ AbbreviationsMap(DwarfInfo const& dwarf_info, u32 offset);
struct AbbreviationEntry {
@@ -32,7 +32,7 @@ public:
private:
void populate_map();
- const DwarfInfo& m_dwarf_info;
+ DwarfInfo const& m_dwarf_info;
u32 m_offset { 0 };
HashMap<u32, AbbreviationEntry> m_entries;
};
diff --git a/Userland/Libraries/LibDebug/Dwarf/CompilationUnit.cpp b/Userland/Libraries/LibDebug/Dwarf/CompilationUnit.cpp
index 2dfa57e6fd..07ffc30993 100644
--- a/Userland/Libraries/LibDebug/Dwarf/CompilationUnit.cpp
+++ b/Userland/Libraries/LibDebug/Dwarf/CompilationUnit.cpp
@@ -9,7 +9,7 @@
namespace Debug::Dwarf {
-CompilationUnit::CompilationUnit(const DwarfInfo& dwarf_info, u32 offset, const CompilationUnitHeader& header, NonnullOwnPtr<LineProgram>&& line_program)
+CompilationUnit::CompilationUnit(DwarfInfo const& dwarf_info, u32 offset, CompilationUnitHeader const& header, NonnullOwnPtr<LineProgram>&& line_program)
: m_dwarf_info(dwarf_info)
, m_offset(offset)
, m_header(header)
diff --git a/Userland/Libraries/LibDebug/Dwarf/CompilationUnit.h b/Userland/Libraries/LibDebug/Dwarf/CompilationUnit.h
index 47e715e3cd..5acb1a2088 100644
--- a/Userland/Libraries/LibDebug/Dwarf/CompilationUnit.h
+++ b/Userland/Libraries/LibDebug/Dwarf/CompilationUnit.h
@@ -23,7 +23,7 @@ class CompilationUnit {
AK_MAKE_NONMOVABLE(CompilationUnit);
public:
- CompilationUnit(const DwarfInfo& dwarf_info, u32 offset, const CompilationUnitHeader&, NonnullOwnPtr<LineProgram>&& line_program);
+ CompilationUnit(DwarfInfo const& dwarf_info, u32 offset, CompilationUnitHeader const&, NonnullOwnPtr<LineProgram>&& line_program);
u32 offset() const { return m_offset; }
u32 size() const { return m_header.length() + sizeof(u32); }
@@ -31,12 +31,12 @@ public:
DIE root_die() const;
DIE get_die_at_offset(u32 offset) const;
- const DwarfInfo& dwarf_info() const { return m_dwarf_info; }
- const AbbreviationsMap& abbreviations_map() const { return m_abbreviations; }
- const LineProgram& line_program() const { return *m_line_program; }
+ DwarfInfo const& dwarf_info() const { return m_dwarf_info; }
+ AbbreviationsMap const& abbreviations_map() const { return m_abbreviations; }
+ LineProgram const& line_program() const { return *m_line_program; }
private:
- const DwarfInfo& m_dwarf_info;
+ DwarfInfo const& m_dwarf_info;
u32 m_offset { 0 };
CompilationUnitHeader m_header;
AbbreviationsMap m_abbreviations;
diff --git a/Userland/Libraries/LibDebug/Dwarf/DIE.cpp b/Userland/Libraries/LibDebug/Dwarf/DIE.cpp
index e80835b2ff..e6f546640c 100644
--- a/Userland/Libraries/LibDebug/Dwarf/DIE.cpp
+++ b/Userland/Libraries/LibDebug/Dwarf/DIE.cpp
@@ -12,7 +12,7 @@
namespace Debug::Dwarf {
-DIE::DIE(const CompilationUnit& unit, u32 offset, Optional<u32> parent_offset)
+DIE::DIE(CompilationUnit const& unit, u32 offset, Optional<u32> parent_offset)
: m_compilation_unit(unit)
, m_offset(offset)
{
@@ -40,7 +40,7 @@ DIE::DIE(const CompilationUnit& unit, u32 offset, Optional<u32> parent_offset)
m_parent_offset = parent_offset;
}
-Optional<AttributeValue> DIE::get_attribute(const Attribute& attribute) const
+Optional<AttributeValue> DIE::get_attribute(Attribute const& attribute) const
{
InputMemoryStream stream { m_compilation_unit.dwarf_info().debug_info_data() };
stream.discard_or_error(m_data_offset);
@@ -57,7 +57,7 @@ Optional<AttributeValue> DIE::get_attribute(const Attribute& attribute) const
return {};
}
-void DIE::for_each_child(Function<void(const DIE& child)> callback) const
+void DIE::for_each_child(Function<void(DIE const& child)> callback) const
{
if (!m_has_children)
return;
@@ -81,7 +81,7 @@ void DIE::for_each_child(Function<void(const DIE& child)> callback) const
if (!sibling.has_value()) {
// NOTE: According to the spec, the compiler doesn't have to supply the sibling information.
// When it doesn't, we have to recursively iterate the current child's children to find where they end
- current_child->for_each_child([&](const DIE& sub_child) {
+ current_child->for_each_child([&](DIE const& sub_child) {
sibling_offset = sub_child.offset() + sub_child.size();
});
}
diff --git a/Userland/Libraries/LibDebug/Dwarf/DIE.h b/Userland/Libraries/LibDebug/Dwarf/DIE.h
index 5ee98c6a29..7062b6f3d5 100644
--- a/Userland/Libraries/LibDebug/Dwarf/DIE.h
+++ b/Userland/Libraries/LibDebug/Dwarf/DIE.h
@@ -20,23 +20,23 @@ class CompilationUnit;
// DIE = Debugging Information Entry
class DIE {
public:
- DIE(const CompilationUnit&, u32 offset, Optional<u32> parent_offset = {});
+ DIE(CompilationUnit const&, u32 offset, Optional<u32> parent_offset = {});
u32 offset() const { return m_offset; }
u32 size() const { return m_size; }
bool has_children() const { return m_has_children; }
EntryTag tag() const { return m_tag; }
- Optional<AttributeValue> get_attribute(const Attribute&) const;
+ Optional<AttributeValue> get_attribute(Attribute const&) const;
- void for_each_child(Function<void(const DIE& child)> callback) const;
+ void for_each_child(Function<void(DIE const& child)> callback) const;
bool is_null() const { return m_tag == EntryTag::None; }
- const CompilationUnit& compilation_unit() const { return m_compilation_unit; }
+ CompilationUnit const& compilation_unit() const { return m_compilation_unit; }
Optional<u32> parent_offset() const { return m_parent_offset; }
private:
- const CompilationUnit& m_compilation_unit;
+ CompilationUnit const& m_compilation_unit;
u32 m_offset { 0 };
u32 m_data_offset { 0 };
size_t m_abbreviation_code { 0 };
diff --git a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp
index 5e581798d7..8a15c7c0bf 100644
--- a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp
+++ b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp
@@ -13,7 +13,7 @@
namespace Debug::Dwarf {
-DwarfInfo::DwarfInfo(const ELF::Image& elf)
+DwarfInfo::DwarfInfo(ELF::Image const& elf)
: m_elf(elf)
{
m_debug_info_data = section_data(".debug_info"sv);
@@ -25,7 +25,7 @@ DwarfInfo::DwarfInfo(const ELF::Image& elf)
populate_compilation_units();
}
-ReadonlyBytes DwarfInfo::section_data(const StringView& section_name) const
+ReadonlyBytes DwarfInfo::section_data(StringView const& section_name) const
{
auto section = m_elf.lookup_section(section_name);
if (!section.has_value())
@@ -237,11 +237,11 @@ AttributeValue DwarfInfo::get_attribute_value(AttributeDataForm form, ssize_t im
void DwarfInfo::build_cached_dies() const
{
- auto insert_to_cache = [this](const DIE& die, DIERange& range) {
+ auto insert_to_cache = [this](DIE const& die, DIERange const& range) {
m_cached_dies_by_range.insert(range.start_address, DIEAndRange { die, range });
m_cached_dies_by_offset.insert(die.offset(), die);
};
- auto get_ranges_of_die = [this](const DIE& die) -> Vector<DIERange> {
+ auto get_ranges_of_die = [this](DIE const& die) -> Vector<DIERange> {
// TODO support DW_AT_ranges (appears when range is non-contiguous)
auto start = die.get_attribute(Attribute::LowPc);
@@ -266,22 +266,22 @@ void DwarfInfo::build_cached_dies() const
};
// If we simply use a lambda, type deduction fails because it's used recursively.
- Function<void(const DIE& die)> insert_to_cache_recursively;
- insert_to_cache_recursively = [&](const DIE& die) {
+ Function<void(DIE const& die)> insert_to_cache_recursively;
+ insert_to_cache_recursively = [&](DIE const& die) {
if (die.offset() == 0 || die.parent_offset().has_value()) {
auto ranges = get_ranges_of_die(die);
for (auto& range : ranges) {
insert_to_cache(die, range);
}
}
- die.for_each_child([&](const DIE& child) {
+ die.for_each_child([&](DIE const& child) {
if (!child.is_null()) {
insert_to_cache_recursively(child);
}
});
};
- for_each_compilation_unit([&](const CompilationUnit& compilation_unit) {
+ for_each_compilation_unit([&](CompilationUnit const& compilation_unit) {
insert_to_cache_recursively(compilation_unit.root_die());
});
diff --git a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h
index 4338643826..105cebde29 100644
--- a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h
+++ b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h
@@ -24,7 +24,7 @@ class DwarfInfo {
AK_MAKE_NONMOVABLE(DwarfInfo);
public:
- explicit DwarfInfo(const ELF::Image&);
+ explicit DwarfInfo(ELF::Image const&);
ReadonlyBytes debug_info_data() const { return m_debug_info_data; }
ReadonlyBytes abbreviation_data() const { return m_abbreviation_data; }
@@ -50,9 +50,9 @@ private:
void populate_compilation_units();
void build_cached_dies() const;
- ReadonlyBytes section_data(const StringView& section_name) const;
+ ReadonlyBytes section_data(StringView const& section_name) const;
- const ELF::Image& m_elf;
+ ELF::Image const& m_elf;
ReadonlyBytes m_debug_info_data;
ReadonlyBytes m_abbreviation_data;
ReadonlyBytes m_debug_strings_data;
diff --git a/Userland/Libraries/LibDebug/Dwarf/Expression.cpp b/Userland/Libraries/LibDebug/Dwarf/Expression.cpp
index 0924219770..14fe9df93b 100644
--- a/Userland/Libraries/LibDebug/Dwarf/Expression.cpp
+++ b/Userland/Libraries/LibDebug/Dwarf/Expression.cpp
@@ -12,7 +12,7 @@
namespace Debug::Dwarf::Expression {
-Value evaluate(ReadonlyBytes bytes, const PtraceRegisters& regs)
+Value evaluate(ReadonlyBytes bytes, PtraceRegisters const& regs)
{
InputMemoryStream stream(bytes);
diff --git a/Userland/Libraries/LibDebug/Dwarf/Expression.h b/Userland/Libraries/LibDebug/Dwarf/Expression.h
index f377383089..8b0eec4003 100644
--- a/Userland/Libraries/LibDebug/Dwarf/Expression.h
+++ b/Userland/Libraries/LibDebug/Dwarf/Expression.h
@@ -31,6 +31,6 @@ enum class Operations : u8 {
FbReg = 0x91,
};
-Value evaluate(ReadonlyBytes, const PtraceRegisters&);
+Value evaluate(ReadonlyBytes, PtraceRegisters const&);
}
diff --git a/Userland/Libraries/LibDebug/Dwarf/LineProgram.h b/Userland/Libraries/LibDebug/Dwarf/LineProgram.h
index abac23a313..8eecbff86a 100644
--- a/Userland/Libraries/LibDebug/Dwarf/LineProgram.h
+++ b/Userland/Libraries/LibDebug/Dwarf/LineProgram.h
@@ -114,7 +114,7 @@ public:
size_t line { 0 };
};
- const Vector<LineInfo>& lines() const { return m_lines; }
+ Vector<LineInfo> const& lines() const { return m_lines; }
struct DirectoryAndFile {
FlyString directory;