aboutsummaryrefslogtreecommitdiff
path: root/gdb/jit.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-07-06 21:40:17 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-07-06 21:40:17 +0000
commit3b2a0cf216646598c8d76c098f1734c9bb5604c7 (patch)
treee796196f5993690064cf901ef1305cbb15e099c6 /gdb/jit.c
parent8f7c81e876e2ad9bc051681dba536919c8851f9d (diff)
downloadgdb-3b2a0cf216646598c8d76c098f1734c9bb5604c7.zip
gdb-3b2a0cf216646598c8d76c098f1734c9bb5604c7.tar.gz
gdb-3b2a0cf216646598c8d76c098f1734c9bb5604c7.tar.bz2
Fix JIT clang-lli regression (unable to read JIT descriptor from memory)
2011-07-06 Paul Pluzhnikov <ppluzhnikov@google.com> * jit.c (jit_inferior_init): Forward declare. (jit_breakpoint_re_set_internal): Call jit_inferior_init. testsuite/ChangeLog: 2011-07-06 Paul Pluzhnikov <ppluzhnikov@google.com> * gdb.base/jit-so.exp: New test. * gdb.base/jit-dlmain.c: New file. * gdb.base/jit-main.c: Allow "main" to be elsewhere.
Diffstat (limited to 'gdb/jit.c')
-rw-r--r--gdb/jit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/jit.c b/gdb/jit.c
index be123a5..01ac5fa 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -40,6 +40,9 @@ static const char *const jit_descriptor_name = "__jit_debug_descriptor";
static const struct inferior_data *jit_inferior_data = NULL;
+static void
+jit_inferior_init (struct gdbarch *gdbarch);
+
/* Non-zero if we want to see trace of jit level stuff. */
static int jit_debug = 0;
@@ -351,6 +354,11 @@ jit_breakpoint_re_set_internal (struct gdbarch *gdbarch,
inf_data->breakpoint_addr = SYMBOL_VALUE_ADDRESS (reg_symbol);
if (inf_data->breakpoint_addr == 0)
return 2;
+
+ /* If we have not read the jit descriptor yet (e.g. because the JITer
+ itself is in a shared library which just got loaded), do so now. */
+ if (inf_data->descriptor_addr == 0)
+ jit_inferior_init (gdbarch);
}
else
return 0;