C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Standard Library assistance in logging of all exceptions

From: Antony Polukhin <antoshkka_at_[hidden]>
Date: Mon, 4 Mar 2024 11:43:32 +0300
On Wed, Feb 28, 2024, 19:09 Frederick Virchanza Gotham via Std-Proposals <
std-proposals_at_[hidden]> wrote:
<...>

> I got this working, and so now when the C# program catches the
> exception from C++, it's able to ask the DLL to see the exception log
> to see what was thrown (along with a stack trace). When it comes to
> the GNU g++ compiler, a quick web search shows me that people have
> been able to do the same thing by providing an implementation of
> '__cxa_throw'.
>

Could you please share the source code? I've recently implemented something
like your trick in Boost.Stacktrace for POSIX, and now I'm in search for a
working Windows solution

I wonder would it be useful if the Standard Library were to allow us
> to portably do something like this? For example let's say we had:
>
> namespace std {
> using throw_handler = void (*)(void const *, type_info const
> &) noexcept;
> throw_handler set_throw( throw_handler f ) noexcept;
> }
>

I'd like to see such a feature in the Standard. However, it should be
prototyped first, a lot of developers should gain experience with it, it
should be optimized and evolved.

I'm quite sure that the first versions of the feature should go to some big
library like Boost and evolve there.

>

Received on 2024-03-04 08:43:45