mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-30 21:44:19 +08:00
03bef283c2
* jit.c (struct jit_inferior_data): Rewrite. (struct jit_objfile_data): New. (get_jit_objfile_data): New function. (add_objfile_entry): Update. (jit_read_descriptor): Return int. Replace descriptor_addr argument with inf_data. Update. Don't call error. (jit_breakpoint_re_set_internal): Reorder logic. Update. Look up descriptor here. (jit_inferior_init): Don't look up descriptor. Don't call error. (jit_reset_inferior_data_and_breakpoints) (jit_inferior_created_observer): Remove. (jit_inferior_exit_hook): Update. (jit_executable_changed_observer): Remove. (jit_event_handler): Update. (free_objfile_data): Reset inferior data if needed. (_initialize_jit): Update. gdb/testsuite * gdb.base/jit-simple.exp: New file. * gdb.base/jit-simple.c: New file.
38 lines
708 B
C
38 lines
708 B
C
/* Simple program using the JIT API. */
|
|
|
|
#include <stdint.h>
|
|
|
|
struct jit_code_entry
|
|
{
|
|
struct jit_code_entry *next_entry;
|
|
struct jit_code_entry *prev_entry;
|
|
const char *symfile_addr;
|
|
uint64_t symfile_size;
|
|
};
|
|
|
|
struct jit_descriptor
|
|
{
|
|
uint32_t version;
|
|
/* This type should be jit_actions_t, but we use uint32_t
|
|
to be explicit about the bitwidth. */
|
|
uint32_t action_flag;
|
|
struct jit_code_entry *relevant_entry;
|
|
struct jit_code_entry *first_entry;
|
|
};
|
|
|
|
#ifdef SPACER
|
|
/* This exists to change the address of __jit_debug_descriptor. */
|
|
int spacer = 4;
|
|
#endif
|
|
|
|
struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 };
|
|
|
|
void __jit_debug_register_code()
|
|
{
|
|
}
|
|
|
|
int main()
|
|
{
|
|
return 0;
|
|
}
|