LLDB mainline
DWARFUnit.cpp
Go to the documentation of this file.
1//===-- DWARFUnit.cpp -----------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "DWARFUnit.h"
10
11#include "lldb/Core/Module.h"
15#include "lldb/Utility/Timer.h"
16#include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"
17#include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
18#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
19#include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
20#include "llvm/Object/Error.h"
21
22#include "DWARFCompileUnit.h"
23#include "DWARFDebugAranges.h"
24#include "DWARFDebugInfo.h"
25#include "DWARFTypeUnit.h"
26#include "LogChannelDWARF.h"
27#include "SymbolFileDWARFDwo.h"
28#include <optional>
29
30using namespace lldb;
31using namespace lldb_private;
32using namespace lldb_private::dwarf;
33using namespace lldb_private::plugin::dwarf;
34
35extern int g_verbose;
36
38 const llvm::DWARFUnitHeader &header,
39 const llvm::DWARFAbbreviationDeclarationSet &abbrevs,
40 DIERef::Section section, bool is_dwo)
41 : UserID(uid), m_dwarf(dwarf), m_header(header), m_abbrevs(&abbrevs),
42 m_cancel_scopes(false), m_section(section), m_is_dwo(is_dwo),
43 m_has_parsed_non_skeleton_unit(false), m_dwo_id(header.getDWOId()) {}
44
45DWARFUnit::~DWARFUnit() = default;
46
47// Parses first DIE of a compile unit, excluding DWO.
49 {
50 llvm::sys::ScopedReader lock(m_first_die_mutex);
51 if (m_first_die)
52 return; // Already parsed
53 }
54 llvm::sys::ScopedWriter lock(m_first_die_mutex);
55 if (m_first_die)
56 return; // Already parsed
57
59
60 // Set the offset to that of the first DIE and calculate the start of the
61 // next compilation unit header.
63
64 // We are in our compile unit, parse starting at the offset we were told to
65 // parse
66 const DWARFDataExtractor &data = GetData();
67 if (offset < GetNextUnitOffset() &&
68 m_first_die.Extract(data, *this, &offset)) {
70 return;
71 }
72}
73
74// Parses first DIE of a compile unit including DWO.
77
79 return;
80
83
84 if (!m_dwo_id)
85 return; // No DWO file.
86
87 std::shared_ptr<SymbolFileDWARFDwo> dwo_symbol_file =
89 if (!dwo_symbol_file)
90 return;
91
92 DWARFUnit *dwo_cu = dwo_symbol_file->GetDWOCompileUnitForHash(*m_dwo_id);
93
94 if (!dwo_cu) {
96 "unable to load .dwo file from \"{0}\" due to ID ({1:x16}) mismatch "
97 "for skeleton DIE at {2:x8}",
98 dwo_symbol_file->GetObjectFile()->GetFileSpec().GetPath(), *m_dwo_id,
100 return; // Can't fetch the compile unit from the dwo file.
101 }
102
103 // Link the DWO unit to this object, if it hasn't been linked already (this
104 // can happen when we have an index, and the DWO unit is parsed first).
105 if (!dwo_cu->LinkToSkeletonUnit(*this)) {
107 "multiple compile units with Dwo ID {0:x16}", *m_dwo_id));
108 return;
109 }
110
111 DWARFBaseDIE dwo_cu_die = dwo_cu->GetUnitDIEOnly();
112 if (!dwo_cu_die.IsValid()) {
113 // Can't fetch the compile unit DIE from the dwo file.
115 "unable to extract compile unit DIE from .dwo file for skeleton "
116 "DIE at {0:x16}",
118 return;
119 }
120
121 // Here for DWO CU we want to use the address base set in the skeleton unit
122 // (DW_AT_addr_base) if it is available and use the DW_AT_GNU_addr_base
123 // otherwise. We do that because pre-DWARF v5 could use the DW_AT_GNU_*
124 // attributes which were applicable to the DWO units. The corresponding
125 // DW_AT_* attributes standardized in DWARF v5 are also applicable to the
126 // main unit in contrast.
127 if (m_addr_base)
128 dwo_cu->SetAddrBase(*m_addr_base);
129 else if (m_gnu_addr_base)
131
132 if (GetVersion() <= 4 && m_gnu_ranges_base)
134 else if (dwo_symbol_file->GetDWARFContext()
135 .getOrLoadRngListsData()
136 .GetByteSize() > 0)
137 dwo_cu->SetRangesBase(llvm::DWARFListTableHeader::getHeaderSize(DWARF32));
138
139 if (GetVersion() >= 5 &&
140 dwo_symbol_file->GetDWARFContext().getOrLoadLocListsData().GetByteSize() >
141 0)
142 dwo_cu->SetLoclistsBase(llvm::DWARFListTableHeader::getHeaderSize(DWARF32));
143
145
146 m_dwo = std::shared_ptr<DWARFUnit>(std::move(dwo_symbol_file), dwo_cu);
147}
148
149// Parses a compile unit and indexes its DIEs if it hasn't already been done.
150// It will leave this compile unit extracted forever.
152 m_cancel_scopes = true;
153
154 {
155 llvm::sys::ScopedReader lock(m_die_array_mutex);
156 if (!m_die_array.empty())
157 return; // Already parsed
158 }
159 llvm::sys::ScopedWriter lock(m_die_array_mutex);
160 if (!m_die_array.empty())
161 return; // Already parsed
162
164}
165
166// Parses a compile unit and indexes its DIEs if it hasn't already been done.
167// It will clear this compile unit after returned instance gets out of scope,
168// no other ScopedExtractDIEs instance is running for this compile unit
169// and no ExtractDIEsIfNeeded() has been executed during this ScopedExtractDIEs
170// lifetime.
172 ScopedExtractDIEs scoped(*this);
173
174 {
175 llvm::sys::ScopedReader lock(m_die_array_mutex);
176 if (!m_die_array.empty())
177 return scoped; // Already parsed
178 }
179 llvm::sys::ScopedWriter lock(m_die_array_mutex);
180 if (!m_die_array.empty())
181 return scoped; // Already parsed
182
183 // Otherwise m_die_array would be already populated.
185
187 scoped.m_clear_dies = true;
188 return scoped;
189}
190
192 m_cu->m_die_array_scoped_mutex.lock_shared();
193}
194
196 if (!m_cu)
197 return;
198 m_cu->m_die_array_scoped_mutex.unlock_shared();
199 if (!m_clear_dies || m_cu->m_cancel_scopes)
200 return;
201 // Be sure no other ScopedExtractDIEs is running anymore.
202 llvm::sys::ScopedWriter lock_scoped(m_cu->m_die_array_scoped_mutex);
203 llvm::sys::ScopedWriter lock(m_cu->m_die_array_mutex);
204 if (m_cu->m_cancel_scopes)
205 return;
206 m_cu->ClearDIEsRWLocked();
207}
208
210 : m_cu(rhs.m_cu), m_clear_dies(rhs.m_clear_dies) {
211 rhs.m_cu = nullptr;
212}
213
216 m_cu = rhs.m_cu;
217 rhs.m_cu = nullptr;
218 m_clear_dies = rhs.m_clear_dies;
219 return *this;
220}
221
222// Parses a compile unit and indexes its DIEs, m_die_array_mutex must be
223// held R/W and m_die_array must be empty.
225 llvm::sys::ScopedWriter first_die_lock(m_first_die_mutex);
226
229 "%s",
230 llvm::formatv("{0:x16}: DWARFUnit::ExtractDIEsIfNeeded()", GetOffset())
231 .str()
232 .c_str());
233
234 // Set the offset to that of the first DIE and calculate the start of the
235 // next compilation unit header.
237 lldb::offset_t next_cu_offset = GetNextUnitOffset();
238
240
241 uint32_t depth = 0;
242 // We are in our compile unit, parse starting at the offset we were told to
243 // parse
244 const DWARFDataExtractor &data = GetData();
245 std::vector<uint32_t> die_index_stack;
246 die_index_stack.reserve(32);
247 die_index_stack.push_back(0);
248 bool prev_die_had_children = false;
249 while (offset < next_cu_offset && die.Extract(data, *this, &offset)) {
250 const bool null_die = die.IsNULL();
251 if (depth == 0) {
252 assert(m_die_array.empty() && "Compile unit DIE already added");
253
254 // The average bytes per DIE entry has been seen to be around 14-20 so
255 // lets pre-reserve half of that since we are now stripping the NULL
256 // tags.
257
258 // Only reserve the memory if we are adding children of the main
259 // compile unit DIE. The compile unit DIE is always the first entry, so
260 // if our size is 1, then we are adding the first compile unit child
261 // DIE and should reserve the memory.
262 m_die_array.reserve(GetDebugInfoSize() / 24);
263 m_die_array.push_back(die);
264
265 if (!m_first_die)
266 AddUnitDIE(m_die_array.front());
267
268 // With -fsplit-dwarf-inlining, clang will emit non-empty skeleton compile
269 // units. We are not able to access these DIE *and* the dwo file
270 // simultaneously. We also don't need to do that as the dwo file will
271 // contain a superset of information. So, we don't even attempt to parse
272 // any remaining DIEs.
273 if (m_dwo) {
274 m_die_array.front().SetHasChildren(false);
275 break;
276 }
277
278 } else {
279 if (null_die) {
280 if (prev_die_had_children) {
281 // This will only happen if a DIE says is has children but all it
282 // contains is a NULL tag. Since we are removing the NULL DIEs from
283 // the list (saves up to 25% in C++ code), we need a way to let the
284 // DIE know that it actually doesn't have children.
285 if (!m_die_array.empty())
286 m_die_array.back().SetHasChildren(false);
287 }
288 } else {
289 die.SetParentIndex(m_die_array.size() - die_index_stack[depth - 1]);
290
291 if (die_index_stack.back())
292 m_die_array[die_index_stack.back()].SetSiblingIndex(
293 m_die_array.size() - die_index_stack.back());
294
295 // Only push the DIE if it isn't a NULL DIE
296 m_die_array.push_back(die);
297 }
298 }
299
300 if (null_die) {
301 // NULL DIE.
302 if (!die_index_stack.empty())
303 die_index_stack.pop_back();
304
305 if (depth > 0)
306 --depth;
307 prev_die_had_children = false;
308 } else {
309 die_index_stack.back() = m_die_array.size() - 1;
310 // Normal DIE
311 const bool die_has_children = die.HasChildren();
312 if (die_has_children) {
313 die_index_stack.push_back(0);
314 ++depth;
315 }
316 prev_die_had_children = die_has_children;
317 }
318
319 if (depth == 0)
320 break; // We are done with this compile unit!
321 }
322
323 if (!m_die_array.empty()) {
324 // The last die cannot have children (if it did, it wouldn't be the last
325 // one). This only makes a difference for malformed dwarf that does not have
326 // a terminating null die.
327 m_die_array.back().SetHasChildren(false);
328
329 if (m_first_die) {
330 // Only needed for the assertion.
331 m_first_die.SetHasChildren(m_die_array.front().HasChildren());
333 }
334 m_first_die = m_die_array.front();
335 }
336
337 m_die_array.shrink_to_fit();
338
339 if (m_dwo)
340 m_dwo->ExtractDIEsIfNeeded();
341}
342
343// This is used when a split dwarf is enabled.
344// A skeleton compilation unit may contain the DW_AT_str_offsets_base attribute
345// that points to the first string offset of the CU contribution to the
346// .debug_str_offsets. At the same time, the corresponding split debug unit also
347// may use DW_FORM_strx* forms pointing to its own .debug_str_offsets.dwo and
348// for that case, we should find the offset (skip the section header).
350 lldb::offset_t baseOffset = 0;
351
352 if (const llvm::DWARFUnitIndex::Entry *entry = m_header.getIndexEntry()) {
353 if (const auto *contribution =
354 entry->getContribution(llvm::DW_SECT_STR_OFFSETS))
355 baseOffset = contribution->getOffset();
356 else
357 return;
358 }
359
360 if (GetVersion() >= 5) {
361 const DWARFDataExtractor &strOffsets =
363 uint64_t length = strOffsets.GetU32(&baseOffset);
364 if (length == 0xffffffff)
365 length = strOffsets.GetU64(&baseOffset);
366
367 // Check version.
368 if (strOffsets.GetU16(&baseOffset) < 5)
369 return;
370
371 // Skip padding.
372 baseOffset += 2;
373 }
374
375 SetStrOffsetsBase(baseOffset);
376}
377
378std::optional<uint64_t> DWARFUnit::GetDWOId() {
380 return m_dwo_id;
381}
382
383// m_die_array_mutex must be already held as read/write.
385 DWARFAttributes attributes = cu_die.GetAttributes(this);
386
387 // Extract DW_AT_addr_base first, as other attributes may need it.
388 for (size_t i = 0; i < attributes.Size(); ++i) {
389 if (attributes.AttributeAtIndex(i) != DW_AT_addr_base)
390 continue;
391 DWARFFormValue form_value;
392 if (attributes.ExtractFormValueAtIndex(i, form_value)) {
393 SetAddrBase(form_value.Unsigned());
394 break;
395 }
396 }
397
398 for (size_t i = 0; i < attributes.Size(); ++i) {
399 dw_attr_t attr = attributes.AttributeAtIndex(i);
400 DWARFFormValue form_value;
401 if (!attributes.ExtractFormValueAtIndex(i, form_value))
402 continue;
403 switch (attr) {
404 default:
405 break;
406 case DW_AT_loclists_base:
407 SetLoclistsBase(form_value.Unsigned());
408 break;
409 case DW_AT_rnglists_base:
410 SetRangesBase(form_value.Unsigned());
411 break;
412 case DW_AT_str_offsets_base:
413 SetStrOffsetsBase(form_value.Unsigned());
414 break;
415 case DW_AT_low_pc:
416 SetBaseAddress(form_value.Address());
417 break;
418 case DW_AT_entry_pc:
419 // If the value was already set by DW_AT_low_pc, don't update it.
421 SetBaseAddress(form_value.Address());
422 break;
423 case DW_AT_stmt_list:
424 m_line_table_offset = form_value.Unsigned();
425 break;
426 case DW_AT_GNU_addr_base:
427 m_gnu_addr_base = form_value.Unsigned();
428 break;
429 case DW_AT_GNU_ranges_base:
430 m_gnu_ranges_base = form_value.Unsigned();
431 break;
432 case DW_AT_GNU_dwo_id:
433 m_dwo_id = form_value.Unsigned();
434 break;
435 }
436 }
437
438 if (m_is_dwo) {
441 return;
442 }
443}
444
447}
448
449const llvm::DWARFAbbreviationDeclarationSet *
451 return m_abbrevs;
452}
453
455 return m_abbrevs ? m_abbrevs->getOffset() : DW_INVALID_OFFSET;
456}
457
460 return m_line_table_offset;
461}
462
463void DWARFUnit::SetAddrBase(dw_addr_t addr_base) { m_addr_base = addr_base; }
464
465// Parse the rangelist table header, including the optional array of offsets
466// following it (DWARF v5 and later).
467template <typename ListTableType>
468static llvm::Expected<ListTableType>
469ParseListTableHeader(const llvm::DWARFDataExtractor &data, uint64_t offset,
470 DwarfFormat format) {
471 // We are expected to be called with Offset 0 or pointing just past the table
472 // header. Correct Offset in the latter case so that it points to the start
473 // of the header.
474 if (offset == 0) {
475 // This means DW_AT_rnglists_base is missing and therefore DW_FORM_rnglistx
476 // cannot be handled. Returning a default-constructed ListTableType allows
477 // DW_FORM_sec_offset to be supported.
478 return ListTableType();
479 }
480
481 uint64_t HeaderSize = llvm::DWARFListTableHeader::getHeaderSize(format);
482 if (offset < HeaderSize)
483 return llvm::createStringError(std::errc::invalid_argument,
484 "did not detect a valid"
485 " list table with base = 0x%" PRIx64 "\n",
486 offset);
487 offset -= HeaderSize;
488 ListTableType Table;
489 if (llvm::Error E = Table.extractHeaderAndOffsets(data, &offset))
490 return std::move(E);
491 return Table;
492}
493
495 uint64_t offset = 0;
496 if (const llvm::DWARFUnitIndex::Entry *entry = m_header.getIndexEntry()) {
497 const auto *contribution = entry->getContribution(llvm::DW_SECT_LOCLISTS);
498 if (!contribution) {
499 GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
500 "Failed to find location list contribution for CU with DWO Id "
501 "{0:x16}",
502 *GetDWOId());
503 return;
504 }
505 offset += contribution->getOffset();
506 }
507 m_loclists_base = loclists_base;
508
509 uint64_t header_size = llvm::DWARFListTableHeader::getHeaderSize(DWARF32);
510 if (loclists_base < header_size)
511 return;
512
513 m_loclist_table_header.emplace(".debug_loclists", "locations");
514 offset += loclists_base - header_size;
515 if (llvm::Error E = m_loclist_table_header->extract(
517 &offset)) {
518 GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
519 "Failed to extract location list table at offset {0:x16} (location "
520 "list base: {1:x16}): {2}",
521 offset, loclists_base, toString(std::move(E)).c_str());
522 }
523}
524
525std::unique_ptr<llvm::DWARFLocationTable>
527 llvm::DWARFDataExtractor llvm_data(
529 data.GetAddressByteSize());
530
531 if (m_is_dwo || GetVersion() >= 5)
532 return std::make_unique<llvm::DWARFDebugLoclists>(llvm_data, GetVersion());
533 return std::make_unique<llvm::DWARFDebugLoc>(llvm_data);
534}
535
538 const DWARFDataExtractor &data =
540 if (const llvm::DWARFUnitIndex::Entry *entry = m_header.getIndexEntry()) {
541 if (const auto *contribution = entry->getContribution(
542 GetVersion() >= 5 ? llvm::DW_SECT_LOCLISTS : llvm::DW_SECT_EXT_LOC))
543 return DWARFDataExtractor(data, contribution->getOffset(),
544 contribution->getLength32());
545 return DWARFDataExtractor();
546 }
547 return data;
548}
549
552 const DWARFDataExtractor &data = Ctx.getOrLoadRngListsData();
553 if (const llvm::DWARFUnitIndex::Entry *entry = m_header.getIndexEntry()) {
554 if (const auto *contribution =
555 entry->getContribution(llvm::DW_SECT_RNGLISTS))
556 return DWARFDataExtractor(data, contribution->getOffset(),
557 contribution->getLength32());
558 GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
559 "Failed to find range list contribution for CU with signature {0:x16}",
560 entry->getSignature());
561
562 return DWARFDataExtractor();
563 }
564 return data;
565}
566
569
570 m_ranges_base = ranges_base;
571}
572
573const std::optional<llvm::DWARFDebugRnglistTable> &
575 if (GetVersion() >= 5 && !m_rnglist_table_done) {
577 if (auto table_or_error =
578 ParseListTableHeader<llvm::DWARFDebugRnglistTable>(
579 GetRnglistData().GetAsLLVMDWARF(), m_ranges_base, DWARF32))
580 m_rnglist_table = std::move(table_or_error.get());
581 else
582 GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
583 "Failed to extract range list table at offset {0:x16}: {1}",
584 m_ranges_base, toString(table_or_error.takeError()).c_str());
585 }
586 return m_rnglist_table;
587}
588
589// This function is called only for DW_FORM_rnglistx.
590llvm::Expected<uint64_t> DWARFUnit::GetRnglistOffset(uint32_t Index) {
591 if (!GetRnglistTable())
592 return llvm::createStringError(std::errc::invalid_argument,
593 "missing or invalid range list table");
594 if (!m_ranges_base)
595 return llvm::createStringError(
596 std::errc::invalid_argument,
597 llvm::formatv("DW_FORM_rnglistx cannot be used without "
598 "DW_AT_rnglists_base for CU at {0:x16}",
599 GetOffset())
600 .str()
601 .c_str());
602 if (std::optional<uint64_t> off = GetRnglistTable()->getOffsetEntry(
603 GetRnglistData().GetAsLLVM(), Index))
604 return *off + m_ranges_base;
605 return llvm::createStringError(
606 std::errc::invalid_argument,
607 "invalid range list table index %u; OffsetEntryCount is %u, "
608 "DW_AT_rnglists_base is %" PRIu64,
609 Index, GetRnglistTable()->getOffsetEntryCount(), m_ranges_base);
610}
611
613 m_str_offsets_base = str_offsets_base;
614}
615
617 uint32_t index_size = GetAddressByteSize();
618 dw_offset_t addr_base = GetAddrBase();
619 dw_addr_t offset = addr_base + static_cast<dw_addr_t>(index) * index_size;
620 const DWARFDataExtractor &data =
622 if (data.ValidOffsetForDataOfSize(offset, index_size))
623 return data.GetMaxU64_unchecked(&offset, index_size);
625}
626
627// It may be called only with m_die_array_mutex held R/W.
629 m_die_array.clear();
630 m_die_array.shrink_to_fit();
631
632 if (m_dwo && !m_dwo->m_cancel_scopes)
633 m_dwo->ClearDIEsRWLocked();
634}
635
638}
639
640void DWARFUnit::SetBaseAddress(dw_addr_t base_addr) { m_base_addr = base_addr; }
641
642// Compare function DWARFDebugAranges::Range structures
644 const dw_offset_t die_offset) {
645 return die.GetOffset() < die_offset;
646}
647
648// GetDIE()
649//
650// Get the DIE (Debug Information Entry) with the specified offset by first
651// checking if the DIE is contained within this compile unit and grabbing the
652// DIE from this compile unit. Otherwise we grab the DIE from the DWARF file.
655 if (die_offset == DW_INVALID_OFFSET)
656 return DWARFDIE(); // Not found
657
658 if (!ContainsDIEOffset(die_offset)) {
659 GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
660 "GetDIE for DIE {0:x16} is outside of its CU {1:x16}", die_offset,
661 GetOffset());
662 return DWARFDIE(); // Not found
663 }
664
668 lower_bound(m_die_array.cbegin(), end, die_offset, CompareDIEOffset);
669
670 if (pos != end && die_offset == (*pos).GetOffset())
671 return DWARFDIE(this, &(*pos));
672 return DWARFDIE(); // Not found
673}
674
675llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) {
677 if (!die.Extract(GetData(), *this, &die_offset))
678 return llvm::StringRef();
679
680 // Does die contain a DW_AT_Name?
681 if (const char *name =
682 die.GetAttributeValueAsString(this, DW_AT_name, nullptr))
683 return name;
684
685 // Does its DW_AT_specification or DW_AT_abstract_origin contain an AT_Name?
686 for (auto attr : {DW_AT_specification, DW_AT_abstract_origin}) {
687 DWARFFormValue form_value;
688 if (!die.GetAttributeValue(this, attr, form_value))
689 continue;
690 auto [unit, offset] = form_value.ReferencedUnitAndOffset();
691 if (unit)
692 if (auto name = unit->PeekDIEName(offset); !name.empty())
693 return name;
694 }
695
696 return llvm::StringRef();
697}
698
701 if (m_dwo)
702 return *m_dwo;
703 return *this;
704}
705
707 if (cu)
708 return cu->GetAddressByteSize();
710}
711
712uint8_t DWARFUnit::GetDefaultAddressSize() { return 4; }
713
715 if (m_skeleton_unit.load() == nullptr && IsDWOUnit()) {
716 SymbolFileDWARFDwo *dwo =
717 llvm::dyn_cast_or_null<SymbolFileDWARFDwo>(&GetSymbolFileDWARF());
718 // Do a reverse lookup if the skeleton compile unit wasn't set.
719 DWARFUnit *candidate_skeleton_unit =
720 dwo ? dwo->GetBaseSymbolFile().GetSkeletonUnit(this) : nullptr;
721 if (candidate_skeleton_unit)
722 (void)LinkToSkeletonUnit(*candidate_skeleton_unit);
723 // Linking may fail due to a race, so be sure to return the actual value.
724 }
725 return llvm::dyn_cast_or_null<DWARFCompileUnit>(m_skeleton_unit.load());
726}
727
729 DWARFUnit *expected_unit = nullptr;
730 if (m_skeleton_unit.compare_exchange_strong(expected_unit, &skeleton_unit))
731 return true;
732 if (expected_unit == &skeleton_unit) {
733 // Exchange failed because it already contained the right value.
734 return true;
735 }
736 return false; // Already linked to a different unit.
737}
738
741 return GetProducerVersion() >= llvm::VersionTuple(425, 0, 13);
742 // Assume all other compilers didn't have incorrect ObjC bitfield info.
743 return true;
744}
745
749 if (!die)
750 return;
751
752 llvm::StringRef producer(
753 die->GetAttributeValueAsString(this, DW_AT_producer, nullptr));
754 if (producer.empty())
755 return;
756
757 static const RegularExpression g_swiftlang_version_regex(
758 llvm::StringRef(R"(swiftlang-([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?))"));
759 static const RegularExpression g_clang_version_regex(
760 llvm::StringRef(R"(clang-([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?))"));
761
762 llvm::SmallVector<llvm::StringRef, 3> matches;
763 if (g_swiftlang_version_regex.Execute(producer, &matches)) {
764 m_producer_version.tryParse(matches[1]);
766 } else if (producer.contains("clang")) {
767 if (g_clang_version_regex.Execute(producer, &matches))
768 m_producer_version.tryParse(matches[1]);
770 } else if (producer.contains("GNU")) {
772 }
773}
774
778 return m_producer;
779}
780
781llvm::VersionTuple DWARFUnit::GetProducerVersion() {
782 if (m_producer_version.empty())
784 return m_producer_version;
785}
786
788 if (m_language_type)
789 return *m_language_type;
790
792 if (!die)
793 m_language_type = 0;
794 else
795 m_language_type = die->GetAttributeValueAsUnsigned(this, DW_AT_language, 0);
796 return *m_language_type;
797}
798
802 if (die) {
804 if (die->GetAttributeValueAsUnsigned(this, DW_AT_APPLE_optimized, 0) ==
805 1) {
807 }
808 }
809 }
811}
812
814 if (!m_comp_dir)
816 return m_comp_dir->GetPathStyle();
817}
818
820 if (!m_comp_dir)
822 return *m_comp_dir;
823}
824
826 if (!m_file_spec)
828 return *m_file_spec;
829}
830
831FileSpec DWARFUnit::GetFile(size_t file_idx) {
832 return m_dwarf.GetFile(*this, file_idx);
833}
834
835// DWARF2/3 suggests the form hostname:pathname for compilation directory.
836// Remove the host part if present.
837static llvm::StringRef
838removeHostnameFromPathname(llvm::StringRef path_from_dwarf) {
839 if (!path_from_dwarf.contains(':'))
840 return path_from_dwarf;
841 llvm::StringRef host, path;
842 std::tie(host, path) = path_from_dwarf.split(':');
843
844 if (host.contains('/'))
845 return path_from_dwarf;
846
847 // check whether we have a windows path, and so the first character is a
848 // drive-letter not a hostname.
849 if (host.size() == 1 && llvm::isAlpha(host[0]) &&
850 (path.starts_with("\\") || path.starts_with("/")))
851 return path_from_dwarf;
852
853 return path;
854}
855
859 if (!die)
860 return;
861
862 llvm::StringRef comp_dir = removeHostnameFromPathname(
863 die->GetAttributeValueAsString(this, DW_AT_comp_dir, nullptr));
864 if (!comp_dir.empty()) {
865 FileSpec::Style comp_dir_style =
866 FileSpec::GuessPathStyle(comp_dir).value_or(FileSpec::Style::native);
867 m_comp_dir = FileSpec(comp_dir, comp_dir_style);
868 } else {
869 // Try to detect the style based on the DW_AT_name attribute, but just store
870 // the detected style in the m_comp_dir field.
871 const char *name =
872 die->GetAttributeValueAsString(this, DW_AT_name, nullptr);
874 "", FileSpec::GuessPathStyle(name).value_or(FileSpec::Style::native));
875 }
876}
877
881 if (!die)
882 return;
883
885 FileSpec(die->GetAttributeValueAsString(this, DW_AT_name, nullptr),
886 GetPathStyle());
887
888 if (m_file_spec->IsRelative())
889 m_file_spec->MakeAbsolute(GetCompilationDirectory());
890}
891
893 if (load_all_debug_info)
895 if (m_dwo)
896 return &llvm::cast<SymbolFileDWARFDwo>(m_dwo->GetSymbolFileDWARF());
897 return nullptr;
898}
899
901 if (m_func_aranges_up == nullptr) {
902 m_func_aranges_up = std::make_unique<DWARFDebugAranges>();
903 const DWARFDebugInfoEntry *die = DIEPtr();
904 if (die)
906
907 if (m_dwo) {
908 const DWARFDebugInfoEntry *dwo_die = m_dwo->DIEPtr();
909 if (dwo_die)
911 m_func_aranges_up.get());
912 }
913
914 const bool minimize = false;
915 m_func_aranges_up->Sort(minimize);
916 }
917 return *m_func_aranges_up;
918}
919
920llvm::Expected<DWARFUnitSP>
922 const DWARFDataExtractor &debug_info,
923 DIERef::Section section, lldb::offset_t *offset_ptr) {
924 assert(debug_info.ValidOffset(*offset_ptr));
925
926 DWARFContext &context = dwarf.GetDWARFContext();
927
928 // FIXME: Either properly map between DIERef::Section and
929 // llvm::DWARFSectionKind or switch to llvm's definition entirely.
930 llvm::DWARFSectionKind section_kind_llvm =
932 ? llvm::DWARFSectionKind::DW_SECT_INFO
933 : llvm::DWARFSectionKind::DW_SECT_EXT_TYPES;
934
935 llvm::DWARFDataExtractor debug_info_llvm = debug_info.GetAsLLVMDWARF();
936 llvm::DWARFUnitHeader header;
937 if (llvm::Error extract_err = header.extract(
938 context.GetAsLLVM(), debug_info_llvm, offset_ptr, section_kind_llvm))
939 return std::move(extract_err);
940
941 if (context.isDwo()) {
942 const llvm::DWARFUnitIndex::Entry *entry = nullptr;
943 const llvm::DWARFUnitIndex &index = header.isTypeUnit()
944 ? context.GetAsLLVM().getTUIndex()
945 : context.GetAsLLVM().getCUIndex();
946 if (index) {
947 if (header.isTypeUnit())
948 entry = index.getFromHash(header.getTypeHash());
949 else if (auto dwo_id = header.getDWOId())
950 entry = index.getFromHash(*dwo_id);
951 }
952 if (!entry)
953 entry = index.getFromOffset(header.getOffset());
954 if (entry)
955 if (llvm::Error err = header.applyIndexEntry(entry))
956 return std::move(err);
957 }
958
959 const llvm::DWARFDebugAbbrev *abbr = dwarf.DebugAbbrev();
960 if (!abbr)
961 return llvm::make_error<llvm::object::GenericBinaryError>(
962 "No debug_abbrev data");
963
964 bool abbr_offset_OK =
965 dwarf.GetDWARFContext().getOrLoadAbbrevData().ValidOffset(
966 header.getAbbrOffset());
967 if (!abbr_offset_OK)
968 return llvm::make_error<llvm::object::GenericBinaryError>(
969 "Abbreviation offset for unit is not valid");
970
971 llvm::Expected<const llvm::DWARFAbbreviationDeclarationSet *> abbrevs_or_err =
972 abbr->getAbbreviationDeclarationSet(header.getAbbrOffset());
973 if (!abbrevs_or_err)
974 return abbrevs_or_err.takeError();
975
976 const llvm::DWARFAbbreviationDeclarationSet *abbrevs = *abbrevs_or_err;
977 if (!abbrevs)
978 return llvm::make_error<llvm::object::GenericBinaryError>(
979 "No abbrev exists at the specified offset.");
980
981 bool is_dwo = dwarf.GetDWARFContext().isDwo();
982 if (header.isTypeUnit())
983 return DWARFUnitSP(
984 new DWARFTypeUnit(dwarf, uid, header, *abbrevs, section, is_dwo));
985 return DWARFUnitSP(
986 new DWARFCompileUnit(dwarf, uid, header, *abbrevs, section, is_dwo));
987}
988
993}
994
996 switch (m_header.getUnitType()) {
997 case llvm::dwarf::DW_UT_compile:
998 case llvm::dwarf::DW_UT_partial:
999 return GetVersion() < 5 ? 11 : 12;
1000 case llvm::dwarf::DW_UT_skeleton:
1001 case llvm::dwarf::DW_UT_split_compile:
1002 return 20;
1003 case llvm::dwarf::DW_UT_type:
1004 case llvm::dwarf::DW_UT_split_type:
1005 return GetVersion() < 5 ? 23 : 24;
1006 }
1007 llvm_unreachable("invalid UnitType.");
1008}
1009
1010std::optional<uint64_t>
1012 lldb::offset_t offset = GetStrOffsetsBase() + index * 4;
1014}
1015
1016llvm::Expected<llvm::DWARFAddressRangesVector>
1018 if (GetVersion() <= 4) {
1019 llvm::DWARFDataExtractor data =
1021 data.setAddressSize(m_header.getAddressByteSize());
1022
1023 llvm::DWARFDebugRangeList list;
1024 if (llvm::Error e = list.extract(data, &offset))
1025 return e;
1026 return list.getAbsoluteRanges(
1027 llvm::object::SectionedAddress{GetBaseAddress()});
1028 }
1029
1030 // DWARF >= v5
1031 if (!GetRnglistTable())
1032 return llvm::createStringError(std::errc::invalid_argument,
1033 "missing or invalid range list table");
1034
1035 llvm::DWARFDataExtractor data = GetRnglistData().GetAsLLVMDWARF();
1036
1037 // As DW_AT_rnglists_base may be missing we need to call setAddressSize.
1038 data.setAddressSize(m_header.getAddressByteSize());
1039 auto range_list_or_error = GetRnglistTable()->findList(data, offset);
1040 if (!range_list_or_error)
1041 return range_list_or_error.takeError();
1042
1043 return range_list_or_error->getAbsoluteRanges(
1044 llvm::object::SectionedAddress{GetBaseAddress()}, GetAddressByteSize(),
1045 [&](uint32_t index) {
1046 uint32_t index_size = GetAddressByteSize();
1047 dw_offset_t addr_base = GetAddrBase();
1048 lldb::offset_t offset =
1049 addr_base + static_cast<lldb::offset_t>(index) * index_size;
1050 return llvm::object::SectionedAddress{
1052 &offset, index_size)};
1053 });
1054}
1055
1056llvm::Expected<llvm::DWARFAddressRangesVector>
1058 llvm::Expected<uint64_t> maybe_offset = GetRnglistOffset(index);
1059 if (!maybe_offset)
1060 return maybe_offset.takeError();
1061 return FindRnglistFromOffset(*maybe_offset);
1062}
1063
1064bool DWARFUnit::HasAny(llvm::ArrayRef<dw_tag_t> tags) {
1066 if (m_dwo)
1067 return m_dwo->HasAny(tags);
1068
1069 for (const auto &die : m_die_array) {
1070 for (const auto tag : tags) {
1071 if (tag == die.Tag())
1072 return true;
1073 }
1074 }
1075 return false;
1076}
static bool CompareDIEOffset(const DWARFDebugInfoEntry &die, const dw_offset_t die_offset)
Definition: DWARFUnit.cpp:643
static llvm::Expected< ListTableType > ParseListTableHeader(const llvm::DWARFDataExtractor &data, uint64_t offset, DwarfFormat format)
Definition: DWARFUnit.cpp:469
static llvm::StringRef removeHostnameFromPathname(llvm::StringRef path_from_dwarf)
Definition: DWARFUnit.cpp:838
int g_verbose
#define lldbassert(x)
Definition: LLDBAssert.h:15
static double elapsed(const StatsTimepoint &start, const StatsTimepoint &end)
Definition: Statistics.cpp:39
#define LLDB_SCOPED_TIMERF(...)
Definition: Timer.h:86
llvm::DWARFDataExtractor GetAsLLVMDWARF() const
An data extractor class.
Definition: DataExtractor.h:48
uint64_t GetU64(lldb::offset_t *offset_ptr) const
Extract a uint64_t value from *offset_ptr.
const void * GetData(lldb::offset_t *offset_ptr, lldb::offset_t length) const
Extract length bytes from *offset_ptr.
uint64_t GetMaxU64_unchecked(lldb::offset_t *offset_ptr, size_t byte_size) const
uint32_t GetU32(lldb::offset_t *offset_ptr) const
Extract a uint32_t value from *offset_ptr.
uint16_t GetU16(lldb::offset_t *offset_ptr) const
Extract a uint16_t value from *offset_ptr.
bool ValidOffset(lldb::offset_t offset) const
Test the validity of offset.
uint32_t GetAddressByteSize() const
Get the current address size.
uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const
Extract an unsigned integer of size byte_size from *offset_ptr.
lldb::ByteOrder GetByteOrder() const
Get the current byte order value.
A class that measures elapsed time in an exception safe way.
Definition: Statistics.h:76
A file utility class.
Definition: FileSpec.h:56
static std::optional< Style > GuessPathStyle(llvm::StringRef absolute_path)
Attempt to guess path style for a given path string.
Definition: FileSpec.cpp:310
llvm::sys::path::Style Style
Definition: FileSpec.h:58
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
Definition: ModuleChild.cpp:24
virtual lldb::ByteOrder GetByteOrder() const =0
Gets whether endian swapping should occur when extracting data from this object file.
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
void Clear()
Clear the object state.
Definition: Status.cpp:215
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
Definition: Status.h:148
ObjectFile * GetObjectFile() override
Definition: SymbolFile.h:536
dw_attr_t AttributeAtIndex(uint32_t i) const
bool ExtractFormValueAtIndex(uint32_t i, DWARFFormValue &form_value) const
const DWARFDataExtractor & getOrLoadLocListsData()
const DWARFDataExtractor & getOrLoadStrOffsetsData()
const DWARFDataExtractor & getOrLoadDebugTypesData()
const DWARFDataExtractor & getOrLoadDebugInfoData()
const DWARFDataExtractor & getOrLoadRangesData()
const DWARFDataExtractor & getOrLoadRngListsData()
const DWARFDataExtractor & getOrLoadLocData()
const DWARFDataExtractor & getOrLoadAddrData()
DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic o...
DWARFAttributes GetAttributes(DWARFUnit *cu, Recurse recurse=Recurse::yes) const
void BuildFunctionAddressRangeTable(DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const
This function is builds a table very similar to the standard .debug_aranges table,...
const char * GetAttributeValueAsString(const DWARFUnit *cu, const dw_attr_t attr, const char *fail_value, bool check_elaborating_dies=false) const
uint64_t GetAttributeValueAsUnsigned(const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_elaborating_dies=false) const
bool Extract(const DWARFDataExtractor &data, const DWARFUnit &cu, lldb::offset_t *offset_ptr)
dw_offset_t GetAttributeValue(const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &formValue, dw_offset_t *end_attr_offset_ptr=nullptr, bool check_elaborating_dies=false) const
std::pair< DWARFUnit *, uint64_t > ReferencedUnitAndOffset() const
If this is a reference to another DIE, return the corresponding DWARFUnit and DIE offset such that Un...
const ScopedExtractDIEs & operator=(const ScopedExtractDIEs &)=delete
std::optional< dw_addr_t > m_addr_base
Value of DW_AT_addr_base.
Definition: DWARFUnit.h:333
llvm::Expected< llvm::DWARFAddressRangesVector > FindRnglistFromOffset(dw_offset_t offset)
Return a list of address ranges resulting from a (possibly encoded) range list starting at a given of...
Definition: DWARFUnit.cpp:1017
std::unique_ptr< llvm::DWARFLocationTable > GetLocationTable(const DataExtractor &data) const
Return the location table for parsing the given location list data.
Definition: DWARFUnit.cpp:526
std::optional< FileSpec > m_file_spec
Definition: DWARFUnit.h:332
size_t GetLengthByteSize() const
Get the size in bytes of the length field in the header.
Definition: DWARFUnit.h:105
std::optional< llvm::DWARFDebugRnglistTable > m_rnglist_table
Definition: DWARFUnit.h:344
const DWARFDebugInfoEntry * GetUnitDIEPtrOnly()
Definition: DWARFUnit.h:283
llvm::sys::RWMutex m_die_array_mutex
Definition: DWARFUnit.h:312
bool LinkToSkeletonUnit(DWARFUnit &skeleton_unit)
Definition: DWARFUnit.cpp:728
dw_offset_t m_line_table_offset
Value of DW_AT_stmt_list.
Definition: DWARFUnit.h:340
llvm::sys::RWMutex m_die_array_scoped_mutex
Definition: DWARFUnit.h:314
void SetStrOffsetsBase(dw_offset_t str_offsets_base)
Definition: DWARFUnit.cpp:612
std::atomic< bool > m_cancel_scopes
Definition: DWARFUnit.h:317
Status m_dwo_error
If we get an error when trying to load a .dwo file, save that error here.
Definition: DWARFUnit.h:356
void SetLoclistsBase(dw_addr_t loclists_base)
Definition: DWARFUnit.cpp:494
SymbolFileDWARF & GetSymbolFileDWARF() const
Definition: DWARFUnit.h:177
const DWARFDebugAranges & GetFunctionAranges()
Definition: DWARFUnit.cpp:900
const DWARFDataExtractor & GetData() const
Get the data that contains the DIE information for this unit.
Definition: DWARFUnit.cpp:989
static llvm::Expected< DWARFUnitSP > extract(SymbolFileDWARF &dwarf2Data, lldb::user_id_t uid, const DWARFDataExtractor &debug_info, DIERef::Section section, lldb::offset_t *offset_ptr)
Definition: DWARFUnit.cpp:921
DWARFCompileUnit * GetSkeletonUnit()
Get the skeleton compile unit for a DWO file.
Definition: DWARFUnit.cpp:714
dw_addr_t ReadAddressFromDebugAddrSection(uint32_t index) const
Definition: DWARFUnit.cpp:616
const DWARFDebugInfoEntry * DIEPtr()
Definition: DWARFUnit.h:292
bool ContainsDIEOffset(dw_offset_t die_offset) const
Definition: DWARFUnit.h:107
std::optional< FileSpec > m_comp_dir
Definition: DWARFUnit.h:331
dw_offset_t GetFirstDIEOffset() const
Definition: DWARFUnit.h:111
std::optional< uint64_t > m_language_type
Definition: DWARFUnit.h:329
llvm::StringRef PeekDIEName(dw_offset_t die_offset)
Returns the AT_Name of the DIE at die_offset, if it exists, without parsing the entire compile unit.
Definition: DWARFUnit.cpp:675
DWARFDebugInfoEntry::collection m_die_array
Definition: DWARFUnit.h:311
void SetBaseAddress(dw_addr_t base_addr)
Definition: DWARFUnit.cpp:640
std::optional< uint64_t > m_gnu_ranges_base
Definition: DWARFUnit.h:337
const llvm::DWARFAbbreviationDeclarationSet * m_abbrevs
Definition: DWARFUnit.h:306
const DIERef::Section m_section
Definition: DWARFUnit.h:348
dw_offset_t GetNextUnitOffset() const
Definition: DWARFUnit.h:114
DWARFDataExtractor GetLocationData() const
Definition: DWARFUnit.cpp:536
const std::optional< llvm::DWARFDebugRnglistTable > & GetRnglistTable()
Definition: DWARFUnit.cpp:574
llvm::Expected< uint64_t > GetRnglistOffset(uint32_t Index)
Return a rangelist's offset based on an index.
Definition: DWARFUnit.cpp:590
std::unique_ptr< DWARFDebugAranges > m_func_aranges_up
Definition: DWARFUnit.h:325
dw_addr_t m_ranges_base
Value of DW_AT_rnglists_base.
Definition: DWARFUnit.h:335
dw_addr_t m_loclists_base
Value of DW_AT_loclists_base.
Definition: DWARFUnit.h:334
void SetRangesBase(dw_addr_t ranges_base)
Definition: DWARFUnit.cpp:567
uint32_t GetHeaderByteSize() const
Get the size in bytes of the unit header.
Definition: DWARFUnit.cpp:995
void SetAddrBase(dw_addr_t addr_base)
Definition: DWARFUnit.cpp:463
void SetDwoError(Status &&error)
Set the fission .dwo file specific error for this compile unit.
Definition: DWARFUnit.h:269
std::optional< llvm::DWARFListTableHeader > m_loclist_table_header
Definition: DWARFUnit.h:346
llvm::VersionTuple GetProducerVersion()
Definition: DWARFUnit.cpp:781
std::optional< uint64_t > m_dwo_id
Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).
Definition: DWARFUnit.h:352
llvm::Expected< llvm::DWARFAddressRangesVector > FindRnglistFromIndex(uint32_t index)
Return a list of address ranges retrieved from an encoded range list whose offset is found via a tabl...
Definition: DWARFUnit.cpp:1057
std::shared_ptr< DWARFUnit > m_dwo
Definition: DWARFUnit.h:304
std::optional< uint64_t > m_gnu_addr_base
Definition: DWARFUnit.h:336
DWARFUnit(SymbolFileDWARF &dwarf, lldb::user_id_t uid, const llvm::DWARFUnitHeader &header, const llvm::DWARFAbbreviationDeclarationSet &abbrevs, DIERef::Section section, bool is_dwo)
Definition: DWARFUnit.cpp:37
llvm::VersionTuple m_producer_version
Definition: DWARFUnit.h:328
std::optional< uint64_t > GetStringOffsetSectionItem(uint32_t index) const
Definition: DWARFUnit.cpp:1011
DWARFDIE GetDIE(dw_offset_t die_offset)
Definition: DWARFUnit.cpp:654
lldb::ByteOrder GetByteOrder() const
Definition: DWARFUnit.cpp:636
void AddUnitDIE(const DWARFDebugInfoEntry &cu_die)
Definition: DWARFUnit.cpp:384
llvm::sys::RWMutex m_first_die_mutex
Definition: DWARFUnit.h:322
SymbolFileDWARFDwo * GetDwoSymbolFile(bool load_all_debug_info=true)
Definition: DWARFUnit.cpp:892
const FileSpec & GetCompilationDirectory()
Definition: DWARFUnit.cpp:819
std::optional< uint64_t > GetDWOId()
Get the DWO ID from the DWARFUnitHeader for DWARF5, or from the unit DIE's DW_AT_dwo_id or DW_AT_GNU_...
Definition: DWARFUnit.cpp:378
llvm::DWARFUnitHeader m_header
Definition: DWARFUnit.h:305
const llvm::DWARFAbbreviationDeclarationSet * GetAbbreviations() const
Definition: DWARFUnit.cpp:450
bool HasAny(llvm::ArrayRef< dw_tag_t > tags)
Returns true if any DIEs in the unit match any DW_TAG values in tags.
Definition: DWARFUnit.cpp:1064
std::atomic< DWARFUnit * > m_skeleton_unit
Definition: DWARFUnit.h:309
DWARFDataExtractor GetRnglistData() const
Definition: DWARFUnit.cpp:550
FileSpec GetFile(size_t file_idx)
Definition: DWARFUnit.cpp:831
DWARFUnit * GetSkeletonUnit(DWARFUnit *dwo_unit)
Given a DWO DWARFUnit, find the corresponding skeleton DWARFUnit in the main symbol file.
FileSpec GetFile(DWARFUnit &unit, size_t file_idx)
std::shared_ptr< SymbolFileDWARFDwo > GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die)
uint64_t dw_offset_t
Definition: dwarf.h:30
#define DW_INVALID_OFFSET
Definition: dwarf.h:35
llvm::dwarf::Attribute dw_attr_t
Definition: dwarf.h:23
uint64_t dw_addr_t
Definition: dwarf.h:26
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:82
std::shared_ptr< DWARFUnit > DWARFUnitSP
Definition: DWARFUnit.h:31
A class that represents a running process on the host machine.
const char * toString(AppleArm64ExceptionClass EC)
Definition: SBAddress.h:15
uint64_t offset_t
Definition: lldb-types.h:85
ByteOrder
Byte ordering definitions.
@ eByteOrderLittle
uint64_t user_id_t
Definition: lldb-types.h:82
A mix in class that contains a generic user ID.
Definition: UserID.h:31