D-Programming-GDC/GDC — pull request #3 by jpf91 (2012-03-21 11:53:00+00:00)
Title: Implement generic backtraces for GDC

Fixes the unwind_arm and unwind_generic files (mostly deprecated typedef), then implements backtraces using libgcc helper functions. Systems where 'backtrace' is supported remain unchanged.

This allows us to get at least the addresses for a stacktrace for every architecture where libgcc supports it. Address --> name resolution is implemented using dladdr, where available. According to some websites backtrace is also impemented using dladdr, so these implementations share the same problems and features (For example, you have to compile with --export-dynamic to make it work).

Stack traces generated for segfaults are not very useful yet, they only contain the stack trace after the signal handler has been called. Druntime catches segfaults in unittests, so in that case the output isn't very useful yet. Systems which support backtrace use the old implementation and are not affected.

Related information:
http://www.acsu.buffalo.edu/~charngda/backtrace.html