Minor fixes

This commit is contained in:
Jeremy 2023-11-08 14:47:15 -05:00
parent 7ffec7b3c0
commit 5bf66156cd
No known key found for this signature in database
GPG Key ID: BE03111EB7ED6E2E
2 changed files with 3 additions and 2 deletions

View File

@ -153,7 +153,7 @@ namespace libdwarf {
} }
} }
optional<uint64_t> get_unsigned_attribute(Dwarf_Half attr_num) const { optional<Dwarf_Unsigned> get_unsigned_attribute(Dwarf_Half attr_num) const {
Dwarf_Attribute attr; Dwarf_Attribute attr;
if(wrap(dwarf_attr, die, attr_num, &attr) == DW_DLV_OK) { if(wrap(dwarf_attr, die, attr_num, &attr) == DW_DLV_OK) {
auto attwrapper = raii_wrap(attr, [] (Dwarf_Attribute attr) { dwarf_dealloc_attribute(attr); }); auto attwrapper = raii_wrap(attr, [] (Dwarf_Attribute attr) { dwarf_dealloc_attribute(attr); });

View File

@ -298,6 +298,7 @@ namespace libdwarf {
return subprogram_symbol(spec, 0, dwversion); return subprogram_symbol(spec, 0, dwversion);
} }
} }
return "";
} }
void get_inlines_info( void get_inlines_info(
@ -317,7 +318,7 @@ namespace libdwarf {
const auto file = ""; // die.get_string_attribute(DW_AT_call_file); const auto file = ""; // die.get_string_attribute(DW_AT_call_file);
const auto line = die.get_unsigned_attribute(DW_AT_call_line); const auto line = die.get_unsigned_attribute(DW_AT_call_line);
const auto col = die.get_unsigned_attribute(DW_AT_call_column); const auto col = die.get_unsigned_attribute(DW_AT_call_column);
printf(" %s %s:%u:%u\n", name.c_str(), file, line.value_or(0), col.value_or(0)); printf(" %s %s:%u:%u\n", name.c_str(), file, (unsigned)line.value_or(0), (unsigned)col.value_or(0));
inlines.push_back(stacktrace_frame{ inlines.push_back(stacktrace_frame{
0, 0,
(unsigned int)line.value_or(0), (unsigned int)line.value_or(0),