[LLVMdev] CFE debug info progress

Chris Lattner sabre at nondot.org
Mon Oct 25 12:42:50 PDT 2004


On Sun, 24 Oct 2004, Michael McCracken wrote:
> Hi, I've got the cfe debug info to the point where it outputs correct
> function info, stoppoints for statements (but not for declarations
> anymore) and region ends at the beginning of the return block. So this
> is about as far as I wanted to go with it.

That is great!

> However, there's one last big problem that I need some advice on. Running :
> gcc -g -S -o foo.ll
> llvmas foo.ll
>
> produces bytecode that works under lli -force-interpreter on OS X (JIT
> not working on my system)
> and llvm-db can list sources and functions.

Ok.

> *but*
>
> gcc -g -o foo
> llvm-db foo.bc
> doesn't see any debug info.

I bet this is due to the internalize pass marking globals as internal,
then the optimizer stripping stuff out.  Oops.  :)  Try passing
-Wl,-disable-internalize to llvm-gcc, and seeing if that helps.

This is not your problem, so once we get debug info into the llvm-gcc
tree, I will fix this (it's probably quite easy to fix).

> Worse, it doesn't work:
> that's a JIT error, OK, so:
> % lli -force-interpreter loops.bc
> Tried to execute an unknown external function:  __main

This is probably due to your LLVM_LIB_SEARCH_PATH env variable not being
set. Please see the getting started guide for info on how to set this.

> Loops begin:
> /Users/mike/Documents/hpcl/LLVM/llvm/include/llvm/Support/Casting.h:197:
> failed assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible
> type!"'
> Abort
>
> That's not good.

No, that's not.

> Any advice on debugging this?

I would run lli under gdb and look at what the stack trace is.  If you
can't figure it out in a reasonable amount of time, create a bugzilla bug,
attach the bytecode file, and we'll take a look.

Also, when they are ready, please send me the llvm-gcc diff so that I can
get them applied to the tree.

Thanks a lot!

-Chris

-- 
http://llvm.org/
http://nondot.org/sabre/




More information about the llvm-dev mailing list