mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 01:28:46 +00:00
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>
This commit is contained in:
20
gdb/jit.c
20
gdb/jit.c
@@ -1147,7 +1147,10 @@ jit_prepend_unwinder (struct gdbarch *gdbarch)
|
||||
}
|
||||
}
|
||||
|
||||
/* Register any already created translations. */
|
||||
/* Looks for the descriptor and registration symbols and breakpoints
|
||||
the registration function. If it finds both, it registers all the
|
||||
already JITed code. If it has already found the symbols, then it
|
||||
doesn't try again. */
|
||||
|
||||
static void
|
||||
jit_inferior_init (inferior *inf)
|
||||
@@ -1203,10 +1206,7 @@ jit_inferior_init (inferior *inf)
|
||||
}
|
||||
}
|
||||
|
||||
/* Looks for the descriptor and registration symbols and breakpoints
|
||||
the registration function. If it finds both, it registers all the
|
||||
already JITed code. If it has already found the symbols, then it
|
||||
doesn't try again. */
|
||||
/* inferior_created observer. */
|
||||
|
||||
static void
|
||||
jit_inferior_created_hook (inferior *inf)
|
||||
@@ -1214,6 +1214,14 @@ jit_inferior_created_hook (inferior *inf)
|
||||
jit_inferior_init (inf);
|
||||
}
|
||||
|
||||
/* inferior_execd observer. */
|
||||
|
||||
static void
|
||||
jit_inferior_execd_hook (inferior *exec_inf, inferior *follow_inf)
|
||||
{
|
||||
jit_inferior_init (follow_inf);
|
||||
}
|
||||
|
||||
/* Exported routine to call to re-set the jit breakpoints,
|
||||
e.g. when a program is rerun. */
|
||||
|
||||
@@ -1304,7 +1312,7 @@ _initialize_jit ()
|
||||
&maintenanceinfolist);
|
||||
|
||||
gdb::observers::inferior_created.attach (jit_inferior_created_hook, "jit");
|
||||
gdb::observers::inferior_execd.attach (jit_inferior_created_hook, "jit");
|
||||
gdb::observers::inferior_execd.attach (jit_inferior_execd_hook, "jit");
|
||||
gdb::observers::inferior_exit.attach (jit_inferior_exit_hook, "jit");
|
||||
gdb::observers::breakpoint_deleted.attach (jit_breakpoint_deleted, "jit");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user