34 if (
m_form == DW_FORM_implicit_const)
37 bool indirect =
false;
38 bool is_block =
false;
40 uint8_t ref_addr_size;
79 case DW_FORM_line_strp:
80 case DW_FORM_sec_offset:
108 case DW_FORM_ref_sig8:
112 case DW_FORM_loclistx:
113 case DW_FORM_rnglistx:
116 case DW_FORM_ref_udata:
117 case DW_FORM_GNU_str_index:
118 case DW_FORM_GNU_addr_index:
121 case DW_FORM_ref_addr:
129 case DW_FORM_indirect:
133 case DW_FORM_flag_present:
193 if (form <= DW_FORM_ref_sig8 &&
g_form_sizes[form].valid)
195 if (form == DW_FORM_addr && u)
213 uint8_t ref_addr_size;
217 case DW_FORM_exprloc:
218 case DW_FORM_block: {
219 uint64_t size = debug_info_data.
GetULEB128(offset_ptr);
223 case DW_FORM_block1: {
224 uint8_t size = debug_info_data.
GetU8(offset_ptr);
228 case DW_FORM_block2: {
229 uint16_t size = debug_info_data.
GetU16(offset_ptr);
233 case DW_FORM_block4: {
234 uint32_t size = debug_info_data.
GetU32(offset_ptr);
241 debug_info_data.
GetCStr(offset_ptr);
249 case DW_FORM_ref_addr:
257 *offset_ptr += ref_addr_size;
261 case DW_FORM_flag_present:
262 case DW_FORM_implicit_const:
289 case DW_FORM_sec_offset:
291 case DW_FORM_line_strp:
306 case DW_FORM_ref_sig8:
312 case DW_FORM_loclistx:
313 case DW_FORM_rnglistx:
316 case DW_FORM_ref_udata:
317 case DW_FORM_GNU_addr_index:
318 case DW_FORM_GNU_str_index:
323 case DW_FORM_indirect: {
338 bool unit_relative_offset =
false;
351 case DW_FORM_sec_offset:
355 case DW_FORM_ref_sig8:
362 case DW_FORM_exprloc:
369 case DW_FORM_exprloc:
371 s.
Printf(
"<0x%" PRIx64
"> ", uvalue);
374 s.
Printf(
"<0x%2.2x> ", (uint8_t)uvalue);
377 s.
Printf(
"<0x%4.4x> ", (uint16_t)uvalue);
380 s.
Printf(
"<0x%8.8x> ", (uint32_t)uvalue);
388 const uint8_t *end_data_ptr =
390 while (data_ptr < end_data_ptr) {
391 s.
Printf(
"%2.2x ", *data_ptr);
406 case DW_FORM_line_strp: {
415 case DW_FORM_ref_addr: {
427 unit_relative_offset =
true;
430 unit_relative_offset =
true;
433 unit_relative_offset =
true;
436 unit_relative_offset =
true;
438 case DW_FORM_ref_udata:
439 unit_relative_offset =
true;
444 case DW_FORM_indirect:
447 case DW_FORM_flag_present:
454 if (unit_relative_offset) {
464 if (
m_form == DW_FORM_string)
466 if (
m_form == DW_FORM_strp)
469 if (
m_form == DW_FORM_GNU_str_index ||
m_form == DW_FORM_strx ||
473 std::optional<uint64_t> offset =
480 if (
m_form == DW_FORM_line_strp)
489 if (
m_form == DW_FORM_addr)
493 assert(
m_form == DW_FORM_GNU_addr_index ||
m_form == DW_FORM_addrx ||
501 &offset, index_size);
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->
GetDIE(value);
534 case DW_FORM_ref_sig8: {
554 case DW_FORM_ref_udata:
555 return value + base_offset;
557 case DW_FORM_ref_addr:
558 case DW_FORM_ref_sig8:
559 case DW_FORM_GNU_ref_alt:
571 case DW_FORM_exprloc:
580 llvm_unreachable(
"All cases handled above!");
595 llvm_unreachable(
"All cases handled above!");
602 case DW_FORM_loclistx:
603 case DW_FORM_rnglistx:
616 case DW_FORM_line_strp:
623 case DW_FORM_ref_addr:
628 case DW_FORM_ref_udata:
629 case DW_FORM_indirect:
630 case DW_FORM_sec_offset:
631 case DW_FORM_exprloc:
632 case DW_FORM_flag_present:
633 case DW_FORM_ref_sig8:
634 case DW_FORM_GNU_str_index:
635 case DW_FORM_GNU_addr_index:
636 case DW_FORM_implicit_const:
DWARFTypeUnit * GetTypeUnitForHash(uint64_t hash)
DWARFUnit * GetUnitContainingDIEOffset(DIERef::Section section, dw_offset_t die_offset)
dw_offset_t GetTypeOffset()
SymbolFileDWARF & GetSymbolFileDWARF() const
uint16_t GetVersion() const
dw_addr_t GetAddrBase() const
uint8_t GetAddressByteSize() const
std::optional< uint64_t > GetStringOffsetSectionItem(uint32_t index) const
bool ContainsDIEOffset(dw_offset_t die_offset) const
DWARFDIE GetDIE(dw_offset_t die_offset)
dw_offset_t GetOffset() const
DWARFDebugInfo & DebugInfo()
lldb_private::DWARFContext & GetDWARFContext()
const DWARFDataExtractor & getOrLoadStrData()
const DWARFDataExtractor & getOrLoadLineStrData()
const DWARFDataExtractor & getOrLoadAddrData()
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
#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.