#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. */
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
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 */