C++ Logo

sg15

Advanced search

Re: [SG15] breakpoint and is_debugger_present proposals.

From: Timur Doumler <cpp_at_[hidden]>
Date: Wed, 5 Jan 2022 11:46:31 +0000
> On 5 Jan 2022, at 11:03, Daniel Ruoso via SG15 <sg15_at_[hidden]> wrote:
> I think this is a crucial point.
>
> It's not clear to me what a breakpoint outside of a debugger would do.

I would expect that it does nothing, or perhaps that the behaviour is implementation-defined. In practice, I’d probably define an assertion macro where I do some logging, then check if (std::is_debugger_attached) and then do std::breakpoint if true.

If this is not the intended use, I’d be curious to hear what one should do instead.

Cheers,
Timur

Received on 2022-01-05 05:46:40