[cfe-dev] debugging clang driver backtrace

Brian Brooks brooks.brian at gmail.com
Fri Oct 26 11:47:45 PDT 2012


Hello cfe-dev!

I am taking a stab at clang bug id 14085.

I put the offending source in tmp.cc and started off with "gdb clang++" and
then "(gdb) run tmp.cc".  This produces an "UNREACHABLE executed at ...."
with a really helpful backtrace.

When I break at main() and step through the driver code, a posix_spawn() is
eventually executed, and I am not sure how to step through that.  So, I
figured it may be better to debug clang with the extensive command line
arguments that are generated (this is dumped into a .sh file and
recommended you attach it when submitting bug report).

So I "gdb clang" and "(gdb) run -cc1 -triple x86_64-unknown-linux-gnu
......... tons of options ....... tmp.cc" and break at cc1_main().  When I
continue, it hits the same "UNREACHABLE executed at ....", but the
backtrace is not printed.

Can someone explain why this is?  Is the backtrace dumped somewhere that
the driver pid can read and that is why I see it in the first debugging
scenario?

Any other recommendations for someone getting started with debugging clang?
 Or, how to debug through the posix_spawn() in the driver?

Thanks!
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121026/a12a8968/attachment.html>


More information about the cfe-dev mailing list