Ben, my imagination is probably too weak, but what is the usecase of an unconditional breakpoint that you have in mind?

Looking at my usecases in the recent past, I can see two additional variations:

1) something like 'break_if(expression)'
Like the proposed std::breakpoint but with an 'expression' that's convertible to 'bool' as an additional condition that's evaluated only when 'is_debugger_present()' evaluates to 'true'.

2) something like 'wait_and_break()'
Wait until a debugger attaches and then break into it. An overload might take a chrono::duration to limit the wait portion.

I've been using both in situations when the standard, built-in debugger features just didn't cut the mustard.

Ciao
  Dani


Am 04.01.2022 um 16:04 schrieb Ben Craig via SG15:

IMO, we need a function that is an unconditional breakpoint, similar to what the various compile builtins already provide.  This could be in addition to the conditional breakpoint.  The conditional breakpoint can be built from the unconditional breakpoint + is_debugger_present, so we should provide the lower level building block.

 

My personal preference is that the unconditional breakpoint gets the “good” name of std::breakpoint, but I can live with the conditional breakpoint getting the good name.

 

From: SG15 <sg15-bounces@lists.isocpp.org> On Behalf Of René Ferdinand Rivera Morell via SG15
Sent: Monday, January 3, 2022 8:03 AM
To: sg15@lists.isocpp.org
Cc: René Ferdinand Rivera Morell <grafikrobot@gmail.com>
Subject: [EXTERNAL] Re: [SG15] breakpoint and is_debugger_present proposals.

 

On Mon, Jan 3, 2022 at 12:22 AM Daniela Engert via SG15 <sg15@lists.isocpp.org> wrote:

Am 03.01.2022 um 04:30 schrieb René Ferdinand Rivera Morell via SG15:

I just posted for review two tooling related proposals:

 

* https://wg21.link/P2514R0 -- std::breakpoint

* https://wg21.link/P2514R0 -- std::is_debugger_present

 

René, was this meant to be the same link?

 

LOL, indeed.. It should be:

 

* https://wg21.link/P2514R0 -- std::breakpoint

* https://wg21.link/P2515R0 -- std::is_debugger_present

 

Thanks for noticing :-)

 

--

-- René Ferdinand Rivera Morell
-- Don't Assume Anything  -- No Supone Nada
-- Robot Dreams - http://robot-dreams.net


INTERNAL - NI CONFIDENTIAL


_______________________________________________
SG15 mailing list
SG15@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/sg15


--
PGP/GPG: 2CCB 3ECB 0954 5CD3 B0DB 6AA0 BA03 56A1 2C4638C5