summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorFalseHonesty <thefalsehonesty@gmail.com>2021-04-13 21:29:01 -0400
committerAndreas Kling <kling@serenityos.org>2021-04-14 13:28:48 +0200
commitacbb119b27c9d7c9bccc7da093c3d1ce069315a8 (patch)
tree5d38097216f5e0d0cf5eda9cfe45f7d5275d882d /Userland
parent1942c1061c1bdd37f7a0155684e169e56075e6e1 (diff)
downloadserenity-acbb119b27c9d7c9bccc7da093c3d1ce069315a8.zip
LibDebug: Support unnamed variables and types
We were supposed to already support unnamed types, but due to a little typo, we were actually causing more problems :^)
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibDebug/DebugInfo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibDebug/DebugInfo.cpp b/Userland/Libraries/LibDebug/DebugInfo.cpp
index 853cda962c..5b1c77aa81 100644
--- a/Userland/Libraries/LibDebug/DebugInfo.cpp
+++ b/Userland/Libraries/LibDebug/DebugInfo.cpp
@@ -215,7 +215,7 @@ static Optional<Dwarf::DIE> parse_variable_type_die(const Dwarf::DIE& variable_d
variable_info.type_name = type_name.value().data.as_string;
} else {
dbgln("Unnamed DWARF type at offset: {}", type_die.offset());
- variable_info.name = "[Unnamed Type]";
+ variable_info.type_name = "[Unnamed Type]";
}
return type_die;
@@ -263,7 +263,9 @@ OwnPtr<DebugInfo::VariableInfo> DebugInfo::create_variable_info(const Dwarf::DIE
}
NonnullOwnPtr<VariableInfo> variable_info = make<VariableInfo>();
- variable_info->name = variable_die.get_attribute(Dwarf::Attribute::Name).value().data.as_string;
+ auto name_attribute = variable_die.get_attribute(Dwarf::Attribute::Name);
+ if (name_attribute.has_value())
+ variable_info->name = name_attribute.value().data.as_string;
auto type_die = parse_variable_type_die(variable_die, *variable_info);