C++ Logo

sg15

Advanced search

Re: [SG15] breakpoint and is_debugger_present proposals.

From: Daniela Engert <dani_at_[hidden]>
Date: Tue, 4 Jan 2022 16:40:54 +0100
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_at_[hidden]> *On Behalf Of *René
> Ferdinand Rivera Morell via SG15
> *Sent:* Monday, January 3, 2022 8:03 AM
> *To:* sg15_at_[hidden]
> *Cc:* René Ferdinand Rivera Morell <grafikrobot_at_[hidden]>
> *Subject:* [EXTERNAL] Re: [SG15] breakpoint and is_debugger_present
> proposals.
>
> On Mon, Jan 3, 2022 at 12:22 AM Daniela Engert via SG15
> <sg15_at_[hidden]> 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
> <https://urldefense.com/v3/__https:/wg21.link/P2514R0__;!!FbZ0ZwI3Qg!6_j0JRAKq4oEYMtTXV__u7fJx0Hrlkum5lKzDd1Z3Ru3cqYQENYJgBmF-F7x$>
> -- std::breakpoint
>
> * https://wg21.link/P2514R0
> <https://urldefense.com/v3/__https:/wg21.link/P2514R0__;!!FbZ0ZwI3Qg!6_j0JRAKq4oEYMtTXV__u7fJx0Hrlkum5lKzDd1Z3Ru3cqYQENYJgBmF-F7x$>
> -- std::is_debugger_present
>
> René, was this meant to be the same link?
>
> LOL, indeed.. It should be:
>
> * https://wg21.link/P2514R0
> <https://urldefense.com/v3/__https:/wg21.link/P2514R0__;!!FbZ0ZwI3Qg!6_j0JRAKq4oEYMtTXV__u7fJx0Hrlkum5lKzDd1Z3Ru3cqYQENYJgBmF-F7x$>
> -- std::breakpoint
>
> * https://wg21.link/P2515R0
> <https://urldefense.com/v3/__https:/wg21.link/P2515R0__;!!FbZ0ZwI3Qg!6_j0JRAKq4oEYMtTXV__u7fJx0Hrlkum5lKzDd1Z3Ru3cqYQENYJgCbDELGP$>
> -- std::is_debugger_present
>
> Thanks for noticing :-)
>
> --
>
> -- René Ferdinand Rivera Morell
> -- Don't Assume Anything -- No Supone Nada
> -- Robot Dreams - http://robot-dreams.net
> <https://urldefense.com/v3/__http:/robot-dreams.net/__;!!FbZ0ZwI3Qg!6_j0JRAKq4oEYMtTXV__u7fJx0Hrlkum5lKzDd1Z3Ru3cqYQENYJgMXy2NDm$>
>
>
> INTERNAL - NI CONFIDENTIAL
>
>
> _______________________________________________
> SG15 mailing list
> SG15_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg15


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

Received on 2022-01-04 09:41:00