Reputation: 221
I have build llvm debug version with configue --enable-debug-runtime. I want to learn the exetution process of llvm by the gdb stack trace ? But occured error when I using gdb:
llvm-3.4.2/build/Release+Asserts/bin$ gdb ./clang
(gdb) b clang::CreateLLVMCodeGen (...)
(gdb) r ./clang ~/tmp/helloworld.c -o helloworld
Can any one help me? Thanks.
Upvotes: 0
Views: 2174
Reputation: 2069
set follow-fork-mode child
would work, too. That way, you don't bother to figure out what follows -cc1
.
Upvotes: 2
Reputation: 1727
An issue you're going to have in trying to debug clang is that the first invocation of clang spawns another clang process. What you should do is use clang -v to get the -cc1 command line and use that as your run arguments in gdb.
As far as the Release+Asserts bit, you'll want to do this configure line:
configure --enable-debug-symbols --disable-optimized
since you appear to be using release sources of llvm. The defaults change versus the bits in svn.
Asserts are useful anyhow, so I'd keep them in.
Upvotes: 2