summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp59
1 files changed, 30 insertions, 29 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index d78682cce0a..6bf5b221555 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -88,9 +88,10 @@ DWARFDebugInfoEntry::Attributes::RemoveAttribute(dw_attr_t attr)
bool
DWARFDebugInfoEntry::Attributes::ExtractFormValueAtIndex (SymbolFileDWARF* dwarf2Data, uint32_t i, DWARFFormValue &form_value) const
{
+ form_value.SetCompileUnit(CompileUnitAtIndex(i));
form_value.SetForm(FormAtIndex(i));
lldb::offset_t offset = DIEOffsetAtIndex(i);
- return form_value.ExtractValue(dwarf2Data->get_debug_info_data(), &offset, CompileUnitAtIndex(i));
+ return form_value.ExtractValue(dwarf2Data->get_debug_info_data(), &offset);
}
uint64_t
@@ -107,7 +108,7 @@ DWARFDebugInfoEntry::Attributes::FormValueAsUnsignedAtIndex(SymbolFileDWARF* dwa
{
DWARFFormValue form_value;
if (ExtractFormValueAtIndex(dwarf2Data, i, form_value))
- return form_value.Reference(CompileUnitAtIndex(i));
+ return form_value.Reference();
return fail_value;
}
@@ -318,8 +319,8 @@ DWARFDebugInfoEntry::Extract
if (isCompileUnitTag && ((attr == DW_AT_entry_pc) || (attr == DW_AT_low_pc)))
{
- DWARFFormValue form_value(form);
- if (form_value.ExtractValue(debug_info_data, &offset, cu))
+ DWARFFormValue form_value(cu, form);
+ if (form_value.ExtractValue(debug_info_data, &offset))
{
if (attr == DW_AT_low_pc || attr == DW_AT_entry_pc)
((DWARFCompileUnit*)cu)->SetBaseAddress(form_value.Unsigned());
@@ -777,8 +778,8 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges
for (i=0; i<numAttributes; ++i)
{
abbrevDecl->GetAttrAndFormByIndexUnchecked(i, attr, form);
- DWARFFormValue form_value(form);
- if (form_value.ExtractValue(debug_info_data, &offset, cu))
+ DWARFFormValue form_value(cu, form);
+ if (form_value.ExtractValue(debug_info_data, &offset))
{
switch (attr)
{
@@ -828,11 +829,11 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges
break;
case DW_AT_abstract_origin:
- die_offsets.push_back(form_value.Reference(cu));
+ die_offsets.push_back(form_value.Reference());
break;
case DW_AT_specification:
- die_offsets.push_back(form_value.Reference(cu));
+ die_offsets.push_back(form_value.Reference());
break;
case DW_AT_decl_file:
@@ -1073,9 +1074,9 @@ DWARFDebugInfoEntry::DumpAttribute
s.Printf( "[%s", DW_FORM_value_to_name(form));
}
- DWARFFormValue form_value(form);
+ DWARFFormValue form_value(cu, form);
- if (!form_value.ExtractValue(debug_info_data, offset_ptr, cu))
+ if (!form_value.ExtractValue(debug_info_data, offset_ptr))
return;
if (show_form)
@@ -1093,7 +1094,7 @@ DWARFDebugInfoEntry::DumpAttribute
// Always dump form value if verbose is enabled
if (verbose)
{
- form_value.Dump(s, debug_str_data, cu);
+ form_value.Dump(s, debug_str_data);
}
@@ -1126,7 +1127,7 @@ DWARFDebugInfoEntry::DumpAttribute
if (blockData)
{
if (!verbose)
- form_value.Dump(s, debug_str_data, cu);
+ form_value.Dump(s, debug_str_data);
// Location description is inlined in data in the form value
DWARFDataExtractor locationData(debug_info_data, (*offset_ptr) - form_value.Unsigned(), form_value.Unsigned());
@@ -1143,13 +1144,13 @@ DWARFDebugInfoEntry::DumpAttribute
if (dwarf2Data)
{
if ( !verbose )
- form_value.Dump(s, debug_str_data, cu);
+ form_value.Dump(s, debug_str_data);
DWARFLocationList::Dump(s, cu, dwarf2Data->get_debug_loc_data(), debug_loc_offset);
}
else
{
if ( !verbose )
- form_value.Dump(s, NULL, cu);
+ form_value.Dump(s, NULL);
}
}
}
@@ -1158,8 +1159,8 @@ DWARFDebugInfoEntry::DumpAttribute
case DW_AT_abstract_origin:
case DW_AT_specification:
{
- uint64_t abstract_die_offset = form_value.Reference(cu);
- form_value.Dump(s, debug_str_data, cu);
+ uint64_t abstract_die_offset = form_value.Reference();
+ form_value.Dump(s, debug_str_data);
// *ostrm_ptr << HEX32 << abstract_die_offset << " ( ";
if ( verbose ) s.PutCString(" ( ");
GetName(dwarf2Data, cu, abstract_die_offset, s);
@@ -1169,9 +1170,9 @@ DWARFDebugInfoEntry::DumpAttribute
case DW_AT_type:
{
- uint64_t type_die_offset = form_value.Reference(cu);
+ uint64_t type_die_offset = form_value.Reference();
if (!verbose)
- form_value.Dump(s, debug_str_data, cu);
+ form_value.Dump(s, debug_str_data);
s.PutCString(" ( ");
AppendTypeName(dwarf2Data, cu, type_die_offset, s);
s.PutCString(" )");
@@ -1181,7 +1182,7 @@ DWARFDebugInfoEntry::DumpAttribute
case DW_AT_ranges:
{
if ( !verbose )
- form_value.Dump(s, debug_str_data, cu);
+ form_value.Dump(s, debug_str_data);
lldb::offset_t ranges_offset = form_value.Unsigned();
dw_addr_t base_addr = cu ? cu->GetBaseAddress() : 0;
if (dwarf2Data)
@@ -1191,7 +1192,7 @@ DWARFDebugInfoEntry::DumpAttribute
default:
if ( !verbose )
- form_value.Dump(s, debug_str_data, cu);
+ form_value.Dump(s, debug_str_data);
break;
}
@@ -1228,7 +1229,6 @@ DWARFDebugInfoEntry::GetAttributes
uint32_t i;
dw_attr_t attr;
dw_form_t form;
- DWARFFormValue form_value;
for (i=0; i<num_attributes; ++i)
{
abbrevDecl->GetAttrAndFormByIndexUnchecked (i, attr, form);
@@ -1255,11 +1255,11 @@ DWARFDebugInfoEntry::GetAttributes
if ((attr == DW_AT_specification) || (attr == DW_AT_abstract_origin))
{
- form_value.SetForm(form);
- if (form_value.ExtractValue(debug_info_data, &offset, cu))
+ DWARFFormValue form_value (cu, form);
+ if (form_value.ExtractValue(debug_info_data, &offset))
{
const DWARFDebugInfoEntry* die = NULL;
- dw_offset_t die_offset = form_value.Reference(cu);
+ dw_offset_t die_offset = form_value.Reference();
if (cu->ContainsDIEOffset(die_offset))
{
die = const_cast<DWARFCompileUnit*>(cu)->GetDIEPtr(die_offset);
@@ -1327,8 +1327,9 @@ DWARFDebugInfoEntry::GetAttributeValue
DWARFFormValue::SkipValue(abbrevDecl->GetFormByIndex(idx++), debug_info_data, &offset, cu);
const dw_offset_t attr_offset = offset;
+ form_value.SetCompileUnit(cu);
form_value.SetForm(abbrevDecl->GetFormByIndex(idx));
- if (form_value.ExtractValue(debug_info_data, &offset, cu))
+ if (form_value.ExtractValue(debug_info_data, &offset))
{
if (end_attr_offset_ptr)
*end_attr_offset_ptr = offset;
@@ -1419,7 +1420,7 @@ DWARFDebugInfoEntry::GetAttributeValueAsReference
{
DWARFFormValue form_value;
if (GetAttributeValue(dwarf2Data, cu, attr, form_value))
- return form_value.Reference(cu);
+ return form_value.Reference();
return fail_value;
}
@@ -1586,7 +1587,7 @@ DWARFDebugInfoEntry::GetName
if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value))
{
DWARFCompileUnitSP cu_sp_ptr;
- const DWARFDebugInfoEntry* die = const_cast<SymbolFileDWARF*>(dwarf2Data)->DebugInfo()->GetDIEPtr(form_value.Reference(cu), &cu_sp_ptr);
+ const DWARFDebugInfoEntry* die = const_cast<SymbolFileDWARF*>(dwarf2Data)->DebugInfo()->GetDIEPtr(form_value.Reference(), &cu_sp_ptr);
if (die)
return die->GetName(dwarf2Data, cu_sp_ptr.get());
}
@@ -1657,7 +1658,7 @@ DWARFDebugInfoEntry::GetPubname
// The specification DIE may be in another compile unit so we need
// to get a die and its compile unit.
DWARFCompileUnitSP cu_sp_ptr;
- const DWARFDebugInfoEntry* die = const_cast<SymbolFileDWARF*>(dwarf2Data)->DebugInfo()->GetDIEPtr(form_value.Reference(cu), &cu_sp_ptr);
+ const DWARFDebugInfoEntry* die = const_cast<SymbolFileDWARF*>(dwarf2Data)->DebugInfo()->GetDIEPtr(form_value.Reference(), &cu_sp_ptr);
if (die)
return die->GetPubname(dwarf2Data, cu_sp_ptr.get());
}
@@ -1794,7 +1795,7 @@ DWARFDebugInfoEntry::AppendTypeName
DWARFFormValue form_value;
if (die.GetAttributeValue(dwarf2Data, cu, DW_AT_type, form_value))
{
- uint64_t next_die_offset = form_value.Reference(cu);
+ uint64_t next_die_offset = form_value.Reference();
result = AppendTypeName(dwarf2Data, cu, next_die_offset, s);
}
OpenPOWER on IntegriCloud