[LLVMdev] debugging LLVM generated executables???

Mark Oskin oskin at cs.washington.edu
Mon May 5 16:17:24 PDT 2008


Hi everyone,

I have a question that seems simple, but has been confounding me for  
several hours.  I'd like to debug a binary produced with LLVM.  For  
the life of me, I can't get any symbols into gdb and llvm-db won't  
even start the program nor load any useful information about it.   
Here's my current strategy (which isn't working):

llvm-gcc -g -O0 -c -emit-llvm helloworld.c
opt -load=mypass.dylib -mypass < helloworld.o > helloworld-mypass.o
llvm-ld -native -o helloworld helloworld-mypass.o
gdb helloworld

I've tried several variations on the above.

Any suggestions?

Note, what is critical about the whole thing is I must run "mypass" on  
the bytecode file.  I'm hoping there's an easy fix, that will both  
allow me to run my arbitrary pass, and debug a program.

thanks,

-Mark



More information about the llvm-dev mailing list