]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix JIT clang-lli regression (unable to read JIT descriptor from memory)
authorJoel Brobecker <brobecker@gnat.com>
Wed, 6 Jul 2011 22:05:38 +0000 (22:05 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Wed, 6 Jul 2011 22:05:38 +0000 (22:05 +0000)
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.

gdb/ChangeLog
gdb/jit.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/jit-main.c

index 5c31f8c2df614d732b8bc10ad3ac01f1c50c0707..f2b2b5ac004d7584612d1aa717b5d23c9daa053e 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-06  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       * jit.c (jit_inferior_init): Forward declare.
+       (jit_breakpoint_re_set_internal): Call jit_inferior_init.
+
 2011-07-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix false GCC warning.
index e451024c49bcbcdb0b5b2ce0ad6b3a9346fa3f6f..9d6995c0981eca7925a1bc3df7b8f91f6766d9d2 100644 (file)
--- 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;
index 9d34153a30e727e54f1d372ee86fcc249bbb3eb9..7141df783fd34bbfb7c9db605f47780ff1df7d17 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2011-07-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdb.cp/temargs.exp (set sixth breakpoint for temargs): Move the test
index b20c516b6bc695114b096bce93f8df2c3d48bcd0..f5b0ec1b3636738d188059b8a576daf9e886ab77 100644 (file)
@@ -117,8 +117,12 @@ update_locations (const void *const addr, int idx)
     }
 }
 
+#ifndef MAIN
+#define MAIN main
+#endif
+
 int
-main (int argc, char *argv[])
+MAIN (int argc, char *argv[])
 {
   /* These variables are here so they can easily be set from jit.exp.  */
   const char *libname = NULL;