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:
311 case DW_FORM_loclistx:
312 case DW_FORM_rnglistx:
315 case DW_FORM_ref_udata:
316 case DW_FORM_GNU_addr_index:
317 case DW_FORM_GNU_str_index:
322 case DW_FORM_indirect: {
337 bool unit_relative_offset =
false;
350 case DW_FORM_sec_offset:
354 case DW_FORM_ref_sig8:
361 case DW_FORM_exprloc:
368 case DW_FORM_exprloc:
370 s.
Printf(
"<0x%" PRIx64
"> ", uvalue);
373 s.
Printf(
"<0x%2.2x> ", (uint8_t)uvalue);
376 s.
Printf(
"<0x%4.4x> ", (uint16_t)uvalue);
379 s.
Printf(
"<0x%8.8x> ", (uint32_t)uvalue);
387 const uint8_t *end_data_ptr =
389 while (data_ptr < end_data_ptr) {
390 s.
Printf(
"%2.2x ", *data_ptr);
405 case DW_FORM_line_strp: {
414 case DW_FORM_ref_addr: {
426 unit_relative_offset =
true;
429 unit_relative_offset =
true;
432 unit_relative_offset =
true;
435 unit_relative_offset =
true;
437 case DW_FORM_ref_udata:
438 unit_relative_offset =
true;
443 case DW_FORM_indirect:
446 case DW_FORM_flag_present:
453 if (unit_relative_offset) {
463 if (
m_form == DW_FORM_string)
465 if (
m_form == DW_FORM_strp)
468 if (
m_form == DW_FORM_GNU_str_index ||
m_form == DW_FORM_strx ||
472 std::optional<uint64_t> offset =
479 if (
m_form == DW_FORM_line_strp)
488 if (
m_form == DW_FORM_addr)
492 assert(
m_form == DW_FORM_GNU_addr_index ||
m_form == DW_FORM_addrx ||
500 &offset, index_size);
503std::pair<DWARFUnit *, uint64_t>
511 case DW_FORM_ref_udata:
517 "DW_FORM_ref* DIE reference {0:x16} is outside of its CU", value);
522 case DW_FORM_ref_addr: {
528 "DW_FORM_ref_addr DIE reference {0:x16} has no matching CU", value);
531 return {ref_cu, value};
534 case DW_FORM_ref_sig8: {
549 return unit ? unit->GetDIE(offset) :
DWARFDIE();
559 case DW_FORM_ref_udata:
560 return value + base_offset;
562 case DW_FORM_ref_addr:
563 case DW_FORM_ref_sig8:
564 case DW_FORM_GNU_ref_alt:
576 case DW_FORM_exprloc:
585 llvm_unreachable(
"All cases handled above!");
600 llvm_unreachable(
"All cases handled above!");
607 case DW_FORM_loclistx:
608 case DW_FORM_rnglistx:
621 case DW_FORM_line_strp:
628 case DW_FORM_ref_addr:
633 case DW_FORM_ref_udata:
634 case DW_FORM_indirect:
635 case DW_FORM_sec_offset:
636 case DW_FORM_exprloc:
637 case DW_FORM_flag_present:
638 case DW_FORM_ref_sig8:
639 case DW_FORM_GNU_str_index:
640 case DW_FORM_GNU_addr_index:
641 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.