A couple of thoughts/queries.
Christopher Wright
dhasenan at gmail.com
Wed Dec 26 05:55:04 PST 2007
Bill Baxter wrote:
> ddbg does a pretty decent job on Windows. Still, it gives me no stack
> trace upon "access violation" a significant fraction of the time. When
> it works it's great, though. You should definitely be using it if
> you're on Windows. I have also found that Windbg can sometimes get a
> stack trace when ddbg can't.
>
> If you're not on Windows then I presume gdb works? I guess that doesn't
> have any D-specific knowledge. Support for D in zerobugs is still
> vaporware?
>
> Still, I'm with you. Getting a stack trace should be easier. Especially
> considering there have been patches to phobos floating around for a year
> at least that already implement it.
>
> --bb
So, given traced exceptions, you trap the sigsegv with a function that
throws an exception? And you'd put the stuff to catch the signal in a
module constructor so you just have to import the segfault exception module.
I just did it in the past half hour; it's not much trouble. There's just
a portability concern. But since DMD only works on Windows and Linux,
that's less of a concern.
As a side note, Phobos doesn't seem to have anything related to signals,
and Tango's translation of the header is quite brief, not including
anything to trap signals.
And now I see a post about two years old with the same stuff, only better.
More information about the Digitalmars-d
mailing list