diff options
author | Andrew Burgess <aburgess@redhat.com> | 2023-09-08 15:44:40 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2023-09-28 15:33:13 +0100 |
commit | a0a031bce0527b1521788b5dad640e7883b3a252 (patch) | |
tree | fcbfabc6dc49441fe5da3b07521e503eef89cc5d /gdb/bt-utils.c | |
parent | 4e02aca0c5ed0c23f8d8a3e30dc317967193a5f0 (diff) | |
download | gdb-a0a031bce0527b1521788b5dad640e7883b3a252.zip gdb-a0a031bce0527b1521788b5dad640e7883b3a252.tar.gz gdb-a0a031bce0527b1521788b5dad640e7883b3a252.tar.bz2 |
gdb: remove one user of the executable changed observer
My goal for the next few commits is to expose the executable_changed
observable from the Python API.
However, there is call to the executable_changed observable in the
reread_symbols function (in symfile.c), and this doesn't actually
correspond to the executable changing. My idea then, is to remove
this use of the executable_changed observable, but, before I can do
that, I need to check that nothing is going to break, and that
requires my to think about the current users of this observable.
One current user of executable_changed is in symtab.c. We add an
executable_changed observer that calls:
set_main_name (nullptr, language_unknown);
to discard all information about the main function when the executable
changes.
However, changing the executable doesn't actually change the debug
information. The debug information changes when the symbol-file
changes, so I think this observer is in slightly the wrong place.
The new_objfile observable is (unfortunately) overloaded, it is called
when a new objfile is loaded, and also (when its argument is nullptr),
when all debug information should be discarded.
It turns out that there is already a new_objfile observer in
symtab.c. I propose that, when the argument is nullptr (indicating
all debug info should be discarded), that we should call set_main_name
to discard the information about the main function. We can then
remove the executable_changed observer from symtab.c.
All tests still pass, and, in my local world, I added some debug
printf calls, and I think we are still discarded the main information
everywhere we need to.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/bt-utils.c')
0 files changed, 0 insertions, 0 deletions