mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +00:00
[dsymutil] Add the detected target triple to the debug map.
It will be needed to instantiate the Target object that we will use to create all the MC objects for the dwarf emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226525 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -97,6 +97,13 @@ void MachODebugMapParser::switchToNewDebugMapObject(StringRef Filename) {
|
||||
CurrentDebugMapObject = &Result->addDebugMapObject(Path);
|
||||
}
|
||||
|
||||
static Triple getTriple(const object::MachOObjectFile &Obj) {
|
||||
Triple TheTriple("unknown-unknown-unknown");
|
||||
TheTriple.setArch(Triple::ArchType(Obj.getArch()));
|
||||
TheTriple.setObjectFormat(Triple::MachO);
|
||||
return TheTriple;
|
||||
}
|
||||
|
||||
/// This main parsing routine tries to open the main binary and if
|
||||
/// successful iterates over the STAB entries. The real parsing is
|
||||
/// done in handleStabSymbolTableEntry.
|
||||
@@ -107,7 +114,7 @@ ErrorOr<std::unique_ptr<DebugMap>> MachODebugMapParser::parse() {
|
||||
|
||||
const MachOObjectFile &MainBinary = *MainBinOrError;
|
||||
loadMainBinarySymbols();
|
||||
Result = make_unique<DebugMap>();
|
||||
Result = make_unique<DebugMap>(getTriple(MainBinary));
|
||||
MainBinaryStrings = MainBinary.getStringTableData();
|
||||
for (const SymbolRef &Symbol : MainBinary.symbols()) {
|
||||
const DataRefImpl &DRI = Symbol.getRawDataRefImpl();
|
||||
|
||||
Reference in New Issue
Block a user