[LLVMdev] problems with dwarf/gdb

Argiris Kirtzidis akyrtzi at gmail.com
Tue Apr 14 15:47:50 PDT 2009


Hi Ken,

Ken McMillan wrote:
> I'm having trouble debugging x86 code generated by LLVM.
> GDB does work with the code, but not correctly, for example,
> the "next" command does not skip over a function call.
>
> Here's an example.
>
> Source program gdb1.c:
>
> int x;
>
> void foo(){
>   x++;
> }
>
> void bar(){
>   x--;
> }
>
> int main(){
>   foo();
>   bar();
>   return 0;
> }
>
> commands:
>
> $ llvm-gcc -g -emit-llvm  -c gdb1.c -o gdb1.bc
> $ llc gdb1.bc
>   

Try
llc -disable-fp-elim gdb1.bc

-Argiris



More information about the llvm-dev mailing list