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. 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. *but* gcc -g -o foo llvm-db foo.bc doesn't see any debug info. 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 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. Any advice on debugging this? Thanks, -mike -- Michael McCracken UCSD CSE PhD Student San Diego Supercomputer Center http://www.cse.ucsd.edu/~mmccrack/
On Sun, 2004-10-24 at 13:32, 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. > > 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.Okay.> > *but* > > gcc -g -o fooWhat's the source file to be compiled? This should produce a "no input files" error. Assuming you were attempting "gcc -g -o foo foo.c" ..> > llvm-db foo.bcDid gcc link foo.bc with glibc and/or stdc++ library? It invokes gccld to do that.> > doesn't see any debug info. > > Worse, it doesn't work: > > that's a JIT error, OK, so: > > % lli -force-interpreter loops.bc > Tried to execute an unknown external function: __mainThis indicates you didn't link loops.bc with the stdc++ library which it requires.> 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!"' > AbortNot sure what that's about, but its probably related to missing __main.> > That's not good. > Any advice on debugging this? > > Thanks, > -mikeHope this helps. Reid. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041024/9d051480/attachment.sig>
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: __mainThis 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/