[LLVMdev] About debug in LLVM!!!

Rudskyy tema13tema at yahoo.de
Mon Jun 29 08:55:02 PDT 2009

Hi all LLVMdev!


Here is a question: 

I try to understand how I can realize a debugging in LLVM!?

I have written a back end for my target and now I need a debug.

I asked developers Chris Lattner and Robert L. Bocchino. They recommend me
ask the LLVMdev.

Is there a tool like "llvm-db" about Robert said?

Here a mail from Robert:


On Jun 29, 2009, at 17:14 PM, Robert L. Bocchino Jr wrote:


Hi Artem, 

Thanks for your interest in LLVM.  I haven't ever used LLVM for source-level
debugging.  From scanning that page (SourceLevelDebugging.html) it seems to
describe the format that LLVM bytecode uses to encode debug information, but
it doesn't say anything about what tool to use or how to use it to actually
to the debugging.  I think gdb would not work with this, because gdb doesn't
understand anything about the LLVM bytecode representation -- you'd need
some gdb-like tool that works with LLVM this way.  I seem to recall there
was a tool "llvm-db" but I don't see that described on the site now.  I
think your best bet is to email llvm-dev with this question, or maybe ask
Chris Lattner or Jim Laskey (the authors of the debug info document) to
point you in the right direction.





On Jun 26, 2009, at 1:21 PM, Rudskyy wrote:


Hallo, Robert L. Bocchino Jr.!

I have found you in LLVM Developers page (http://llvm.org/developers.cgi).

First thank you for all of your work with LLVM.



I work with the LLVM Compiler Infrastructure to implement a backend for
specific processor xPEC of chip NetX (http://hilscher.com/netx..html
<http://hilscher.com/netx.html> ).

So C-code already possible compile to the native xPEC assembly code (works
perfect! LLWM a big power!).

Now I need to debug the source C-code, that I compile for xPEC-processor. I
have read the article "Source Level Debugging with LLVM"
(http://llvm.org/docs/SourceLevelDebugging.html), where were described that
is possible to use debugger GDB. Wonderful! I have found much information
about GDB (of coursehttp://sourceware.org/gdb/ ) and it has a debugging of
remote programs.


I don't understand how must be compiled the C-code with "llvm-gcc". Wenn I
use option "-emit-llvm" [backend needs it] of course with "-g" and "-O0",
then GDB can't find a symbol table in bc-file.  Where will place "llvm-gcc"
the symbol table for DGB? Perhaps, must GDB knows the architecture of
processor? If yes, so where it must be written?   I have many questions and
need some help.

Do you can help me what must I read and search ore recommend somebody to


Best regards,

Artem Rudskyy





Robert L. Bocchino Jr.

Ph.D. Student

University of Illinois, Urbana-Champaign


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090629/4f35f509/attachment.html>

More information about the llvm-dev mailing list