Add debug support for X86/ELF targets (Linux). This allows llvm-gcc4

generated object modules to be debugged with gdb. Hopefully this helps
pre-release debugging.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31299 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-10-30 22:32:30 +00:00
parent 6ce644392e
commit 02b8511364
9 changed files with 59 additions and 17 deletions

View File

@@ -114,6 +114,9 @@ bool X86SharedAsmPrinter::doInitialization(Module &M) {
if (!Subtarget->is64Bit())
X86PICStyle = PICStyle::Stub;
// Emit initial debug information.
DW.BeginModule(&M);
} else if (Subtarget->isTargetELF()) {
// Emit initial debug information.
DW.BeginModule(&M);
}
@@ -278,7 +281,7 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
O << "\t.long\t0\n";
}
// Emit initial debug information.
// Emit final debug information.
DW.EndModule();
// Funny Darwin hack: This flag tells the linker that no global symbols
@@ -287,6 +290,9 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
// linker can safely perform dead code stripping. Since LLVM never
// generates code that does this, it is always safe to set.
O << "\t.subsections_via_symbols\n";
} else if (Subtarget->isTargetELF()) {
// Emit final debug information.
DW.EndModule();
}
AsmPrinter::doFinalization(M);