Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb: change "maint info jit" to print jit_code_entry::symfile_addr value
@ 2022-02-07 11:39 Jan Vrany via Gdb-patches
  2022-02-08 15:49 ` Andrew Burgess via Gdb-patches
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Vrany via Gdb-patches @ 2022-02-07 11:39 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jan Vrany

This commit changes the output of 'maint info jit' command to print
jit_code_entry::symfile_addr value rather than address of jit_code_entry
itself. This makes it consistent with address included in objfile names
(commit 4a620b7e).

To access this address, we keep this value in jiter_objfile_data attached
to each objfile created by JIT reader API.
---
 gdb/jit.c | 10 +++++-----
 gdb/jit.h |  9 +++++++--
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/gdb/jit.c b/gdb/jit.c
index 7819d763ab3..420cc80b86a 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -94,7 +94,7 @@ maint_info_jit_cmd (const char *args, int from_tty)
 	  printed_header = true;
 	}
 
-      printf_filtered ("  %s\n", paddress (obj->arch (), obj->jited_data->addr));
+      printf_filtered ("  %s\n", paddress (obj->arch (), obj->jited_data->symfile_addr));
     }
 }
 
@@ -211,11 +211,11 @@ get_jiter_objfile_data (objfile *objf)
    at inferior address ENTRY.  */
 
 static void
-add_objfile_entry (struct objfile *objfile, CORE_ADDR entry)
+add_objfile_entry (struct objfile *objfile, CORE_ADDR entry, CORE_ADDR symfile_addr)
 {
   gdb_assert (objfile->jited_data == nullptr);
 
-  objfile->jited_data.reset (new jited_objfile_data (entry));
+  objfile->jited_data.reset (new jited_objfile_data (entry, symfile_addr));
 }
 
 /* Helper function for reading the global JIT descriptor from remote
@@ -644,7 +644,7 @@ jit_object_close_impl (struct gdb_symbol_callbacks *cb,
   for (gdb_symtab &symtab : obj->symtabs)
     finalize_symtab (&symtab, objfile);
 
-  add_objfile_entry (objfile, priv_data->entry_addr);
+  add_objfile_entry (objfile, priv_data->entry_addr, priv_data->entry.symfile_addr);
 
   delete obj;
 }
@@ -773,7 +773,7 @@ JITed symbol file is not an object file, ignoring it.\n"));
 				      &sai,
 				      OBJF_SHARED | OBJF_NOT_FILENAME, NULL);
 
-  add_objfile_entry (objfile, entry_addr);
+  add_objfile_entry (objfile, entry_addr, code_entry->symfile_addr);
 }
 
 /* This function registers code associated with a JIT code entry.  It uses the
diff --git a/gdb/jit.h b/gdb/jit.h
index 09dbce21f5c..10a10dade7f 100644
--- a/gdb/jit.h
+++ b/gdb/jit.h
@@ -95,12 +95,17 @@ struct jiter_objfile_data
 
 struct jited_objfile_data
 {
-  jited_objfile_data (CORE_ADDR addr)
-    : addr (addr)
+  jited_objfile_data (CORE_ADDR addr, CORE_ADDR symfile_addr)
+    : addr (addr),
+      symfile_addr (symfile_addr)
   {}
 
   /* Address of struct jit_code_entry for this objfile.  */
   CORE_ADDR addr;
+
+  /* Value of jit_code_entry->symfile_addr for this objfile.  */
+  CORE_ADDR symfile_addr;
+
 };
 
 /* Re-establish the jit breakpoint(s).  */
-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-02-11 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 11:39 [PATCH] gdb: change "maint info jit" to print jit_code_entry::symfile_addr value Jan Vrany via Gdb-patches
2022-02-08 15:49 ` Andrew Burgess via Gdb-patches
2022-02-08 19:16   ` Simon Marchi via Gdb-patches
2022-02-08 19:32     ` Jan Vrany via Gdb-patches
2022-02-08 20:15       ` Simon Marchi via Gdb-patches
2022-02-11 14:53         ` Andrew Burgess via Gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox