aboutsummaryrefslogtreecommitdiff
path: root/gdb/jit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/jit.c')
-rw-r--r--gdb/jit.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gdb/jit.c b/gdb/jit.c
index e276b34..e085d56 100644
--- a/gdb/jit.c
+++ b/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");