33 if (
m_form == DW_FORM_implicit_const)
36 bool indirect =
false;
37 bool is_block =
false;
39 uint8_t ref_addr_size;
78 case DW_FORM_line_strp:
79 case DW_FORM_sec_offset:
107 case DW_FORM_ref_sig8:
111 case DW_FORM_loclistx:
112 case DW_FORM_rnglistx:
115 case DW_FORM_ref_udata:
116 case DW_FORM_GNU_str_index:
117 case DW_FORM_GNU_addr_index:
120 case DW_FORM_ref_addr:
128 case DW_FORM_indirect:
132 case DW_FORM_flag_present:
192 if (form <= DW_FORM_ref_sig8 &&
g_form_sizes[form].valid)
194 if (form == DW_FORM_addr && u)
212 uint8_t ref_addr_size;
216 case DW_FORM_exprloc:
217 case DW_FORM_block: {
218 uint64_t size = debug_info_data.
GetULEB128(offset_ptr);
222 case DW_FORM_block1: {
223 uint8_t size = debug_info_data.
GetU8(offset_ptr);
227 case DW_FORM_block2: {
228 uint16_t size = debug_info_data.
GetU16(offset_ptr);
232 case DW_FORM_block4: {
233 uint32_t size = debug_info_data.
GetU32(offset_ptr);
240 debug_info_data.
GetCStr(offset_ptr);
248 case DW_FORM_ref_addr:
256 *offset_ptr += ref_addr_size;
260 case DW_FORM_flag_present:
261 case DW_FORM_implicit_const:
288 case DW_FORM_sec_offset:
290 case DW_FORM_line_strp:
305 case DW_FORM_ref_sig8:
316 case DW_FORM_loclistx:
317 case DW_FORM_rnglistx:
320 case DW_FORM_ref_udata:
321 case DW_FORM_GNU_addr_index:
322 case DW_FORM_GNU_str_index:
327 case DW_FORM_indirect: {
342 bool unit_relative_offset =
false;
355 case DW_FORM_sec_offset:
359 case DW_FORM_ref_sig8:
366 case DW_FORM_exprloc:
373 case DW_FORM_exprloc:
375 s.
Printf(
"<0x%" PRIx64
"> ", uvalue);
378 s.
Printf(
"<0x%2.2x> ", (uint8_t)uvalue);
381 s.
Printf(
"<0x%4.4x> ", (uint16_t)uvalue);
384 s.
Printf(
"<0x%8.8x> ", (uint32_t)uvalue);
390 const uint8_t *data_ptr =
m_value.data;
392 const uint8_t *end_data_ptr =
394 while (data_ptr < end_data_ptr) {
395 s.
Printf(
"%2.2x ", *data_ptr);
410 case DW_FORM_line_strp: {
419 case DW_FORM_ref_addr: {
431 unit_relative_offset =
true;
434 unit_relative_offset =
true;
437 unit_relative_offset =
true;
440 unit_relative_offset =
true;
442 case DW_FORM_ref_udata:
443 unit_relative_offset =
true;
448 case DW_FORM_indirect:
451 case DW_FORM_flag_present:
458 if (unit_relative_offset) {
468 if (
m_form == DW_FORM_string)
470 if (
m_form == DW_FORM_strp)
473 if (
m_form == DW_FORM_GNU_str_index ||
m_form == DW_FORM_strx ||
477 std::optional<uint64_t> offset =
484 if (
m_form == DW_FORM_line_strp)
493 if (
m_form == DW_FORM_addr)
497 assert(
m_form == DW_FORM_GNU_addr_index ||
m_form == DW_FORM_addrx ||
505 &offset, index_size);
508std::pair<DWARFUnit *, uint64_t>
516 case DW_FORM_ref_udata:
522 "DW_FORM_ref* DIE reference {0:x16} is outside of its CU", value);
527 case DW_FORM_ref_addr: {
533 "DW_FORM_ref_addr DIE reference {0:x16} has no matching CU", value);
536 return {ref_cu, value};
539 case DW_FORM_ref_sig8: {
554 return unit ? unit->GetDIE(offset) :
DWARFDIE();
564 case DW_FORM_ref_udata:
565 return value + base_offset;
567 case DW_FORM_ref_addr:
568 case DW_FORM_ref_sig8:
569 case DW_FORM_GNU_ref_alt:
585 (
m_form == lldb_private::dwarf::DW_FORM_udata &&
586 uint64_t(std::numeric_limits<int64_t>::max()) <
m_value.uval))
589 case lldb_private::dwarf::DW_FORM_data4:
591 case lldb_private::dwarf::DW_FORM_data2:
593 case lldb_private::dwarf::DW_FORM_data1:
595 case lldb_private::dwarf::DW_FORM_sdata:
596 case lldb_private::dwarf::DW_FORM_data8:
606 case DW_FORM_exprloc:
616 llvm_unreachable(
"All cases handled above!");
631 llvm_unreachable(
"All cases handled above!");
638 case DW_FORM_loclistx:
639 case DW_FORM_rnglistx:
653 case DW_FORM_line_strp:
660 case DW_FORM_ref_addr:
665 case DW_FORM_ref_udata:
666 case DW_FORM_indirect:
667 case DW_FORM_sec_offset:
668 case DW_FORM_exprloc:
669 case DW_FORM_flag_present:
670 case DW_FORM_ref_sig8:
671 case DW_FORM_GNU_str_index:
672 case DW_FORM_GNU_addr_index:
673 case DW_FORM_implicit_const:
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
A stream class that can stream formatted output to a file.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t size_t PutHex8(uint8_t uvalue)
Append an uint8_t value in the hexadecimal format to the stream.
size_t PutHex64(uint64_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
size_t PutHex16(uint16_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
void QuotedCString(const char *cstr, const char *format="\"%s\"")
Output a quoted C string value to the stream.
size_t PutHex32(uint32_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
size_t PutULEB128(uint64_t uval)
Output a ULEB128 number to the stream.
size_t PutSLEB128(int64_t uval)
Output a SLEB128 number to the stream.
ObjectFile * GetObjectFile() override
const DWARFDataExtractor & getOrLoadStrData()
const DWARFDataExtractor & getOrLoadLineStrData()
const DWARFDataExtractor & getOrLoadAddrData()
DWARFTypeUnit * GetTypeUnitForHash(uint64_t hash)
DWARFUnit * GetUnitContainingDIEOffset(DIERef::Section section, dw_offset_t die_offset)
dw_offset_t GetTypeOffset()
uint8_t GetAddressByteSize() const
SymbolFileDWARF & GetSymbolFileDWARF() const
bool ContainsDIEOffset(dw_offset_t die_offset) const
dw_offset_t GetOffset() const
uint16_t GetVersion() const
dw_addr_t GetAddrBase() const
std::optional< uint64_t > GetStringOffsetSectionItem(uint32_t index) const
DWARFDebugInfo & DebugInfo()
DWARFContext & GetDWARFContext()
#define DW_INVALID_OFFSET
llvm::dwarf::Form dw_form_t
A class that represents a running process on the host machine.
void DumpAddress(llvm::raw_ostream &s, uint64_t addr, uint32_t addr_size, const char *prefix=nullptr, const char *suffix=nullptr)
Output an address value to this stream.