case DW_AT_specification:
if (attributes.ExtractFormValueAtIndex(m_dwarf2Data, i, form_value))
- specification_die_offset = form_value.Reference(this);
+ specification_die_offset = form_value.Reference();
break;
}
}
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
{
DWARFFormValue form_value;
if (ExtractFormValueAtIndex(dwarf2Data, i, form_value))
- return form_value.Reference(CompileUnitAtIndex(i));
+ return form_value.Reference();
return fail_value;
}
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());
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)
{
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:
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)
// 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);
}
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());
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);
}
}
}
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);
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(" )");
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)
default:
if ( !verbose )
- form_value.Dump(s, debug_str_data, cu);
+ form_value.Dump(s, debug_str_data);
break;
}
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);
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);
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;
{
DWARFFormValue form_value;
if (GetAttributeValue(dwarf2Data, cu, attr, form_value))
- return form_value.Reference(cu);
+ return form_value.Reference();
return fail_value;
}
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());
}
// 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());
}
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);
}
return NULL;
}
-DWARFFormValue::DWARFFormValue(dw_form_t form) :
+DWARFFormValue::DWARFFormValue() :
+ m_cu (NULL),
+ m_form(0),
+ m_value()
+{
+}
+
+DWARFFormValue::DWARFFormValue(const DWARFCompileUnit* cu, dw_form_t form) :
+ m_cu (cu),
m_form(form),
m_value()
{
}
bool
-DWARFFormValue::ExtractValue(const DWARFDataExtractor& data, lldb::offset_t* offset_ptr, const DWARFCompileUnit* cu)
+DWARFFormValue::ExtractValue(const DWARFDataExtractor& data, lldb::offset_t* offset_ptr)
{
bool indirect = false;
bool is_block = false;
indirect = false;
switch (m_form)
{
- case DW_FORM_addr: m_value.value.uval = data.GetMaxU64(offset_ptr, DWARFCompileUnit::GetAddressByteSize(cu)); break;
+ case DW_FORM_addr: assert(m_cu);
+ m_value.value.uval = data.GetMaxU64(offset_ptr, DWARFCompileUnit::GetAddressByteSize(m_cu)); break;
case DW_FORM_block2: m_value.value.uval = data.GetU16(offset_ptr); is_block = true; break;
case DW_FORM_block4: m_value.value.uval = data.GetU32(offset_ptr); is_block = true; break;
case DW_FORM_data2: m_value.value.uval = data.GetU16(offset_ptr); break;
case DW_FORM_data1: m_value.value.uval = data.GetU8(offset_ptr); break;
case DW_FORM_flag: m_value.value.uval = data.GetU8(offset_ptr); break;
case DW_FORM_sdata: m_value.value.sval = data.GetSLEB128(offset_ptr); break;
- case DW_FORM_strp: m_value.value.uval = data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(cu) ? 8 : 4); break;
+ case DW_FORM_strp: assert(m_cu);
+ m_value.value.uval = data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(m_cu) ? 8 : 4); break;
// case DW_FORM_APPLE_db_str:
case DW_FORM_udata: m_value.value.uval = data.GetULEB128(offset_ptr); break;
- case DW_FORM_ref_addr: ref_addr_size = 4;
- if (cu) {
- if (cu->GetVersion() <= 2)
- ref_addr_size = cu->GetAddressByteSize();
- else
- ref_addr_size = cu->IsDWARF64() ? 8 : 4;
- }
+ case DW_FORM_ref_addr: assert(m_cu);
+ ref_addr_size = 4;
+ if (m_cu->GetVersion() <= 2)
+ ref_addr_size = m_cu->GetAddressByteSize();
+ else
+ ref_addr_size = m_cu->IsDWARF64() ? 8 : 4;
m_value.value.uval = data.GetMaxU64(offset_ptr, ref_addr_size); break;
case DW_FORM_ref1: m_value.value.uval = data.GetU8(offset_ptr); break;
case DW_FORM_ref2: m_value.value.uval = data.GetU16(offset_ptr); break;
indirect = true;
break;
- case DW_FORM_sec_offset: m_value.value.uval = data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(cu) ? 8 : 4); break;
+ case DW_FORM_sec_offset: assert(m_cu);
+ m_value.value.uval = data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(m_cu) ? 8 : 4); break;
case DW_FORM_flag_present: m_value.value.uval = 1; break;
case DW_FORM_ref_sig8: m_value.value.uval = data.GetU64(offset_ptr); break;
default:
}
bool
-DWARFFormValue::SkipValue(const DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) const
+DWARFFormValue::SkipValue(const DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr) const
{
- return DWARFFormValue::SkipValue(m_form, debug_info_data, offset_ptr, cu);
+ return DWARFFormValue::SkipValue(m_form, debug_info_data, offset_ptr, m_cu);
}
bool
case DW_FORM_ref_addr:
ref_addr_size = 4;
- if (cu) {
- if (cu->GetVersion() <= 2)
- ref_addr_size = cu->GetAddressByteSize();
- else
- ref_addr_size = cu->IsDWARF64() ? 8 : 4;
- }
+ assert (cu); // CU must be valid for DW_FORM_ref_addr objects or we will get this wrong
+ if (cu->GetVersion() <= 2)
+ ref_addr_size = cu->GetAddressByteSize();
+ else
+ ref_addr_size = cu->IsDWARF64() ? 8 : 4;
*offset_ptr += ref_addr_size;
return true;
// 32 bit for DWARF 32, 64 for DWARF 64
case DW_FORM_sec_offset:
case DW_FORM_strp:
+ assert(cu);
*offset_ptr += (cu->IsDWARF64() ? 8 : 4);
return true;
void
-DWARFFormValue::Dump(Stream &s, const DWARFDataExtractor* debug_str_data, const DWARFCompileUnit* cu) const
+DWARFFormValue::Dump(Stream &s, const DWARFDataExtractor* debug_str_data) const
{
uint64_t uvalue = Unsigned();
bool cu_relative_offset = false;
case DW_FORM_ref_addr:
{
- if (cu->GetVersion() <= 2)
+ assert (m_cu); // CU must be valid for DW_FORM_ref_addr objects or we will get this wrong
+ if (m_cu->GetVersion() <= 2)
s.Address(uvalue, sizeof (uint64_t) * 2);
else
s.Address(uvalue, 4 * 2);// 4 for DWARF32, 8 for DWARF64, but we don't support DWARF64 yet
if (cu_relative_offset)
{
+ assert (m_cu); // CU must be valid for DW_FORM_ref forms that are compile unit relative or we will get this wrong
if (verbose)
s.PutCString(" => ");
- s.Printf("{0x%8.8" PRIx64 "}", (uvalue + (cu ? cu->GetOffset() : 0)));
+ s.Printf("{0x%8.8" PRIx64 "}", uvalue + m_cu->GetOffset());
}
}
}
uint64_t
-DWARFFormValue::Reference(const DWARFCompileUnit* cu) const
+DWARFFormValue::Reference() const
{
uint64_t die_offset = m_value.value.uval;
switch (m_form)
case DW_FORM_ref4:
case DW_FORM_ref8:
case DW_FORM_ref_udata:
- die_offset += (cu ? cu->GetOffset() : 0);
+ assert (m_cu); // CU must be valid for DW_FORM_ref forms that are compile unit relative or we will get this wrong
+ die_offset += m_cu->GetOffset();
break;
default:
return die_offset;
}
-//----------------------------------------------------------------------
-// Resolve any compile unit specific references so that we don't need
-// the compile unit at a later time in order to work with the form
-// value.
-//----------------------------------------------------------------------
-bool
-DWARFFormValue::ResolveCompileUnitReferences(const DWARFCompileUnit* cu)
-{
- switch (m_form)
- {
- case DW_FORM_ref1:
- case DW_FORM_ref2:
- case DW_FORM_ref4:
- case DW_FORM_ref8:
- case DW_FORM_ref_udata:
- m_value.value.uval += cu->GetOffset();
- m_form = DW_FORM_ref_addr;
- return true;
- break;
-
- default:
- break;
- }
-
- return false;
-}
const uint8_t*
DWARFFormValue::BlockData() const
}
int
-DWARFFormValue::Compare (const DWARFFormValue& a_value, const DWARFFormValue& b_value, const DWARFCompileUnit* a_cu, const DWARFCompileUnit* b_cu, const DWARFDataExtractor* debug_str_data_ptr)
+DWARFFormValue::Compare (const DWARFFormValue& a_value, const DWARFFormValue& b_value, const DWARFDataExtractor* debug_str_data_ptr)
{
dw_form_t a_form = a_value.Form();
dw_form_t b_form = b_value.Form();
case DW_FORM_ref8:
case DW_FORM_ref_udata:
{
- uint64_t a = a_value.Reference(a_cu);
- uint64_t b = b_value.Reference(b_cu);
+ uint64_t a = a_value.Reference();
+ uint64_t b = b_value.Reference();
if (a < b)
return -1;
if (a > b)
eValueTypeBlock
};
- DWARFFormValue(dw_form_t form = 0);
+ DWARFFormValue();
+ DWARFFormValue(const DWARFCompileUnit* cu, dw_form_t form);
+ const DWARFCompileUnit* GetCompileUnit () const { return m_cu; }
+ void SetCompileUnit (const DWARFCompileUnit* cu) { m_cu = cu; }
dw_form_t Form() const { return m_form; }
void SetForm(dw_form_t form) { m_form = form; }
const ValueType& Value() const { return m_value; }
- void Dump(lldb_private::Stream &s, const lldb_private::DWARFDataExtractor* debug_str_data, const DWARFCompileUnit* cu) const;
+ void Dump(lldb_private::Stream &s, const lldb_private::DWARFDataExtractor* debug_str_data) const;
bool ExtractValue(const lldb_private::DWARFDataExtractor& data,
- lldb::offset_t* offset_ptr,
- const DWARFCompileUnit* cu);
+ lldb::offset_t* offset_ptr);
bool IsInlinedCStr() const { return (m_value.data != NULL) && m_value.data == (const uint8_t*)m_value.value.cstr; }
const uint8_t* BlockData() const;
- uint64_t Reference(const DWARFCompileUnit* cu) const;
+ uint64_t Reference() const;
uint64_t Reference (dw_offset_t offset) const;
- bool ResolveCompileUnitReferences(const DWARFCompileUnit* cu);
bool Boolean() const { return m_value.value.uval != 0; }
uint64_t Unsigned() const { return m_value.value.uval; }
void SetUnsigned(uint64_t uval) { m_value.value.uval = uval; }
int64_t Signed() const { return m_value.value.sval; }
void SetSigned(int64_t sval) { m_value.value.sval = sval; }
const char* AsCString(const lldb_private::DWARFDataExtractor* debug_str_data_ptr) const;
- bool SkipValue(const lldb_private::DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) const;
+ bool SkipValue(const lldb_private::DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr) const;
static bool SkipValue(const dw_form_t form, const lldb_private::DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu);
-// static bool TransferValue(dw_form_t form, const lldb_private::DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu, BinaryStreamBuf& out_buff);
-// static bool TransferValue(const DWARFFormValue& formValue, const DWARFCompileUnit* cu, BinaryStreamBuf& out_buff);
-// static bool PutUnsigned(dw_form_t form, dw_offset_t offset, uint64_t value, BinaryStreamBuf& out_buff, const DWARFCompileUnit* cu, bool fixup_cu_relative_refs);
static bool IsBlockForm(const dw_form_t form);
static bool IsDataForm(const dw_form_t form);
static const uint8_t * GetFixedFormSizesForAddressSize (uint8_t addr_size, bool is_dwarf64);
- static int Compare (const DWARFFormValue& a, const DWARFFormValue& b, const DWARFCompileUnit* a_cu, const DWARFCompileUnit* b_cu, const lldb_private::DWARFDataExtractor* debug_str_data_ptr);
+ static int Compare (const DWARFFormValue& a, const DWARFFormValue& b, const lldb_private::DWARFDataExtractor* debug_str_data_ptr);
protected:
+ const DWARFCompileUnit* m_cu; // Compile unit for this form
dw_form_t m_form; // Form for this value
ValueType m_value; // Contains all data for the form
};
for (size_t i=0; i<num_atoms; ++i)
{
- DWARFFormValue form_value (header_data.atoms[i].form);
+ DWARFFormValue form_value (NULL, header_data.atoms[i].form);
- if (!form_value.ExtractValue(data, offset_ptr, NULL))
+ if (!form_value.ExtractValue(data, offset_ptr))
return false;
switch (header_data.atoms[i].type)
if (i > 0)
strm.PutCString (", ");
- DWARFFormValue form_value (header_data.atoms[i].form);
+ DWARFFormValue form_value (NULL, header_data.atoms[i].form);
switch (header_data.atoms[i].type)
{
case eAtomTypeDIEOffset: // DIE offset, check form for encoding
case DW_AT_type:
if (attributes.ExtractFormValueAtIndex(this, i, form_value))
{
- const dw_offset_t type_die_offset = form_value.Reference(dwarf_cu);
+ const dw_offset_t type_die_offset = form_value.Reference();
lldb_type = ResolveTypeUID(type_die_offset);
if (lldb_type)
clang_type = lldb_type->GetClangForwardType();
case DW_AT_decl_line: decl.SetLine(form_value.Unsigned()); break;
case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break;
case DW_AT_name: name = form_value.AsCString(&get_debug_str_data()); break;
- case DW_AT_type: encoding_uid = form_value.Reference(dwarf_cu); break;
+ case DW_AT_type: encoding_uid = form_value.Reference(); break;
case DW_AT_bit_offset: bit_offset = form_value.Unsigned(); break;
case DW_AT_bit_size: bit_size = form_value.Unsigned(); break;
case DW_AT_byte_size: byte_size = form_value.Unsigned(); break;
case DW_AT_decl_file: decl.SetFile(sc.comp_unit->GetSupportFiles().GetFileSpecAtIndex(form_value.Unsigned())); break;
case DW_AT_decl_line: decl.SetLine(form_value.Unsigned()); break;
case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break;
- case DW_AT_type: encoding_uid = form_value.Reference(dwarf_cu); break;
+ case DW_AT_type: encoding_uid = form_value.Reference(); break;
case DW_AT_data_member_location:
if (form_value.BlockData())
{
case DW_AT_decl_line: decl.SetLine(form_value.Unsigned()); break;
case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break;
case DW_AT_name: name = form_value.AsCString(&get_debug_str_data()); break;
- case DW_AT_type: param_type_die_offset = form_value.Reference(dwarf_cu); break;
+ case DW_AT_type: param_type_die_offset = form_value.Reference(); break;
case DW_AT_artificial: is_artificial = form_value.Boolean(); break;
case DW_AT_location:
// if (form_value.BlockData())
break;
case DW_AT_byte_size: byte_size = form_value.Unsigned(); break;
case DW_AT_encoding: encoding = form_value.Unsigned(); break;
- case DW_AT_type: encoding_uid = form_value.Reference(dwarf_cu); break;
+ case DW_AT_type: encoding_uid = form_value.Reference(); break;
default:
case DW_AT_sibling:
break;
type_name_cstr = form_value.AsCString(&get_debug_str_data());
type_name_const_str.SetCString(type_name_cstr);
break;
- case DW_AT_type: encoding_uid = form_value.Reference(dwarf_cu); break;
+ case DW_AT_type: encoding_uid = form_value.Reference(); break;
case DW_AT_byte_size: byte_size = form_value.Unsigned(); break;
case DW_AT_accessibility: break; //accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
case DW_AT_declaration: break; //is_forward_declaration = form_value.Boolean(); break;
case DW_AT_linkage_name:
case DW_AT_MIPS_linkage_name: break; // mangled = form_value.AsCString(&get_debug_str_data()); break;
- case DW_AT_type: type_die_offset = form_value.Reference(dwarf_cu); break;
+ case DW_AT_type: type_die_offset = form_value.Reference(); break;
case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
case DW_AT_declaration: break; // is_forward_declaration = form_value.Boolean(); break;
case DW_AT_inline: is_inline = form_value.Boolean(); break;
break;
case DW_AT_specification:
- specification_die_offset = form_value.Reference(dwarf_cu);
+ specification_die_offset = form_value.Reference();
break;
case DW_AT_abstract_origin:
- abstract_origin_die_offset = form_value.Reference(dwarf_cu);
+ abstract_origin_die_offset = form_value.Reference();
break;
case DW_AT_object_pointer:
- object_pointer_die_offset = form_value.Reference(dwarf_cu);
+ object_pointer_die_offset = form_value.Reference();
break;
case DW_AT_allocated:
type_name_const_str.SetCString(type_name_cstr);
break;
- case DW_AT_type: type_die_offset = form_value.Reference(dwarf_cu); break;
+ case DW_AT_type: type_die_offset = form_value.Reference(); break;
case DW_AT_byte_size: break; // byte_size = form_value.Unsigned(); break;
case DW_AT_byte_stride: byte_stride = form_value.Unsigned(); break;
case DW_AT_bit_stride: bit_stride = form_value.Unsigned(); break;
switch (attr)
{
case DW_AT_type:
- type_die_offset = form_value.Reference(dwarf_cu); break;
+ type_die_offset = form_value.Reference(); break;
case DW_AT_containing_type:
- containing_type_die_offset = form_value.Reference(dwarf_cu); break;
+ containing_type_die_offset = form_value.Reference(); break;
}
}
}
const lldb::addr_t func_low_pc
)
{
-
VariableSP var_sp (m_die_to_variable_sp[die]);
if (var_sp)
return var_sp; // Already been parsed!
{
dw_attr_t attr = attributes.AttributeAtIndex(i);
DWARFFormValue form_value;
+
if (attributes.ExtractFormValueAtIndex(this, i, form_value))
{
switch (attr)
case DW_AT_name: name = form_value.AsCString(&get_debug_str_data()); break;
case DW_AT_linkage_name:
case DW_AT_MIPS_linkage_name: mangled = form_value.AsCString(&get_debug_str_data()); break;
- case DW_AT_type: type_uid = form_value.Reference(dwarf_cu); break;
+ case DW_AT_type: type_uid = form_value.Reference(); break;
case DW_AT_external: is_external = form_value.Boolean(); break;
case DW_AT_const_value:
// If we have already found a DW_AT_location attribute, ignore this attribute.
else if (DWARFFormValue::IsDataForm(form_value.Form()))
{
// Retrieve the value as a data expression.
- const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (dwarf_cu->GetAddressByteSize(), dwarf_cu->IsDWARF64());
+ const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (attributes.CompileUnitAtIndex(i)->GetAddressByteSize(), attributes.CompileUnitAtIndex(i)->IsDWARF64());
uint32_t data_offset = attributes.DIEOffsetAtIndex(i);
uint32_t data_length = fixed_form_sizes[form_value.Form()];
if (data_length == 0)
// Retrieve the value as a string expression.
if (form_value.Form() == DW_FORM_strp)
{
- const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (dwarf_cu->GetAddressByteSize(), dwarf_cu->IsDWARF64());
+ const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (attributes.CompileUnitAtIndex(i)->GetAddressByteSize(), attributes.CompileUnitAtIndex(i)->IsDWARF64());
uint32_t data_offset = attributes.DIEOffsetAtIndex(i);
uint32_t data_length = fixed_form_sizes[form_value.Form()];
location.CopyOpcodeData(module, debug_info_data, data_offset, data_length);
{
location.CopyOpcodeData(module, debug_loc_data, debug_loc_offset, loc_list_length);
assert (func_low_pc != LLDB_INVALID_ADDRESS);
- location.SetLocationListSlide (func_low_pc - dwarf_cu->GetBaseAddress());
+ location.SetLocationListSlide (func_low_pc - attributes.CompileUnitAtIndex(i)->GetBaseAddress());
}
}
}