Introducing vibe.d!
Johannes Pfau
nospam at example.com
Mon Apr 30 23:57:58 PDT 2012
Am Mon, 30 Apr 2012 15:52:36 -0700
schrieb Sean Kelly <sean at invisibleduck.org>:
> On Apr 30, 2012, at 8:26 AM, Sönke Ludwig wrote:
>
> > Am 30.04.2012 15:48, schrieb Sean Kelly:
> >> On Apr 30, 2012, at 1:03 AM, Sönke Ludwig wrote:
> >>
> >>> Am 27.04.2012 16:50, schrieb Sean Kelly:
> >>>> In _d_throw call abort(). That'll give you a core file.
> >>>>
> >>>
> >>> Thanks, I've tracked it down to an assertion by logging stderr
> >>> for now, but next time I will try the abort method (with
> >>> __d_assert*), because just a call stack without line numbers was
> >>> a bit sparse on information.
> >>
> >> What platform are you on? You should be getting stack traces.
> >
> > I get a stack trace with function names but no line numbers (just
> > byte offsets). It's Linux/64bit, compiled with -g.
>
> Druntime uses backtrace() on Linux, and I've seen it give offsets at
> times instead of line numbers. Can't say exactly why. You may
> already know this, but you can figure out the offending line by
> calling "objdump -d -S" on the executable, then doing some hex math
> from the address of the reported function.
backtrace internally uses dladdr to get the function name for the
address. This has certain limits, for example dladdr _doesn't use
debug info at all_, so it only finds functions which are dynamically
exported (this means only those which could be loaded by dlsym).
This is also the reason why --export-dynamic is needed (when building a
static executable/library).
More information about the Digitalmars-d-announce
mailing list