gdb: pass more arguments to the executable_changed observer
authorAndrew Burgess <aburgess@redhat.com>
Fri, 8 Sep 2023 15:02:13 +0000 (16:02 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Thu, 28 Sep 2023 14:33:13 +0000 (15:33 +0100)
commit063453b199e1291a03ee81c3422c31d7cca60af6
tree8748bab017896c702225859e76a68e81d1f16ba4
parentaac60a978e2620037e4b034386cbc6ef65f8e4aa
gdb: pass more arguments to the executable_changed observer

This commit continues the work of the previous few commits.

My goal is to expose the executable_changed observer through the
Python API as an event.

At this point adding executable_changed as an event to the Python API
is trivial, but before I do that I would like to add some additional
arguments to the observable, which currently has no arguments at all.

The new arguments I wish to add are:

 1. The program_space in which the executable was changed, and

 2. A boolean flag that will indicate if the executable changed to a
 whole new path, or if GDB just spotted that the executable changed on
 disk (e.g. the user recompiled the executable).

In this commit I change the signature of the observable and then pass
the arguments through at the one place where this observable is
notified.

As there are (currently) no users of this observable nothing else
needs updating.  In the next commit I'll add a listener for this
observable in the Python code, and expose this as an event in the
Python API.

Additionally, with this change, it should be possible to update the
insight debugger to make use of this observable rather than using the
deprecated_exec_file_display_hook (as it currently does), which will
then allow this hook to be removed from GDB.

There should be no user visible changes after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/exec.c
gdb/observable.h