d2: not getting any backtrace info

backtrace, d, linux

Solution

Make sure that your dmd.conf has `-L--export-dynamic` in its `DFLAGS`. I believe that the version provided with dmd has it, but without that, you won't get the function names, so there's a good chance that it's missing from your dmd.conf.

Problem

I'm playing with the gtkd wrapper generator, and running into an std.conv exception for which I cannot manage to get any symbolic debug info at all. I've compiled with debug symbols: ``` $ dmd -gc -debug utils/HTODConvert.d utils/WrapperIF.d utils/funct.d utils/DefReader.d utils/GtkWrapper.d utils/HtmlStrip.d utils/IndentedStringBuilder.d utils/convparms.d utils/GtkDClass.d -ofgtkwrap ``` but the backtrace is just a list of memory addresses: ``` std.conv.ConvException@/usr/include/d/std/conv.d(1779): Unexpected ' ' when converting from type string to type int ---------------- /home/martin/code/d/GtkD/wrap/gtkwrap() [0x805c4ab] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x805c57a] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x806d49e] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x806924e] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x8068c4a] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x8066aed] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x8066824] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x806388f] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x806367c] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x805e988] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x805e910] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x805e793] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x805d6f5] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x8060176] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x8071140] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x8070c50] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x8071182] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x8070c50] /home/martin/code/d/GtkD/wrap/gtkwrap() [0x8070c04] /lib/libc.so.6(__libc_start_main+0xf5) [0xb7dce3d5] ``` This is under 32-bit linux ``` $ uname -a Linux mercury 3.3.2-1-ARCH #1 SMP PREEMPT Sat Apr 14 10:08:43 UTC 2012 i686 Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz GenuineIntel GNU/Linux $ dmd -v DMD32 D Compiler v2.059 ```

Original source