diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-21 18:18:53 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-21 18:18:53 +0000 |
commit | 37a7151b1fb990f2f09c51757d661d1f957e4e44 (patch) | |
tree | 97639fdd40037c25f6d9cf1bef10f51da8e1ca83 | |
parent | 9c70e04becf660d6fdd076b5da1c5433d2eb422c (diff) | |
download | bcm5719-llvm-37a7151b1fb990f2f09c51757d661d1f957e4e44.tar.gz bcm5719-llvm-37a7151b1fb990f2f09c51757d661d1f957e4e44.zip |
llvm-objdump: Take the data from the right object when there's no dSYM around.
llvm-svn: 140269
-rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index 0daf9d4214a..22eaab7de03 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -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, |