summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp19
-rw-r--r--Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp
index 0ecc613596..85f0c7d9b0 100644
--- a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp
+++ b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp
@@ -16,6 +16,7 @@ DwarfInfo::DwarfInfo(const ELF::Image& elf)
m_debug_info_data = section_data(".debug_info");
m_abbreviation_data = section_data(".debug_abbrev");
m_debug_strings_data = section_data(".debug_str");
+ m_debug_line_strings_data = section_data(".debug_line_str");
populate_compilation_units();
}
@@ -104,6 +105,14 @@ AttributeValue DwarfInfo::get_attribute_value(AttributeDataForm form,
value.data.as_i32 = data;
break;
}
+ case AttributeDataForm::UData: {
+ size_t data;
+ debug_info_stream.read_LEB128_unsigned(data);
+ VERIFY(!debug_info_stream.has_any_error());
+ value.type = AttributeValue::Type::UnsignedNumber;
+ value.data.as_u32 = data;
+ break;
+ }
case AttributeDataForm::SecOffset: {
u32 data;
debug_info_stream >> data;
@@ -191,6 +200,16 @@ AttributeValue DwarfInfo::get_attribute_value(AttributeDataForm form,
assign_raw_bytes_value(length);
break;
}
+ case AttributeDataForm::LineStrP: {
+ u32 offset;
+ debug_info_stream >> offset;
+ VERIFY(!debug_info_stream.has_any_error());
+ value.type = AttributeValue::Type::String;
+
+ auto strings_data = debug_line_strings_data();
+ value.data.as_string = reinterpret_cast<const char*>(strings_data.data() + offset);
+ break;
+ }
default:
dbgln("Unimplemented AttributeDataForm: {}", (u32)form);
VERIFY_NOT_REACHED();
diff --git a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h
index 8de7c7f603..fa7d45383c 100644
--- a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h
+++ b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.h
@@ -49,6 +49,7 @@ public:
ReadonlyBytes debug_info_data() const { return m_debug_info_data; }
ReadonlyBytes abbreviation_data() const { return m_abbreviation_data; }
ReadonlyBytes debug_strings_data() const { return m_debug_strings_data; }
+ ReadonlyBytes debug_line_strings_data() const { return m_debug_line_strings_data; }
template<typename Callback>
void for_each_compilation_unit(Callback) const;
@@ -65,6 +66,7 @@ private:
ReadonlyBytes m_debug_info_data;
ReadonlyBytes m_abbreviation_data;
ReadonlyBytes m_debug_strings_data;
+ ReadonlyBytes m_debug_line_strings_data;
Vector<Dwarf::CompilationUnit> m_compilation_units;
};