GDB (xrefs)
|
#include "defs.h"
#include <signal.h>
#include <fcntl.h>
#include "inferior.h"
#include "symtab.h"
#include "command.h"
#include "gdbcmd.h"
#include "bfd.h"
#include "target.h"
#include "gdbcore.h"
#include "dis-asm.h"
#include <sys/stat.h>
#include "completer.h"
#include "observable.h"
#include "cli/cli-utils.h"
#include "gdbarch.h"
#include "interps.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | hook_type) (const char *) |
Functions | |
static void | call_extra_exec_file_hooks (const char *filename) |
void | specify_exec_file_hook (void(*hook)(const char *)) |
void | reopen_exec_file (void) |
void | validate_files (void) |
const char * | get_exec_file (int err) |
std::string | memory_error_message (enum target_xfer_status err, struct gdbarch *gdbarch, CORE_ADDR memaddr) |
void | memory_error (enum target_xfer_status err, CORE_ADDR memaddr) |
static void | read_memory_object (enum target_object object, CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len) |
void | read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len) |
void | read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len) |
void | read_code (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len) |
int | safe_read_memory_integer (CORE_ADDR memaddr, int len, enum bfd_endian byte_order, LONGEST *return_value) |
int | safe_read_memory_unsigned_integer (CORE_ADDR memaddr, int len, enum bfd_endian byte_order, ULONGEST *return_value) |
LONGEST | read_memory_integer (CORE_ADDR memaddr, int len, enum bfd_endian byte_order) |
ULONGEST | read_memory_unsigned_integer (CORE_ADDR memaddr, int len, enum bfd_endian byte_order) |
LONGEST | read_code_integer (CORE_ADDR memaddr, int len, enum bfd_endian byte_order) |
ULONGEST | read_code_unsigned_integer (CORE_ADDR memaddr, int len, enum bfd_endian byte_order) |
CORE_ADDR | read_memory_typed_address (CORE_ADDR addr, struct type *type) |
void | write_memory (CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len) |
static void | notify_memory_changed (inferior *inf, CORE_ADDR addr, ssize_t len, const bfd_byte *data) |
void | write_memory_with_notification (CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len) |
void | write_memory_unsigned_integer (CORE_ADDR addr, int len, enum bfd_endian byte_order, ULONGEST value) |
void | write_memory_signed_integer (CORE_ADDR addr, int len, enum bfd_endian byte_order, LONGEST value) |
static void | show_gnutarget_string (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static void | set_gnutarget_command (const char *ignore, int from_tty, struct cmd_list_element *c) |
static void | complete_set_gnutarget (struct cmd_list_element *cmd, completion_tracker &tracker, const char *text, const char *word) |
void | set_gnutarget (const char *newtarget) |
void | _initialize_core () |
Variables | |
hook_type | deprecated_exec_file_display_hook |
static hook_type * | exec_file_extra_hooks |
static int | exec_file_hook_count = 0 |
const char * | gnutarget |
static std::string | gnutarget_string |
typedef void(* hook_type) (const char *) |
Definition at line 47 of file corefile.c.
void _initialize_core | ( | ) |
Definition at line 468 of file corefile.c.
Referenced by initialize_all_files().
|
static |
Definition at line 61 of file corefile.c.
References exec_file_extra_hooks, and exec_file_hook_count.
Referenced by specify_exec_file_hook().
|
static |
Definition at line 436 of file corefile.c.
References complete_on_enum().
const char * get_exec_file | ( | int | err | ) |
Definition at line 150 of file corefile.c.
References current_program_space, err, and program_space::exec_filename.
Referenced by bsd_kvm_target_open(), go32_nat_target::create_inferior(), nto_procfs_target::create_inferior(), elf_none_make_corefile_notes(), exec_file_locate_attach(), fbsd_make_corefile_notes(), fork_inferior(), load_command(), procfs_target::make_corefile_notes(), remote_target::remote_add_inferior(), run_command_1(), setup_inferior(), target_announce_attach(), target_announce_detach(), and validate_exec_file().
void memory_error | ( | enum target_xfer_status | err, |
CORE_ADDR | memaddr ) |
Definition at line 186 of file corefile.c.
References err, memory_error_message(), target_gdbarch(), TARGET_XFER_E_IO, and TARGET_XFER_UNAVAILABLE.
Referenced by alpha_read_insn(), BP_MANIPULATION_ENDIAN(), c_get_string(), csky_get_insn(), riscv_insn::fetch_instruction(), get_target_memory(), loongarch_fetch_instruction(), mips_fetch_instruction(), or1k_fetch_instruction(), gdb_disassembler::print_insn(), read_memory_object(), read_value_memory(), tilegx_analyze_prologue(), and write_memory().
std::string memory_error_message | ( | enum target_xfer_status | err, |
struct gdbarch * | gdbarch, | ||
CORE_ADDR | memaddr ) |
Definition at line 163 of file corefile.c.
References err, paddress(), TARGET_XFER_E_IO, target_xfer_status_to_string(), and TARGET_XFER_UNAVAILABLE.
Referenced by insert_bp_location(), memory_error(), and val_print_string().
|
static |
Definition at line 360 of file corefile.c.
References interps_notify_memory_changed(), and gdb::observers::memory_changed.
Referenced by write_memory_with_notification().
void read_code | ( | CORE_ADDR | memaddr, |
gdb_byte * | myaddr, | ||
ssize_t | len ) |
Definition at line 254 of file corefile.c.
References read_memory_object(), and TARGET_OBJECT_CODE_MEMORY.
Referenced by amd64_analyze_prologue(), amd64_classify_insn_at(), amd64_dtrace_probe_is_enabled(), i386_insn_is_call(), i386_insn_is_jump(), i386_insn_is_ret(), gdb_pretty_print_disassembler::pretty_print_insn(), read_code_integer(), and read_code_unsigned_integer().
LONGEST read_code_integer | ( | CORE_ADDR | memaddr, |
int | len, | ||
enum bfd_endian | byte_order ) |
Definition at line 316 of file corefile.c.
References extract_signed_integer(), and read_code().
Referenced by i386_analyze_frame_setup().
ULONGEST read_code_unsigned_integer | ( | CORE_ADDR | memaddr, |
int | len, | ||
enum bfd_endian | byte_order ) |
Definition at line 326 of file corefile.c.
References extract_unsigned_integer(), and read_code().
Referenced by amd64_analyze_prologue(), arm_analyze_load_stack_chk_guard(), arm_skip_stack_protector(), ft32_fetch_instruction(), i386_analyze_frame_setup(), i386_follow_jump(), i386_skip_prologue(), skip_prologue_function(), and thumb_analyze_prologue().
void read_memory | ( | CORE_ADDR | memaddr, |
gdb_byte * | myaddr, | ||
ssize_t | len ) |
Definition at line 238 of file corefile.c.
References read_memory_object(), and TARGET_OBJECT_MEMORY.
Referenced by ada_exception_message_1(), ada_value_assign(), ada_value_primitive_packed_val(), alpha_extract_return_value(), alpha_return_value(), amd64_darwin_sigcontext_addr(), amd64_displaced_step_copy_insn(), amd64_relocate_instruction(), amd64obsd_supply_pcb(), amd64obsd_supply_uthread(), avr_frame_prev_register(), avr_scan_prologue(), compute_variant_fields_inner(), default_search_memory(), displaced_step_prepare_throw(), dump_memory_to_file(), extract_call_winsize(), ravenscar_thread_target::get_fpu_state(), get_frame_memory(), get_running_thread_id(), h8300h_return_value(), i386_darwin_sigcontext_addr(), i386_darwin_sstep_at_sigreturn(), i386_displaced_step_copy_insn(), i386_gnu_sigcontext_addr(), i386_linux_sigcontext_addr(), i386_relocate_instruction(), i386_skip_probe(), i386nbsd_supply_pcb(), i386obsd_supply_pcb(), i386obsd_supply_uthread(), ia64_frame_prev_register(), ia64_linux_sigcontext_register_address(), infpy_read_memory(), iq2000_extract_return_value(), lm32_extract_return_value(), i386_linux_nat_target::low_resume(), m32c_return_value(), m68k_return_value(), m68k_svr4_return_value(), m68kbsd_supply_pcb(), selftests::memory_error_test(), mep_get_insn(), mep_return_value(), mips_linux_in_dynsym_stub(), open_symbol_file_object(), or1k_return_value(), ppcnbsd_supply_pcb(), ppcobsd_supply_pcb(), ada_catchpoint::print_it(), print_object_command(), selftests::print_one_insn_test(), printf_c_string(), printf_wide_c_string(), read_fat_string_value(), read_known_tasks_array(), read_known_tasks_list(), dwarf_expr_context::read_mem(), read_memory_integer(), read_memory_typed_address(), read_memory_unsigned_integer(), read_target_long_array(), read_target_long_array(), recpy_bt_insn_data(), selftests::search_memory_tests::run_tests(), rw_pieced_value(), s390_displaced_step_copy_insn(), remote_target::search_memory(), sparc64nbsd_supply_pcb(), sparc64obsd_supply_pcb(), ravenscar_arch_ops::supply_one_register(), value_assign(), pascal_language::value_print_inner(), vax_return_value(), xtensa_push_dummy_call(), z80_frame_prev_register(), z80_frame_unwind_cache(), z80_insn_is_call(), z80_insn_is_jump(), z80_insn_is_ret(), z80_scan_prologue(), and z80_software_single_step().
LONGEST read_memory_integer | ( | CORE_ADDR | memaddr, |
int | len, | ||
enum bfd_endian | byte_order ) |
Definition at line 296 of file corefile.c.
References extract_signed_integer(), and read_memory().
Referenced by bfin_push_dummy_call(), bl_to_blrl_insn_p(), call0_frame_cache(), call0_track_op(), examine_prologue(), get_frame_memory_signed(), h8300_analyze_prologue(), h8300_is_argument_spill(), hppa_frame_cache(), i386_follow_jump(), i386obsd_supply_pcb(), ia64_frame_prev_register(), ia64_pseudo_register_read(), ia64_pseudo_register_write(), lm32_analyze_prologue(), m68k_analyze_frame_setup(), moxie_analyze_prologue(), msp430_skip_trampoline_code(), ppc_deal_with_atomic_sequence(), print_frame_nameless_args(), rl78_return_value(), rs6000_skip_trampoline_code(), rs6000_software_single_step(), s390_is_partial_instruction(), s390_load(), s390_software_single_step(), sh_analyze_prologue(), simple_read_overlay_table(), sixteen_bit_offset_branch_op(), skip_prologue(), v850_analyze_prologue(), xtensa_frame_cache(), xtensa_window_interrupt_insn(), and z80_read_overlay_region_table().
|
static |
Definition at line 211 of file corefile.c.
References current_inferior(), memory_error(), QUIT, status, TARGET_XFER_E_IO, TARGET_XFER_EOF, TARGET_XFER_OK, and target_xfer_partial.
Referenced by read_code(), read_memory(), and read_stack().
CORE_ADDR read_memory_typed_address | ( | CORE_ADDR | addr, |
struct type * | type ) |
Definition at line 336 of file corefile.c.
References extract_typed_address(), type::length(), and read_memory().
Referenced by bsd_uthread_read_memory_address(), hppa32_convert_from_func_ptr_addr(), hppa_skip_trampoline_code(), i386_mpx_get_bt_entry(), i386_mpx_info_bounds(), i386_mpx_set_bounds(), resolve_dynamic_type_internal(), solib_svr4_r_brk(), solib_svr4_r_ldsomap(), solib_svr4_r_map(), and solib_svr4_r_next().
ULONGEST read_memory_unsigned_integer | ( | CORE_ADDR | memaddr, |
int | len, | ||
enum bfd_endian | byte_order ) |
Definition at line 306 of file corefile.c.
References extract_unsigned_integer(), and read_memory().
Referenced by aix_sighandle_frame_cache(), amd64_displaced_step_fixup(), amd64_windows_skip_trampoline_code(), amd64obsd_collect_uthread(), amd64obsd_supply_uthread(), amd64obsd_trapframe_cache(), arm_analyze_load_stack_chk_guard(), arm_get_next_pcs_read_memory_unsigned_integer(), arm_linux_get_next_pcs_syscall_next_pc(), arm_linux_get_syscall_number(), arm_linux_rt_sigreturn_init(), arm_linux_sigreturn_init(), arm_linux_sigreturn_next_pc(), arm_pe_skip_trampoline_code(), arm_process_displaced_insn(), arm_stack_frame_destroyed_p_1(), arm_wince_skip_main_prologue(), bfin_breakpoint_kind_from_pc(), bfin_skip_prologue(), BP_MANIPULATION(), branch_dest(), bsd_uthread_check_magic(), bsd_uthread_lookup_offset(), cleanup_block_load_all(), cleanup_block_store_pc(), cris_scan_prologue(), csky_analyze_prologue(), decode_prologue(), dip_prefix(), execute_l32e(), bsd_uthread_target::extra_thread_info(), find_implementation_from_class(), find_step_target(), get_data_from_address(), get_frame_memory_unsigned(), h8300_analyze_prologue(), h8300_extract_return_value(), h8300_is_argument_spill(), hppa_fallback_frame_cache(), i386_darwin_sstep_at_sigreturn(), i386_displaced_step_fixup(), i386_fetch_pointer_argument(), i386_pe_skip_trampoline_code(), i386_svr4_sigcontext_addr(), i386bsd_sigcontext_addr(), i386nbsd_sigtramp_cache_init(), i386obsd_collect_uthread(), i386obsd_supply_uthread(), i386obsd_trapframe_cache(), ia64_convert_from_func_ptr_addr(), ia64_sigtramp_frame_prev_register(), iq2000_scan_prologue(), i386_linux_nat_target::low_resume(), m32c_skip_trampoline_code(), m68hc11_analyze_instruction(), m68k_analyze_frame_setup(), m68k_analyze_prologue(), m68k_analyze_register_saves(), m68k_linux_get_sigtramp_info(), move_mem_to_reg_movem_op(), moxie_analyze_prologue(), nds32_analyze_epilogue(), nds32_analyze_prologue(), nds32_stack_frame_destroyed_p(), nios2_analyze_prologue(), none_reg_mode_jump_op(), ppc64_plt_entry_point(), ppc64_plt_pcrel_entry_point(), ppc64_sysv_abi_push_dummy_call(), ppc_linux_sigtramp_cache(), ppc_process_record(), ppc_skip_trampoline_code(), read_insn(), read_objc_class(), read_objc_methlist_nmethods(), read_objc_method(), read_objc_object(), read_objc_super(), rs6000_convert_from_func_ptr_addr(), rs6000_skip_trampoline_code(), s390_linux_get_syscall_number(), s390_process_record(), s390_sigtramp_frame_unwind_cache(), sh_analyze_prologue(), sh_stack_frame_destroyed_p(), solib_svr4_r_ldsomap(), solib_svr4_r_next(), sparc32_linux_step_trap(), sparc32_return_value(), sparc32obsd_supply_uthread(), sparc64_linux_step_trap(), sparc64obsd_supply_uthread(), bsd_uthread_target::thread_alive(), thumb_analyze_prologue(), thumb_process_displaced_insn(), tic6x_fetch_instruction(), v850_analyze_prologue(), xstormy16_analyze_prologue(), and xstormy16_stack_frame_destroyed_p().
void read_stack | ( | CORE_ADDR | memaddr, |
gdb_byte * | myaddr, | ||
ssize_t | len ) |
Definition at line 246 of file corefile.c.
References read_memory_object(), and TARGET_OBJECT_STACK_MEMORY.
void reopen_exec_file | ( | void | ) |
Definition at line 106 of file corefile.c.
References current_program_space, program_space::ebfd_mtime, program_space::exec_bfd(), and exec_file_attach().
Referenced by generic_mourn_inferior(), load_command(), remote_target::open_1(), reread_symbols(), run_command_1(), setup_inferior(), and validate_exec_file().
int safe_read_memory_integer | ( | CORE_ADDR | memaddr, |
int | len, | ||
enum bfd_endian | byte_order, | ||
LONGEST * | return_value ) |
Definition at line 264 of file corefile.c.
References extract_signed_integer(), and target_read_memory().
Referenced by aix_sighandle_frame_cache(), decode_prologue(), m32r_skip_prologue(), nios2_fetch_insn(), s390_backchain_frame_unwind_cache(), and xtensa_frame_cache().
int safe_read_memory_unsigned_integer | ( | CORE_ADDR | memaddr, |
int | len, | ||
enum bfd_endian | byte_order, | ||
ULONGEST * | return_value ) |
Definition at line 282 of file corefile.c.
References extract_unsigned_integer(), and target_read_memory().
Referenced by aarch64_displaced_step_copy_insn(), aarch64_software_single_step(), aarch64_stack_frame_destroyed_p(), arm_exidx_unwind_sniffer(), arm_fbsd_sigframe_init(), arm_m_exception_cache(), arm_scan_prologue(), and rs6000_frame_cache().
void set_gnutarget | ( | const char * | newtarget | ) |
Definition at line 460 of file corefile.c.
References gnutarget_string, and set_gnutarget_command().
|
static |
Definition at line 419 of file corefile.c.
References gnutarget, gnutarget_string, and remove_trailing_whitespace().
Referenced by set_gnutarget().
|
static |
Definition at line 410 of file corefile.c.
References gdb_printf().
void specify_exec_file_hook | ( | void(*)(const char *) | hook | ) |
Definition at line 73 of file corefile.c.
References call_extra_exec_file_hooks(), deprecated_exec_file_display_hook, exec_file_extra_hooks, exec_file_hook_count, and xrealloc().
void validate_files | ( | void | ) |
Definition at line 134 of file corefile.c.
References core_bfd, current_program_space, and program_space::exec_bfd().
Referenced by core_target_open(), and exec_file_attach().
void write_memory | ( | CORE_ADDR | memaddr, |
const bfd_byte * | myaddr, | ||
ssize_t | len ) |
Definition at line 347 of file corefile.c.
References memory_error(), status, target_write_memory(), and TARGET_XFER_E_IO.
Referenced by aarch64_push_dummy_call(), alpha_push_dummy_call(), amd64_displaced_step_copy_insn(), amd64_dtrace_disable_probe(), amd64_dtrace_enable_probe(), amd64_push_arguments(), amd64_push_dummy_call(), amd64_windows_adjust_args_passed_by_pointer(), amd64_windows_push_arguments(), amd64_windows_push_dummy_call(), amd64obsd_collect_uthread(), arc_push_dummy_call(), arm_displaced_init_closure(), arm_push_dummy_call(), avr_push_dummy_call(), bfin_push_dummy_call(), BP_MANIPULATION_ENDIAN(), call_function_by_hand_dummy(), cris_push_dummy_call(), csky_push_dummy_call(), ensure_lval(), find_func_descr(), find_func_descr(), value::force_lval(), fortran_argument_convert(), frv_push_dummy_call(), h8300_push_dummy_call(), hppa32_push_dummy_call(), hppa64_push_dummy_call(), i386_darwin_push_dummy_call(), i386_darwin_sstep_at_sigreturn(), i386_displaced_step_copy_insn(), i386_thiscall_push_dummy_call(), i386obsd_collect_uthread(), ia64_pseudo_register_write(), ia64_push_dummy_call(), ia64_store_argument_in_slot(), iq2000_push_dummy_call(), loongarch_push_dummy_call(), i386_linux_nat_target::low_resume(), m32c_push_dummy_call(), m32c_return_value(), m32r_push_dummy_call(), m68hc11_push_dummy_call(), m68k_push_dummy_call(), mep_push_dummy_call(), mips_eabi_push_dummy_call(), mips_n32n64_push_dummy_call(), mips_o32_push_dummy_call(), mips_o64_push_dummy_call(), mips_push_dummy_code(), mn10300_push_dummy_call(), msp430_push_dummy_call(), nds32_push_dummy_call(), nios2_push_dummy_call(), or1k_push_dummy_call(), or1k_return_value(), ppc64_sysv_abi_push_param(), ppc64_sysv_abi_push_val(), ppc_sysv_abi_push_dummy_call(), push_large_arguments(), put_frame_register(), riscv_push_dummy_call(), riscv_return_value(), rl78_push_dummy_call(), rl78_return_value(), rs6000_lynx178_push_dummy_call(), rs6000_push_dummy_call(), rx_push_dummy_call(), s390_displaced_step_copy_insn(), s390_handle_arg(), sh_push_dummy_call_fpu(), sh_push_dummy_call_nofpu(), sparc32_push_dummy_code(), sparc32_return_value(), sparc32_store_arguments(), sparc32obsd_collect_uthread(), sparc64_store_arguments(), sparc64obsd_collect_uthread(), ravenscar_arch_ops::store_one_register(), tic6x_push_dummy_call(), tilegx_push_dummy_call(), v850_push_dummy_call(), value_coerce_to_target(), vax_push_dummy_call(), vax_store_arguments(), write_memory_ptid(), write_memory_signed_integer(), write_memory_unsigned_integer(), write_memory_with_notification(), xstormy16_push_dummy_call(), and xtensa_push_dummy_call().
void write_memory_signed_integer | ( | CORE_ADDR | addr, |
int | len, | ||
enum bfd_endian | byte_order, | ||
LONGEST | value ) |
Definition at line 393 of file corefile.c.
References store_signed_integer(), and write_memory().
Referenced by ppc64_sysv_abi_push_dummy_call(), and ppc_sysv_abi_push_dummy_call().
void write_memory_unsigned_integer | ( | CORE_ADDR | addr, |
int | len, | ||
enum bfd_endian | byte_order, | ||
ULONGEST | value ) |
Definition at line 380 of file corefile.c.
References store_unsigned_integer(), and write_memory().
Referenced by aarch64_displaced_step_copy_insn(), amd64_displaced_step_fixup(), amd64obsd_collect_uthread(), arm_catch_kernel_helper_return(), arm_displaced_init_closure(), BP_MANIPULATION(), cleanup_block_store_pc(), execute_s32e(), h8300_push_dummy_call(), i386_displaced_step_fixup(), i386_mpx_set_bounds(), i386obsd_collect_uthread(), m32c_push_dummy_call(), mn10300_push_dummy_call(), msp430_push_dummy_call(), rx_push_dummy_call(), s390_handle_arg(), sh_push_dummy_call_fpu(), sh_push_dummy_call_nofpu(), sparc32obsd_collect_uthread(), and sparc64obsd_collect_uthread().
void write_memory_with_notification | ( | CORE_ADDR | memaddr, |
const bfd_byte * | myaddr, | ||
ssize_t | len ) |
Definition at line 370 of file corefile.c.
References current_inferior(), notify_memory_changed(), and write_memory().
Referenced by ada_value_assign(), infpy_write_memory(), mi_cmd_data_write_memory(), mi_cmd_data_write_memory_bytes(), rw_pieced_value(), and value_assign().
hook_type deprecated_exec_file_display_hook |
Definition at line 49 of file corefile.c.
Referenced by exec_file_attach(), and specify_exec_file_hook().
|
static |
Definition at line 50 of file corefile.c.
Referenced by call_extra_exec_file_hooks(), and specify_exec_file_hook().
|
static |
Definition at line 52 of file corefile.c.
Referenced by call_extra_exec_file_hooks(), and specify_exec_file_hook().
const char* gnutarget |
Definition at line 405 of file corefile.c.
Referenced by build_id_to_debug_bfd_1(), compile_object_load(), core_target_open(), darwin_get_dyld_bfd(), dwarf2_get_dwz_file(), dwz_search_other_debugdirs(), exec_file_attach(), find_separate_debug_file_in_section(), gdb_bfd_read_elf_soname(), generic_load(), jit_bfd_try_read_symtab(), locate_exec_from_corefile_build_id(), macho_check_dsym(), macho_symfile_read_all_oso(), reread_symbols(), separate_debug_file_exists(), set_gnutarget_command(), solib_bfd_fopen(), symfile_bfd_open(), try_open_dwop_file(), validate_exec_file(), and windows_xfer_shared_library().
|
static |
Definition at line 408 of file corefile.c.
Referenced by set_gnutarget(), and set_gnutarget_command().