From: Patrick Monnerat <patrick@monnerat.net>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Notify observer of breakpoint auto-disabling
Date: Sat, 14 Aug 2021 00:15:31 +0200 [thread overview]
Message-ID: <71d5f086-2931-b29e-2ffd-a717d416206f@monnerat.net> (raw)
In-Reply-To: <3e03ee4f-b922-a1b1-904a-686624733959@polymtl.ca>
On 8/13/21 8:59 PM, Simon Marchi wrote:
> On 2021-08-13 12:27 p.m., Patrick Monnerat wrote:
>> On 8/13/21 5:45 PM, Simon Marchi wrote:
>>> On 2021-08-13 11:31 a.m., Patrick Monnerat via Gdb-patches wrote:
>>>> As observer in currently notified of breakpoint stop before handling its
>>>> auto-disabling after count is reached, the observer is never notified of
>>>> the disabling.
>>>>
>>>> This patch moves the observer notification after the auto-disabling
>>>> code.
>>>>
>>>> Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=23336
>>>>
>>>> * gdb/breakpoint.c (bpstat_stop_status): move observer notification
>>>> after auto-disabling code.
>>>> ---
>>>> gdb/breakpoint.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
>>>> index 89af44ee4c6..feca224ccf4 100644
>>>> --- a/gdb/breakpoint.c
>>>> +++ b/gdb/breakpoint.c
>>>> @@ -5491,7 +5491,6 @@ bpstat_stop_status (const address_space *aspace,
>>>> if (bs->stop)
>>>> {
>>>> ++(b->hit_count);
>>>> - gdb::observers::breakpoint_modified.notify (b);
>>>> /* We will stop here. */
>>>> if (b->disposition == disp_disable)
>>>> @@ -5501,6 +5500,7 @@ bpstat_stop_status (const address_space *aspace,
>>>> b->enable_state = bp_disabled;
>>>> removed_any = 1;
>>>> }
>>>> + gdb::observers::breakpoint_modified.notify (b);
>>>> if (b->silent)
>>>> bs->print = 0;
>>>> bs->commands = b->commands;
>>>>
>>> Is there some user-visible behavior change, that we could write a test for?
>> With gdb alone, I don't think so.
>>
>> This impacts insight: the breakpoint GUI window does not refllect the disabling.
>>
>> No possible workaround here, since the observer is never notified again after breakpoint has been disabled (unless some user action on the later).
>>
>> As this is a GUI behavior, I don't think we can write a gdb test in this context.
> Ok, thanks. I think this information should be included in the commit
> message, as it justifies the need for the change.
I will re-post patch with commit message updated.
Patrick
next prev parent reply other threads:[~2021-08-13 22:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 15:31 Patrick Monnerat
2021-08-13 15:45 ` Simon Marchi
2021-08-13 16:27 ` Patrick Monnerat
2021-08-13 18:59 ` Simon Marchi
2021-08-13 22:15 ` Patrick Monnerat [this message]
2021-08-13 22:24 Patrick Monnerat
2021-08-14 4:05 ` Simon Marchi
2021-08-15 0:30 ` Patrick Monnerat
2021-08-15 0:33 Patrick Monnerat
2021-08-16 1:32 ` Simon Marchi
2021-08-16 12:44 Patrick Monnerat
2021-08-16 14:04 ` Simon Marchi
2021-08-16 14:09 ` Patrick Monnerat
2021-08-16 15:10 ` Simon Marchi
2021-08-16 16:18 ` Patrick Monnerat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=71d5f086-2931-b29e-2ffd-a717d416206f@monnerat.net \
--to=patrick@monnerat.net \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).