This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Regression for gdb.base/jit.exp and gdb.base/jit-so.exp [Re: JIT Interface Patches Landed]


Sorry for the delayed response.  I've attached the fix.  With this
patch GDB passes both jit.exp and jit-so.exp.

Sanjoy Das
diff --git a/gdb/jit.c b/gdb/jit.c
index 7bd6b36..6bfe1b6 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -713,7 +713,8 @@ jit_object_close_impl (struct gdb_symbol_callbacks *cb,
 /* Try to read CODE_ENTRY using the loaded jit reader (if any).  */
 static int
-jit_reader_try_read_symtab (struct jit_code_entry *code_entry)
+jit_reader_try_read_symtab (struct jit_code_entry *code_entry,
+                            CORE_ADDR entry_addr)
   void *gdb_mem;
   int status;
@@ -735,7 +736,7 @@ jit_reader_try_read_symtab (struct jit_code_entry *code_entry)
-  priv_data = code_entry->symfile_addr;
+  priv_data = entry_addr;
   if (!loaded_jit_reader)
     return 0;
@@ -769,6 +770,7 @@ jit_reader_try_read_symtab (struct jit_code_entry *code_entry)
 static void
 jit_bfd_try_read_symtab (struct jit_code_entry *code_entry,
+                         CORE_ADDR entry_addr,
                          struct gdbarch *gdbarch)
   bfd *nbfd;
@@ -832,7 +834,7 @@ JITed symbol file is not an object file, ignoring it.\n"));
   objfile = symbol_file_add_from_bfd (nbfd, 0, sai, OBJF_SHARED, NULL);
   do_cleanups (old_cleanups);
-  add_objfile_entry (objfile, code_entry->symfile_addr);
+  add_objfile_entry (objfile, entry_addr);
 /* This function registers code associated with a JIT code entry.  It uses the
@@ -855,10 +857,10 @@ jit_register_code (struct gdbarch *gdbarch,
                         paddress (gdbarch, code_entry->symfile_addr),
                         pulongest (code_entry->symfile_size));
-  success = jit_reader_try_read_symtab (code_entry);
+  success = jit_reader_try_read_symtab (code_entry, entry_addr);
   if (!success)
-    jit_bfd_try_read_symtab (code_entry, gdbarch);
+    jit_bfd_try_read_symtab (code_entry, entry_addr, gdbarch);
 /* This function unregisters JITed code and frees the corresponding

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]