Add a very minimal set of .cfi_* statements to get part of backtraces

working (on hello world at least):

~/inst/gdb/bin/gdb --args ./foo
(gdb) b write
...
(gdb) r
...
Breakpoint 1, 0xf7f04270 in write () from /lib32/libc.so.6
(gdb) bt
0  0xf7f04270 in write () from /lib32/libc.so.6
1  0x0804931a in rust_native_cdecl_3 ()
2  0x080487d7 in _rust_wrapper3_ ()
3  0x0804890a in _rust_fn5_main ()
4  0x08049440 in rust_native_cdecl_7 ()
This commit is contained in:
Rafael Ávila de Espíndola
2011-04-28 16:14:04 -04:00
parent 6daca7ea8d
commit b0980b7d79
2 changed files with 35 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ extern "C" void LLVMRustWriteOutputFile(LLVMPassManagerRef PMR, LLVMModuleRef M,
LLVMCodeGenFileType FileType) {
// Set compilation options.
llvm::NoFramePointerElim = true;
llvm::UnwindTablesMandatory = true;
InitializeAllTargets();
InitializeAllAsmPrinters();