how to debug exceptions/asserts thrown in module constructors?

Timothee Cour via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Nov 27 14:19:26 PST 2016


in the process of trying to debug
https://github.com/BlackEdder/ggplotd/issues/32 I would like to get a
stracktrace and/or put a breakpoint before exception is thrown:


```
lldb $binary
r
(lldb)
Process 34168 resuming
object.Exception at ../../../../.dub/packages/gtk-d-3.3.1/gtk-d/src/gtkc/Loader.d(123):
Library load failed: libatk-1.0.dylib
Process 34168 exited with status = 1 (0x00000001)
```

Adding
```
b _d_throwc #does nothing
```

didn't help, also, it hasn't entered d main yet so `Runtime.traceHandler =
&defaultTraceHandler;` isn't helpful.

The fix here was to lookup the code, find the corresponding mangled name
location and add a breakpoint via `b
_D4gtkc6Loader6Linker11loadLibraryFAyaZv` but is there a general fix?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20161127/eb10b72f/attachment.html>


More information about the Digitalmars-d-learn mailing list