[LLVMdev] About debug in LLVM!!!
sanjiv.gupta at microchip.com
Mon Jun 29 10:20:37 PDT 2009
Do you want to debug the native executables generated by your back-end?
What debug info format your native executables support?
In general, this is how it works for that case.
1. clang-cc -g generates required debug info in the .bc file.
2. The backend (llc) converts that to Dwarf (or something else as
desired by that back-end).
3. Native debuggers like (gdb) understands Dwarf and provide source
level debugging eventually.
> 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
> /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 can?///
> / ///
> /Best regards,///
> /Artem Rudskyy///
> Robert L. Bocchino Jr.
> Ph.D. Student
> University of Illinois, Urbana-Champaign
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev