gdb: add missing notify_breakpoint_modified call
authorAndrew Burgess <aburgess@redhat.com>
Tue, 22 Aug 2023 15:07:02 +0000 (16:07 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 23 Aug 2023 08:04:45 +0000 (09:04 +0100)
commitf29ab2e0e350a4b382a1e4eb1b41c28564d83e94
tree9ff441e52222dbe6f8c63fa8f27f640875b65fb8
parent835f16daa77952015d1a97ae6eab48cc2ea14fb8
gdb: add missing notify_breakpoint_modified call

The commit:

  commit b080fe54fb3414b488b8ef323c6c50def061f918
  Date:   Tue Nov 8 12:32:51 2022 +0000

      gdb: add inferior-specific breakpoints

introduced a bug in the function breakpoint_set_inferior. The above
commit includes this line:

  gdb::observers::breakpoint_modified.notify (b);

when it should have instead used this line:

  notify_breakpoint_modified (b);

The change to use notify_breakpoint_modified was introduced to GDB
after commit b080fe54fb34 was written, but before it was merged, and I
failed to update this part of the code during the rebase.

The consequence of this error is that the MI interpreter will not emit
breakpoint-modified notifications when breakpoint_set_inferior is
called.

In this commit I update the code to call notify_breakpoint_modified,
and add a test that checks the MI events are being emitted correctly
in this case.
gdb/breakpoint.c
gdb/testsuite/gdb.mi/mi-py-modify-bp.c [new file with mode: 0644]
gdb/testsuite/gdb.mi/mi-py-modify-bp.exp [new file with mode: 0644]
gdb/testsuite/gdb.mi/mi-py-modify-bp.py [new file with mode: 0644]