www.digitalmars.com         C & C++   DMDScript  

D.gnu - Debugging gdc

reply Mike Farnsworth <mike.farnsworth gmail.com> writes:
In my adventures with adding gcc __builtin_* functions, I was able to get them
to work if I defined any VECTOR_TYPE gcc trees as a D struct (long story, for
another post).  When adding the builtin structs, if I registered the struct
definitions in the gcc.builtins module, and then built phobos2, it would ICE
with a segfault.  But, if I didn't add those definitions, the regular D code I
was compiling wouldn't know the types.  (I built phobos2 without registering
them, then rebuilt gdc with them registered without building phobos2 again in
order to make it work).  I am utterly unable to attach gdb to gdc to catch the
crash, though.

How do I debug gdc to find where the crash happens?  Am I relegated to the
printf debugger? =)

-Mike
Feb 09 2011
parent Iain Buclaw <ibuclaw ubuntu.com> writes:
== Quote from Mike Farnsworth (mike.farnsworth gmail.com)'s article
 How do I debug gdc to find where the crash happens?  Am I relegated to the
printf debugger? =)
 -Mike
gdc -c foo.d -wrapper gdb,--args Will invoke the compiler under "gdb --args".
Feb 09 2011