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. Rob 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. About: 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. Problem: 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 http://www..uni-magdeburg.de/ieat/robotslab/ <http://www.uni-magdeburg.de/ieat/robotslab/> http://www.uni-magdeburg.de/ 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>
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. - Sanjiv Rudskyy wrote:> > 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. > > Rob > > _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./// > > / /// > > /About:/// > > /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./// > > /Problem:/// > > /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/// > > /http://www...uni-magdeburg.de/ieat/robotslab/ > <http://www.uni-magdeburg.de/ieat/robotslab/>/// > > /http://www.uni-magdeburg.de//// > > 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 > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Hello, I'm not sure whether Bugpoint does what you are looking for but it comes with LLVM. It's documentation is found at http://llvm.org/cmds/bugpoint.html so if you want to look into that, that may answer your question. It's the closest thing I've found to an LLVM debugging tool. Sorry I can't help more than this. --Sam 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 therea tool like "llvm-db" about Robert said? >Here a mail from Robert: > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090629/af2d66c5/attachment.html>