GDB (xrefs)
|
#include "defs.h"
#include "jit.h"
#include "jit-reader.h"
#include "block.h"
#include "breakpoint.h"
#include "command.h"
#include "dictionary.h"
#include "filenames.h"
#include "frame-unwind.h"
#include "gdbcmd.h"
#include "gdbcore.h"
#include "inferior.h"
#include "observable.h"
#include "objfiles.h"
#include "regcache.h"
#include "symfile.h"
#include "symtab.h"
#include "target.h"
#include "gdbsupport/gdb-dlfcn.h"
#include <sys/stat.h>
#include "gdb_bfd.h"
#include "readline/tilde.h"
#include "completer.h"
#include <forward_list>
Go to the source code of this file.
Classes | |
struct | jit_reader |
struct | gdb_block |
struct | gdb_symtab |
struct | gdb_object |
struct | jit_dbg_reader_data |
struct | jit_unwind_private |
struct | jit_gdbarch_data_type |
Macros | |
#define | jit_debug_printf(fmt, ...) debug_prefixed_printf_cond (jit_debug, "jit", fmt, ##__VA_ARGS__) |
Typedefs | |
typedef struct gdb_reader_funcs * | reader_init_fn_type(void) |
Functions | |
static void | jit_inferior_created_hook (inferior *inf) |
static void | jit_inferior_exit_hook (struct inferior *inf) |
static void | show_jit_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static void | maint_info_jit_cmd (const char *args, int from_tty) |
static struct jit_reader * | jit_reader_load (const char *file_name) |
static void | jit_reader_load_command (const char *args, int from_tty) |
static void | jit_reader_unload_command (const char *args, int from_tty) |
static jiter_objfile_data * | get_jiter_objfile_data (objfile *objf) |
static void | add_objfile_entry (struct objfile *objfile, CORE_ADDR entry, CORE_ADDR symfile_addr, ULONGEST symfile_size) |
static bool | jit_read_descriptor (gdbarch *gdbarch, jit_descriptor *descriptor, objfile *jiter) |
static void | jit_read_code_entry (struct gdbarch *gdbarch, CORE_ADDR code_addr, struct jit_code_entry *code_entry) |
static enum gdb_status | jit_target_read_impl (GDB_CORE_ADDR target_mem, void *gdb_buf, int len) |
static struct gdb_object * | jit_object_open_impl (struct gdb_symbol_callbacks *cb) |
static struct gdb_symtab * | jit_symtab_open_impl (struct gdb_symbol_callbacks *cb, struct gdb_object *object, const char *file_name) |
static struct gdb_block * | jit_block_open_impl (struct gdb_symbol_callbacks *cb, struct gdb_symtab *symtab, struct gdb_block *parent, GDB_CORE_ADDR begin, GDB_CORE_ADDR end, const char *name) |
static void | jit_symtab_line_mapping_add_impl (struct gdb_symbol_callbacks *cb, struct gdb_symtab *stab, int nlines, struct gdb_line_mapping *map) |
static void | jit_symtab_close_impl (struct gdb_symbol_callbacks *cb, struct gdb_symtab *stab) |
static void | finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile) |
static void | jit_object_close_impl (struct gdb_symbol_callbacks *cb, struct gdb_object *obj) |
static int | jit_reader_try_read_symtab (gdbarch *gdbarch, jit_code_entry *code_entry, CORE_ADDR entry_addr) |
static void | jit_bfd_try_read_symtab (struct jit_code_entry *code_entry, CORE_ADDR entry_addr, struct gdbarch *gdbarch) |
static void | jit_register_code (struct gdbarch *gdbarch, CORE_ADDR entry_addr, struct jit_code_entry *code_entry) |
static struct objfile * | jit_find_objf_with_entry_addr (CORE_ADDR entry_addr) |
static void | jit_breakpoint_deleted (struct breakpoint *b) |
static void | jit_breakpoint_re_set_internal (struct gdbarch *gdbarch, program_space *pspace) |
static void | jit_unwind_reg_set_impl (struct gdb_unwind_callbacks *cb, int dwarf_regnum, struct gdb_reg_value *value) |
static void | reg_value_free_impl (struct gdb_reg_value *value) |
static struct gdb_reg_value * | jit_unwind_reg_get_impl (struct gdb_unwind_callbacks *cb, int regnum) |
static void | jit_dealloc_cache (frame_info *this_frame, void *cache) |
static int | jit_frame_sniffer (const struct frame_unwind *self, frame_info_ptr this_frame, void **cache) |
static void | jit_frame_this_id (frame_info_ptr this_frame, void **cache, struct frame_id *this_id) |
static struct value * | jit_frame_prev_register (frame_info_ptr this_frame, void **cache, int reg) |
static void | jit_prepend_unwinder (struct gdbarch *gdbarch) |
static void | jit_inferior_init (inferior *inf) |
static void | jit_inferior_execd_hook (inferior *exec_inf, inferior *follow_inf) |
void | jit_breakpoint_re_set (void) |
void | jit_event_handler (gdbarch *gdbarch, objfile *jiter) |
void | _initialize_jit () |
Variables | |
static std::string | jit_reader_dir |
static const char | jit_break_name [] = "__jit_debug_register_code" |
static const char | jit_descriptor_name [] = "__jit_debug_descriptor" |
static bool | jit_debug = false |
static struct jit_reader * | loaded_jit_reader = NULL |
static const char | reader_init_fn_sym [] = "gdb_init_reader" |
static const struct frame_unwind | jit_frame_unwind |
static const registry< gdbarch >::key< jit_gdbarch_data_type > | jit_gdbarch_data |
#define jit_debug_printf | ( | fmt, | |
... ) debug_prefixed_printf_cond (jit_debug, "jit", fmt, ##__VA_ARGS__) |
Definition at line 61 of file jit.c.
Referenced by jit_bfd_try_read_symtab(), jit_breakpoint_re_set_internal(), jit_frame_sniffer(), jit_inferior_init(), jit_read_descriptor(), jit_reader_load(), jit_reader_try_read_symtab(), jit_register_code(), and jit_unwind_reg_set_impl().
typedef struct gdb_reader_funcs * reader_init_fn_type(void) |
void _initialize_jit | ( | ) |
Definition at line 1299 of file jit.c.
Referenced by initialize_all_files().
|
static |
Definition at line 234 of file jit.c.
References objfile::jited_data.
Referenced by jit_bfd_try_read_symtab(), and jit_object_close_impl().
|
static |
Definition at line 516 of file jit.c.
References add_compunit_symtab_to_objfile(), allocate_compunit_symtab(), allocate_symtab(), objfile::arch(), gdb_block::begin, gdb_symtab::blocks, builtin_type(), builtin_type::builtin_void, block::end(), gdb_block::end, gdb_symtab::file_name, FIRST_LOCAL_BLOCK, GLOBAL_BLOCK, gdb_symtab::linetable, LOC_BLOCK, lookup_function_type(), general_symbol_info::m_name, mdict_create_linear(), gdb_symtab::nblocks, new_block(), objfile::objfile_obstack, symbol::set_aclass_index(), blockvector::set_block(), compunit_symtab::set_blockvector(), block::set_compunit_symtab(), compunit_symtab::set_dirname(), symbol::set_domain(), block::set_end(), block::set_function(), symtab::set_linetable(), blockvector::set_map(), block::set_multidict(), blockvector::set_num_blocks(), block::set_start(), block::set_superblock(), symbol::set_symtab(), symbol::set_type(), symbol::set_value_block(), size, block::start(), blockvector::static_block(), STATIC_BLOCK, and VAR_DOMAIN.
Referenced by jit_object_close_impl().
|
static |
Definition at line 222 of file jit.c.
References objfile::jiter_data.
Referenced by jit_breakpoint_re_set_internal().
|
static |
Definition at line 743 of file jit.c.
References add_objfile_entry(), gdb_bfd_open_from_target_memory(), gdb_printf(), gdb_puts(), gdb_stderr, gdbarch_bfd_arch_info(), gnutarget, jit_debug_printf, OBJF_NOT_FILENAME, OBJF_SHARED, objfile::objfile(), paddress(), symbol_file_add_from_bfd(), jit_code_entry::symfile_addr, and jit_code_entry::symfile_size.
Referenced by jit_register_code().
|
static |
Definition at line 462 of file jit.c.
References gdb_block::begin, gdb_block::end, name, and gdb_block::parent.
Referenced by jit_reader_try_read_symtab().
|
static |
Definition at line 844 of file jit.c.
References bp_jit_event, jiter_objfile_data::cached_code_address, objfile::jiter_data, breakpoint::locations(), and breakpoint::type.
void jit_breakpoint_re_set | ( | void | ) |
Definition at line 1230 of file jit.c.
References current_program_space, jit_breakpoint_re_set_internal(), and target_gdbarch().
Referenced by breakpoint_re_set().
|
static |
Definition at line 869 of file jit.c.
References jiter_objfile_data::cached_code_address, create_jit_event_breakpoint(), delete_breakpoint(), jiter_objfile_data::descriptor, get_jiter_objfile_data(), jit_break_name, jiter_objfile_data::jit_breakpoint, jit_debug_printf, jit_descriptor_name, lookup_minimal_symbol(), bound_minimal_symbol::minsym, program_space::objfiles(), paddress(), objfile::pspace, jiter_objfile_data::register_code, bound_minimal_symbol::value_address(), and minimal_symbol::value_address().
Referenced by jit_breakpoint_re_set(), and jit_inferior_init().
|
static |
Definition at line 995 of file jit.c.
Referenced by jit_frame_sniffer().
Definition at line 1250 of file jit.c.
References jit_descriptor::action_flag, gdb_printf(), gdb_stderr, jit_find_objf_with_entry_addr(), JIT_NOACTION, jit_read_code_entry(), jit_read_descriptor(), JIT_REGISTER, jit_register_code(), JIT_UNREGISTER, objfile::jiter_data, paddress(), jit_descriptor::relevant_entry, and objfile::unlink().
Referenced by handle_jit_event().
|
static |
Definition at line 829 of file jit.c.
References current_program_space, and program_space::objfiles().
Referenced by jit_event_handler(), and jit_inferior_init().
|
static |
Definition at line 1086 of file jit.c.
References frame_unwind_got_bytes(), frame_unwind_got_optimized(), jit_unwind_private::regcache, register_size(), and status.
|
static |
Definition at line 1010 of file jit.c.
References jit_reader::functions, GDB_SUCCESS, frame_info_ptr::get(), get_frame_arch(), jit_dealloc_cache(), jit_debug_printf, jit_target_read_impl(), jit_unwind_reg_get_impl(), jit_unwind_reg_set_impl(), loaded_jit_reader, gdb_unwind_callbacks::priv_data, gdb_reader_funcs::priv_data, gdb_unwind_callbacks::reg_get, gdb_unwind_callbacks::reg_set, jit_unwind_private::regcache, gdb_unwind_callbacks::target_read, jit_unwind_private::this_frame, and gdb_reader_funcs::unwind.
|
static |
Definition at line 1057 of file jit.c.
References frame_id_build(), jit_reader::functions, gdb_reader_funcs::get_frame_id, jit_target_read_impl(), jit_unwind_reg_get_impl(), loaded_jit_reader, gdb_unwind_callbacks::priv_data, gdb_unwind_callbacks::reg_get, gdb_unwind_callbacks::reg_set, jit_unwind_private::regcache, gdb_unwind_callbacks::target_read, and jit_unwind_private::this_frame.
|
static |
Definition at line 1213 of file jit.c.
References jit_inferior_init().
Referenced by jit_reader_load_command().
Definition at line 1221 of file jit.c.
References jit_inferior_init().
|
static |
Definition at line 1240 of file jit.c.
References current_program_space, and program_space::objfiles_safe().
Referenced by jit_reader_unload_command().
|
static |
Definition at line 1157 of file jit.c.
References jit_descriptor::first_entry, gdb_printf(), gdb_stderr, jit_breakpoint_re_set_internal(), jit_debug_printf, jit_find_objf_with_entry_addr(), jit_prepend_unwinder(), jit_read_code_entry(), jit_read_descriptor(), jit_register_code(), jit_code_entry::next_entry, program_space::objfiles(), and jit_descriptor::version.
Referenced by jit_inferior_created_hook(), and jit_inferior_execd_hook().
|
static |
Definition at line 654 of file jit.c.
References add_objfile_entry(), jit_dbg_reader_data::entry, jit_dbg_reader_data::entry_addr, finalize_symtab(), jit_dbg_reader_data::gdbarch, objfile_per_bfd_storage::gdbarch, objfile::make(), OBJF_NOT_FILENAME, objfile_name(), paddress(), objfile::per_bfd, gdb_symbol_callbacks::priv_data, jit_code_entry::symfile_addr, jit_code_entry::symfile_size, and gdb_object::symtabs.
Referenced by jit_reader_try_read_symtab().
|
static |
Definition at line 435 of file jit.c.
Referenced by jit_reader_try_read_symtab().
|
static |
Definition at line 1138 of file jit.c.
References frame_unwind_prepend_unwinder(), registry< T >::get(), jit_frame_unwind, and jit_gdbarch_data.
Referenced by jit_inferior_init().
|
static |
Definition at line 295 of file jit.c.
References builtin_type::builtin_data_ptr, builtin_type(), err, extract_typed_address(), extract_unsigned_integer(), gdbarch_byte_order(), type::length(), jit_code_entry::next_entry, jit_code_entry::prev_entry, jit_code_entry::symfile_addr, jit_code_entry::symfile_size, target_read_memory(), and type_align().
Referenced by jit_event_handler(), and jit_inferior_init().
|
static |
Definition at line 247 of file jit.c.
References jit_descriptor::action_flag, builtin_type::builtin_data_ptr, builtin_type(), jiter_objfile_data::descriptor, err, extract_typed_address(), extract_unsigned_integer(), jit_descriptor::first_entry, gdb_printf(), gdb_stderr, gdbarch_byte_order(), jit_debug_printf, objfile::jiter_data, type::length(), paddress(), jit_descriptor::relevant_entry, target_read_memory(), minimal_symbol::value_address(), and jit_descriptor::version.
Referenced by jit_event_handler(), and jit_inferior_init().
|
static |
Definition at line 150 of file jit.c.
References GDB_READER_INTERFACE_VERSION, jit_debug_printf, reader_init_fn_sym, and gdb_reader_funcs::reader_version.
Referenced by jit_reader_load_command().
|
static |
Definition at line 177 of file jit.c.
References current_inferior(), jit_inferior_created_hook(), jit_reader_dir, jit_reader_load(), loaded_jit_reader, and reinit_frame_cache().
|
static |
Definition at line 682 of file jit.c.
References jit_reader::functions, GDB_SUCCESS, jit_block_open_impl(), jit_debug_printf, jit_object_close_impl(), jit_object_open_impl(), jit_symtab_close_impl(), jit_symtab_line_mapping_add_impl(), jit_symtab_open_impl(), jit_target_read_impl(), loaded_jit_reader, gdb_symbol_callbacks::priv_data, gdb_reader_funcs::read, status, jit_code_entry::symfile_addr, jit_code_entry::symfile_size, and target_read_memory().
Referenced by jit_register_code().
|
static |
Definition at line 198 of file jit.c.
References current_inferior(), jit_inferior_exit_hook(), loaded_jit_reader, and reinit_frame_cache().
|
static |
Definition at line 811 of file jit.c.
References jit_bfd_try_read_symtab(), jit_debug_printf, jit_reader_try_read_symtab(), paddress(), jit_code_entry::symfile_addr, and jit_code_entry::symfile_size.
Referenced by jit_event_handler(), and jit_inferior_init().
|
static |
Definition at line 505 of file jit.c.
Referenced by jit_reader_try_read_symtab().
|
static |
Definition at line 478 of file jit.c.
References gdb_line_mapping::line, gdb_symtab::linetable, and linetable_entry::pc().
Referenced by jit_reader_try_read_symtab().
|
static |
Definition at line 447 of file jit.c.
References gdb_symtab::file_name.
Referenced by jit_reader_try_read_symtab().
|
static |
Definition at line 420 of file jit.c.
References GDB_FAIL, GDB_SUCCESS, and target_read_memory().
Referenced by jit_frame_sniffer(), jit_frame_this_id(), and jit_reader_try_read_symtab().
|
static |
Definition at line 970 of file jit.c.
References deprecated_frame_register_read(), gdbarch_dwarf2_reg_to_regnum(), get_frame_arch(), gdb_unwind_callbacks::priv_data, reg_value_free_impl(), register_size(), regnum, size, jit_unwind_private::this_frame, value, value::value(), and xmalloc().
Referenced by jit_frame_sniffer(), and jit_frame_this_id().
|
static |
Definition at line 940 of file jit.c.
References gdbarch_dwarf2_reg_to_regnum(), get_frame_arch(), jit_debug_printf, gdb_unwind_callbacks::priv_data, jit_unwind_private::regcache, jit_unwind_private::this_frame, and value::value().
Referenced by jit_frame_sniffer().
|
static |
Definition at line 74 of file jit.c.
References current_inferior(), current_uiout, gdbarch_ptr_bit(), and ui_left.
|
static |
|
static |
Definition at line 65 of file jit.c.
References gdb_printf().
|
static |
Definition at line 48 of file jit.c.
Referenced by jit_breakpoint_re_set_internal().
|
static |
Definition at line 50 of file jit.c.
Referenced by jit_breakpoint_re_set_internal().
|
static |
Definition at line 1107 of file jit.c.
Referenced by jit_prepend_unwinder().
|
static |
Definition at line 1133 of file jit.c.
Referenced by jit_prepend_unwinder().
|
static |
Definition at line 46 of file jit.c.
Referenced by jit_reader_load_command().
|
static |
Definition at line 142 of file jit.c.
Referenced by jit_frame_sniffer(), jit_frame_this_id(), jit_reader_load_command(), jit_reader_try_read_symtab(), and jit_reader_unload_command().
|
static |
Definition at line 145 of file jit.c.
Referenced by jit_reader_load().