std::unique_ptr<DWARFDebugFrame> EHFrame;
std::unique_ptr<DWARFDebugMacro> Macro;
std::unique_ptr<DWARFAcceleratorTable> AppleNames;
+ std::unique_ptr<DWARFAcceleratorTable> AppleTypes;
DWARFUnitSection<DWARFCompileUnit> DWOCUs;
std::deque<DWARFUnitSection<DWARFTypeUnit>> DWOTUs;
/// Get a reference to the parsed accelerator table object.
const DWARFAcceleratorTable &getAppleNames();
+ /// Get a reference to the parsed accelerator table object.
+ const DWARFAcceleratorTable &getAppleTypes();
+
/// Get a pointer to a parsed line table corresponding to a compile unit.
const DWARFDebugLine::LineTable *getLineTableForUnit(DWARFUnit *cu);
if (shouldDump(Explicit, ".apple_types", DIDT_ID_AppleTypes,
DObj->getAppleTypesSection().Data))
- dumpAccelSection(OS, *DObj, DObj->getAppleTypesSection(),
- DObj->getStringSection(), isLittleEndian());
+ getAppleTypes().dump(OS);
if (shouldDump(Explicit, ".apple_namespaces", DIDT_ID_AppleNamespaces,
DObj->getAppleNamespacesSection().Data))
DObj->getStringSection(), isLittleEndian());
}
+const DWARFAcceleratorTable &DWARFContext::getAppleTypes() {
+ return getAccelTable(AppleTypes, *DObj, DObj->getAppleTypesSection(),
+ DObj->getStringSection(), isLittleEndian());
+}
+
const DWARFLineTable *
DWARFContext::getLineTableForUnit(DWARFUnit *U) {
if (!Line)
MULTI-NOT: {{: DW}}
MULTI: DW_AT_name ("x86_64h_var")
MULTI-NOT: {{: DW}}
+
+RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
+RUN: | llvm-dwarfdump -find=int - | FileCheck %s --check-prefix=TYPES
+TYPES: .debug_info contents:
+TYPES-NOT: {{:}}
+TYPES: : DW_TAG_base_type
+TYPES-NOT: {{:}}
+TYPES: DW_AT_name ("int")
+TYPES-NOT: {{:}}
// Handle the --find option and lower it to --debug-info=<offset>.
if (!Find.empty()) {
DumpOffsets[DIDT_ID_DebugInfo] = [&]() -> llvm::Optional<uint64_t> {
- for (auto Name : Find)
- for (auto Entry : DICtx.getAppleNames().equal_range(Name))
- for (auto Atom : Entry)
- if (auto Offset = Atom.getAsSectionOffset())
- return DumpOffsets[DIDT_ID_DebugInfo] = *Offset;
+ for (auto Name : Find) {
+ auto find = [&](const DWARFAcceleratorTable &Accel)
+ -> llvm::Optional<uint64_t> {
+ for (auto Entry : Accel.equal_range(Name))
+ for (auto Atom : Entry)
+ if (auto Offset = Atom.getAsSectionOffset())
+ return Offset;
+ return None;
+ };
+ if (auto Offset = find(DICtx.getAppleNames()))
+ return DumpOffsets[DIDT_ID_DebugInfo] = *Offset;
+ if (auto Offset = find(DICtx.getAppleTypes()))
+ return DumpOffsets[DIDT_ID_DebugInfo] = *Offset;
+ }
return None;
}();
// Early exit if --find was specified but the current file doesn't have it.