gdb/solib-svr4: don't disable probes interface if probe not found
In ROCm-GDB, we install an solib provider for the GPU code objects on
top of the svr4 provider for the host, in order to add solibs
representing the GPU code objects to the solib list containing the host
process' shared libraries. We override the target_so_ops::handle_event
function pointer with our own, in which we call svr4_so_ops.handle_event
(which contains svr4_handle_solib_event) manually. When the host
(un)loads a library, the ROCm part of handle_event is a no-op. When the
GPU (un)loads a code object, we want the host side (svr4) to be a no-op.
The problem is that when handle_event is called because of a GPU event,
svr4_handle_solib_event gets called while not stopped at an svr4
probe. It then assumes this means there's a problem with the probes
interface and disables it through the following sequence of events:
- solib_event_probe_at return nullptr
- svr4_handle_solib_event returns early
- the make_scope_exit callback calls disable_probes_interface
We could fix that by making the ROCm handle_event callback check if an
svr4 probe is that the stop address, and only call
svr4_so_ops.handle_event if so. However, it doesn't feel right to
include some svr4 implementation detail in the ROCm event handler.
Instead, this patch changes svr4_handle_solib_event to not assume it is
an error if called while not at an svr4 probe location, and therefore
not disable the probes interface. That just means moving the
make_scope_exit call below where we lookup the probe by pc.
Change-Id: Ie8ddf5beffa2e92b8ebfdd016454546252519244
Co-Authored-By: Lancelot SIX <lancelot.six@amd.com>