[LLVMdev] FW: How to debug jit code

James Molloy James.Molloy at arm.com
Fri Oct 8 01:05:50 PDT 2010


Woops, forgot to reply to the list too. 

> Hi,
> 
> Have you read this page? http://llvm.org/docs/DebuggingJITedCode.html
> 
> It contains pretty much what you're asking - it uses a command-line
> switch to lli as opposed to the C++ interface, but if you're using
> llvm::cl for options processing you get that flag automatically (try
> ./your_tool --help | grep jit-emit-debug).
> 
> With that flag enabled you should just be able to run the task under
> GDB and it "just work". In theory :)
> 
> Cheers,
> 
> James
> 
> > -----Original Message-----
> > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-
> bounces at cs.uiuc.edu]
> > On Behalf Of KULBHUSHAN PACHAURI
> > Sent: 08 October 2010 08:45
> > To: llvmdev at cs.uiuc.edu
> > Subject: [LLVMdev] How to debug jit code
> >
> > Hi,
> >
> > Can anyone tell me how can i debug jit code in this scenario..
> >
> > Let say i have one file foo.c with two function foo1 and foo2.
> >
> > file: foo.c
> >
> > int foo1(int in)
> > {
> >    return in%64;
> > }
> >
> > float foo2(float in)
> > {
> >    return in/foo1((int)in);
> > }
> >
> > i generate llvm bytecode (ir) using llvm-gcc --emit-llvm -c ..
> >
> > In test application:
> >
> > load this .bc and create module , and replace function argument with
> > contant val.. and call getpointertofunction.. and when i am using
> this
> > function pointer i am getting segfault...
> >
> > So please tell me if there is a way to debug this..
> >
> > Thanks in advance.
> >
> > Regards,
> > Pachauri
> >
> >
> >
> >
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-- 
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.




More information about the llvm-dev mailing list