mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
llvm-objdump: Take the data from the right object when there's no dSYM around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140269 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
519020adf1
commit
91c603bcfe
@ -347,6 +347,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
|
||||
DebugLineSection, DebugStrSection;
|
||||
OwningPtr<DIContext> diContext;
|
||||
OwningPtr<MachOObject> DSYMObj;
|
||||
MachOObject *DbgInfoObj = MachOObj.get();
|
||||
// Try to find debug info and set up the DIContext for it.
|
||||
if (UseDbg) {
|
||||
ArrayRef<Section> DebugSections = Sections;
|
||||
@ -368,29 +369,30 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
|
||||
getSectionsAndSymbols(Header, DSYMObj.get(), 0, DSYMSections, Symbols,
|
||||
FoundFns);
|
||||
DebugSections = DSYMSections;
|
||||
DbgInfoObj = DSYMObj.get();
|
||||
}
|
||||
|
||||
// Find the named debug info sections.
|
||||
for (unsigned SectIdx = 0; SectIdx != DebugSections.size(); SectIdx++) {
|
||||
if (!strcmp(DebugSections[SectIdx].Name, "__debug_abbrev"))
|
||||
DebugAbbrevSection = DSYMObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugSections[SectIdx].Size);
|
||||
DebugAbbrevSection = DbgInfoObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugSections[SectIdx].Size);
|
||||
else if (!strcmp(DebugSections[SectIdx].Name, "__debug_info"))
|
||||
DebugInfoSection = DSYMObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugSections[SectIdx].Size);
|
||||
else if (!strcmp(DebugSections[SectIdx].Name, "__debug_aranges"))
|
||||
DebugArangesSection = DSYMObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugInfoSection = DbgInfoObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugSections[SectIdx].Size);
|
||||
else if (!strcmp(DebugSections[SectIdx].Name, "__debug_aranges"))
|
||||
DebugArangesSection = DbgInfoObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugSections[SectIdx].Size);
|
||||
else if (!strcmp(DebugSections[SectIdx].Name, "__debug_line"))
|
||||
DebugLineSection = DSYMObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugSections[SectIdx].Size);
|
||||
DebugLineSection = DbgInfoObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugSections[SectIdx].Size);
|
||||
else if (!strcmp(DebugSections[SectIdx].Name, "__debug_str"))
|
||||
DebugStrSection = DSYMObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugSections[SectIdx].Size);
|
||||
DebugStrSection = DbgInfoObj->getData(DebugSections[SectIdx].Offset,
|
||||
DebugSections[SectIdx].Size);
|
||||
}
|
||||
|
||||
// Setup the DIContext.
|
||||
diContext.reset(DIContext::getDWARFContext(MachOObj->isLittleEndian(),
|
||||
diContext.reset(DIContext::getDWARFContext(DbgInfoObj->isLittleEndian(),
|
||||
DebugInfoSection,
|
||||
DebugAbbrevSection,
|
||||
DebugArangesSection,
|
||||
|
Loading…
Reference in New Issue
Block a user