diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-04-03 14:52:02 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-04-17 13:47:13 -0400 |
commit | 4a1283c8d56a43a5146744cec6960556d9b40605 (patch) | |
tree | 53d93294ddcff0748b4abed362d1987d21fa5be4 /gdb/linux-tdep.c | |
parent | e49831ba4340688d7685a52099db09d12177945b (diff) | |
download | binutils-4a1283c8d56a43a5146744cec6960556d9b40605.zip binutils-4a1283c8d56a43a5146744cec6960556d9b40605.tar.gz binutils-4a1283c8d56a43a5146744cec6960556d9b40605.tar.bz2 |
gdb: pass execing and following inferior to inferior_execd observers
The upcoming patch to support exec in the amd-dbgapi target needs to
detach amd-dbgapi from the inferior doing the exec and attach amd-dbgapi
to the inferior continuing the execution. They may or may not be the
same, depending on the `set follow-exec-mode` setting. But even if they
are the same, we need to do the detach / attach dance.
With the current observable signature, the observers only receive the
inferior in which execution continues (the "following" inferior).
Change the signature to pass both inferiors, and update all existing
observers.
Change-Id: I259d1ea09f70f43be739378d6023796f2fce2659
Reviewed-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/linux-tdep.c')
-rw-r--r-- | gdb/linux-tdep.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 1fc9cb6..b5eee5e 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -244,6 +244,14 @@ invalidate_linux_cache_inf (struct inferior *inf) linux_inferior_data.clear (inf); } +/* inferior_execd observer. */ + +static void +linux_inferior_execd (inferior *exec_inf, inferior *follow_inf) +{ + invalidate_linux_cache_inf (follow_inf); +} + /* Fetch the linux cache info for INF. This function always returns a valid INFO pointer. */ @@ -2789,7 +2797,7 @@ _initialize_linux_tdep () "linux-tdep"); gdb::observers::inferior_appeared.attach (invalidate_linux_cache_inf, "linux-tdep"); - gdb::observers::inferior_execd.attach (invalidate_linux_cache_inf, + gdb::observers::inferior_execd.attach (linux_inferior_execd, "linux-tdep"); add_setshow_boolean_cmd ("use-coredump-filter", class_files, |