Catching C++ std::exception in D

Iain Buclaw via Digitalmars-d digitalmars-d at
Thu Nov 12 02:37:39 PST 2015

On 12 November 2015 at 11:17, deadalnix via Digitalmars-d <
digitalmars-d at> wrote:

> On Thursday, 12 November 2015 at 10:09:10 UTC, Iain Buclaw wrote:
>> On 12 November 2015 at 07:50, Walter Bright via Digitalmars-d <
>> digitalmars-d at> wrote:
>>> I really appreciate the offers, and here's what will really help:
>>> Writing the druntime end of things, which is really providing just two
>>> functions: d_throw (d_dwarf_throw to distinguish it) and the libunwind
>>> personality function: __dmd_personality_v0. The tricky part with the
>>> personality function will likely be recognizing std::exception* exceptions.
>>> I wonder if forwarding the call to __gxx_personality_v0 will work.
>>> I'll have to check, but I'm pretty certain that libunwind will call the
>> C++ personality for you if you return `nothing found` from D personality
>> function.
> The personality function is in the landingpad metadata. Why would
> libunwind call the C++ one out of nowhere ?

I did say that I'd have to check.  :-)

In any case, I'm doubtful that forwarding to C++'s personality would work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Digitalmars-d mailing list