Notify observer of breakpoint auto-disabling

As breakpoint_modified observer is currently notified upon breakpoint stop
before handling auto-disabling when enable count is reached, the observer
is never notified of the disabling.

The problem affects:
- The MI interpreter enabled= value when reporting =breakpoint-modified
- A Python event handler for breakpoint_modified using the "enabled"
  member of its parameter
- insight: breakpoint GUI window is not properly updated upon auto-disable

This patch moves the observer notification after the auto-disabling
code and implements corresponding tests for the MI and Python cases.

Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=23336

Change-Id: I0c50df4789334071e5390cb46b3ca0d4a7f83c61
This commit is contained in:
Patrick Monnerat 2021-08-16 14:44:20 +02:00 committed by Simon Marchi
parent eb09df162b
commit bd7ccaa983
3 changed files with 65 additions and 1 deletions

View file

@ -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;