Any libunwind experts n da house?

IgorStepanov via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 27 04:34:30 PDT 2014


On Saturday, 27 September 2014 at 09:53:37 UTC, Jacob Carlborg 
wrote:
> On 2014-09-23 19:37, Andrei Alexandrescu wrote:
>> We need a libunwind expert to figure out a good approach for 
>> handling
>> exceptions thrown by C++ code into D.
>
> BTW, are you only interested in handling C++ exception, or are 
> you interested in handling D exceptions in C++ as well?
>

> Ideally D should just use the same exception mechanism as C++. 
> I don't think a language change is necessary for this. Changes 
> in the compiler, yes, but hopefully not in the language.

C++ exception mechanism uses C++ type_info objects. We can 
inherit object.Throwable from std::exception (through extern(C++) 
interface), override the what() method, but there are no way to 
generate C++ type_info for D class now. If we want to do a 
compiler support of C++ exceptions, we should implement and 
support another one non-standartized feature: type_info. BTW it 
allows to do dynamic_cast over C++ classes in D, but I think, 
nobody approve this suggestion, because it can be hard).


More information about the Digitalmars-d mailing list