gdb/jit: link to jit_objfile_data directly from the objfile struct
[deliverable/binutils-gdb.git] / gdb / jit.h
index cc135037812f43b5843d4f5ae937dd7db63bb826..6109216639142cc5e6ba4ac8feacd8c30f85abd5 100644 (file)
--- a/gdb/jit.h
+++ b/gdb/jit.h
@@ -20,6 +20,9 @@
 #ifndef JIT_H
 #define JIT_H
 
+struct objfile;
+struct minimal_symbol;
+
 /* When the JIT breakpoint fires, the inferior wants us to take one of
    these actions.  These values are used by the inferior, so the
    values of these enums cannot be changed.  */
@@ -64,6 +67,34 @@ struct jit_descriptor
   CORE_ADDR first_entry;
 };
 
+/* Per-objfile structure recording the addresses in the program space.
+   This object serves two purposes: for ordinary objfiles, it may
+   cache some symbols related to the JIT interface; and for
+   JIT-created objfiles, it holds some information about the
+   jit_code_entry.  */
+
+struct jit_objfile_data
+{
+  jit_objfile_data (struct objfile *objfile)
+    : objfile (objfile)
+  {}
+
+  ~jit_objfile_data ();
+
+  /* Back-link to the objfile. */
+  struct objfile *objfile;
+
+  /* Symbol for __jit_debug_register_code.  */
+  minimal_symbol *register_code = nullptr;
+
+  /* Symbol for __jit_debug_descriptor.  */
+  minimal_symbol *descriptor = nullptr;
+
+  /* Address of struct jit_code_entry in this objfile.  This is only
+     non-zero for objfiles that represent code created by the JIT.  */
+  CORE_ADDR addr = 0;
+};
+
 /* 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
@@ -76,8 +107,9 @@ extern void jit_inferior_created_hook (void);
 extern void jit_breakpoint_re_set (void);
 
 /* This function is called by handle_inferior_event when it decides
-   that the JIT event breakpoint has fired.  */
+   that the JIT event breakpoint has fired.  JITER is the objfile
+   whose JIT event breakpoint has been hit.  */
 
-extern void jit_event_handler (struct gdbarch *gdbarch);
+extern void jit_event_handler (gdbarch *gdbarch, objfile *jiter);
 
 #endif /* JIT_H */
This page took 0.024727 seconds and 4 git commands to generate.