Re: [PATCH] Notify observer of breakpoint auto-disabling

Simon Marchi via Gdb-patches
2021-08-13T15:45:58Z

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?

Simon