[LLVMdev] LLVM Compiler Infrastructure and GDB debugger

Eli Friedman eli.friedman at gmail.com
Sun Jun 28 11:31:32 PDT 2009

On Sun, Jun 28, 2009 at 4:15 AM, Rudskyy<tema13tema at yahoo.de> wrote:
> Where will place “llvm-gcc” the symbol table for GDB?

The relevant information is all available in the .bc file, but not in
any directly usable format; the LLVM code generator (in lib/CodeGen)
writes the appropriate assembly so that the assembler writes the
appropriate symbol table and debug info in the assembled .o file.

Symbols fall out naturally from having a native .o file, since the
linker needs to be able to read them.  Detailed source-level debug
info gets written out by include/CodeGen/DwarfWriter.h and related
code; if you're not using a LLVM-style backend, you'll need to call
into it yourself.  You should be able to do some limited amount of
debugging without debug information, though, so I'd suggest
concentrating on getting everything else working first.

> Perhaps, must GDB knows the architecture of
> processor? If yes, so where it must be written?

Yes, gdb must be aware of the target; if it's a target gdb knows
about, it should be enough to pass an appropriate "--target" to
configure, but otherwise you'll have to write some code.  See
http://sourceware.org/gdb/download/onlinedocs/gdbint_9.html#SEC83 and
http://sourceware.org/gdb/download/onlinedocs/gdbint_15.html, I guess,
but I don't know very much about it.


More information about the llvm-dev mailing list