GDBserver
|
#include "server.h"
#include "linux-low.h"
#include "elf/common.h"
#include <signal.h>
#include <sys/user.h>
#include <sys/ptrace.h>
#include <asm/ptrace.h>
#include <sys/uio.h>
#include "gdb_proc_service.h"
Go to the source code of this file.
Classes | |
struct | aarch64_debug_reg_state |
struct | arch_process_info |
struct | arch_lwp_info |
struct | aarch64_dr_update_callback_param |
Typedefs | |
typedef unsigned long long | dr_changed_t |
Variables | |
const struct target_desc * | tdesc_aarch64 |
static int | aarch64_regmap [] |
static int | aarch64_num_bp_regs |
static int | aarch64_num_wp_regs |
int | debug_threads |
static const gdb_byte | aarch64_breakpoint [] = {0x00, 0x00, 0x20, 0xd4} |
static struct regset_info | aarch64_regsets [] |
static struct regsets_info | aarch64_regsets_info |
static struct usrregs_info | aarch64_usrregs_info |
static struct regs_info | regs_info |
struct linux_target_ops | the_low_target |
#define aarch64_breakpoint_len 4 |
Definition at line 298 of file linux-aarch64-low.c.
Referenced by aarch64_breakpoint_at().
#define AARCH64_CPSR_REGNO 33 |
Definition at line 47 of file linux-aarch64-low.c.
Referenced by aarch64_fill_gregset(), and aarch64_store_gregset().
#define AARCH64_DEBUG_ARCH | ( | x | ) | (((x) >> 8) & 0xff) |
Definition at line 1212 of file linux-aarch64-low.c.
Referenced by aarch64_arch_setup().
#define AARCH64_DEBUG_ARCH_V8 0x6 |
Definition at line 1213 of file linux-aarch64-low.c.
Referenced by aarch64_arch_setup().
#define AARCH64_DEBUG_NUM_SLOTS | ( | x | ) | ((x) & 0xff) |
Definition at line 1211 of file linux-aarch64-low.c.
Referenced by aarch64_arch_setup().
#define AARCH64_FPCR_REGNO (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 1) |
Definition at line 50 of file linux-aarch64-low.c.
Referenced by aarch64_fill_fpregset(), and aarch64_store_fpregset().
#define AARCH64_FPSR_REGNO (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM) |
Definition at line 49 of file linux-aarch64-low.c.
Referenced by aarch64_fill_fpregset(), and aarch64_store_fpregset().
#define AARCH64_HBP_ALIGNMENT 4 |
Definition at line 106 of file linux-aarch64-low.c.
Referenced by aarch64_point_is_aligned().
#define AARCH64_HBP_MAX_NUM 16 |
Definition at line 89 of file linux-aarch64-low.c.
Referenced by aarch64_arch_setup(), and aarch64_init_debug_reg_state().
#define AARCH64_HWP_ALIGNMENT 8 |
Definition at line 107 of file linux-aarch64-low.c.
Referenced by aarch64_align_watchpoint(), and aarch64_point_is_aligned().
#define AARCH64_HWP_MAX_LEN_PER_REG 8 |
Definition at line 112 of file linux-aarch64-low.c.
Referenced by aarch64_align_watchpoint().
#define AARCH64_HWP_MAX_NUM 16 |
Definition at line 90 of file linux-aarch64-low.c.
Referenced by aarch64_arch_setup(), and aarch64_init_debug_reg_state().
#define AARCH64_NUM_REGS (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 2) |
Definition at line 52 of file linux-aarch64-low.c.
Referenced by aarch64_cannot_fetch_register(), and aarch64_cannot_store_register().
#define AARCH64_PC_REGNO 32 |
Definition at line 46 of file linux-aarch64-low.c.
Referenced by aarch64_fill_gregset(), and aarch64_store_gregset().
#define AARCH64_SP_REGNO 31 |
Definition at line 45 of file linux-aarch64-low.c.
Referenced by aarch64_fill_gregset(), and aarch64_store_gregset().
#define AARCH64_V0_REGNO 34 |
Definition at line 48 of file linux-aarch64-low.c.
Referenced by aarch64_fill_fpregset(), and aarch64_store_fpregset().
#define AARCH64_V_REGS_NUM 32 |
Definition at line 43 of file linux-aarch64-low.c.
Referenced by aarch64_fill_fpregset(), and aarch64_store_fpregset().
#define AARCH64_X0_REGNO 0 |
Definition at line 44 of file linux-aarch64-low.c.
Referenced by aarch64_fill_gregset(), and aarch64_store_gregset().
#define AARCH64_X_REGS_NUM 31 |
Definition at line 42 of file linux-aarch64-low.c.
Referenced by aarch64_fill_gregset(), and aarch64_store_gregset().
#define DR_CLEAR_CHANGED | ( | x | ) |
Definition at line 150 of file linux-aarch64-low.c.
Referenced by aarch64_linux_prepare_to_resume().
#define DR_CONTROL_ENABLED | ( | ctrl | ) | (((ctrl) & 0x1) == 1) |
Definition at line 381 of file linux-aarch64-low.c.
Referenced by aarch64_stopped_data_address().
#define DR_CONTROL_LENGTH | ( | ctrl | ) | (((ctrl) >> 5) & 0xff) |
Definition at line 382 of file linux-aarch64-low.c.
Referenced by aarch64_watchpoint_length().
#define DR_HAS_CHANGED | ( | x | ) | ((x) != 0) |
Definition at line 156 of file linux-aarch64-low.c.
Referenced by aarch64_linux_prepare_to_resume().
#define DR_MARK_ALL_CHANGED | ( | x, | |
m | |||
) |
Definition at line 137 of file linux-aarch64-low.c.
Referenced by aarch64_linux_new_thread().
#define DR_MARK_N_CHANGED | ( | x, | |
n | |||
) |
Definition at line 144 of file linux-aarch64-low.c.
Referenced by debug_reg_change_callback().
#define DR_N_HAS_CHANGED | ( | x, | |
n | |||
) | ((x) & ((dr_changed_t)1 << (n))) |
Definition at line 157 of file linux-aarch64-low.c.
typedef unsigned long long dr_changed_t |
Definition at line 133 of file linux-aarch64-low.c.
|
static |
Definition at line 515 of file linux-aarch64-low.c.
References AARCH64_HWP_ALIGNMENT, AARCH64_HWP_MAX_LEN_PER_REG, gdb_assert, and offset.
Referenced by aarch64_handle_unaligned_watchpoint().
|
static |
Definition at line 1216 of file linux-aarch64-low.c.
References AARCH64_DEBUG_ARCH, AARCH64_DEBUG_ARCH_V8, AARCH64_DEBUG_NUM_SLOTS, AARCH64_HBP_MAX_NUM, AARCH64_HWP_MAX_NUM, aarch64_num_bp_regs, aarch64_num_wp_regs, current_process(), current_thread, lwpid_of, PTRACE_GETREGSET, process_info::tdesc, tdesc_aarch64, and warning().
|
static |
Definition at line 306 of file linux-aarch64-low.c.
References aarch64_breakpoint, aarch64_breakpoint_len, target_ops::read_memory, and the_target.
|
static |
Definition at line 221 of file linux-aarch64-low.c.
References AARCH64_NUM_REGS.
|
static |
Definition at line 215 of file linux-aarch64-low.c.
References AARCH64_NUM_REGS.
|
static |
Definition at line 733 of file linux-aarch64-low.c.
References aarch64_notify_debug_reg_change(), aarch64_num_bp_regs, aarch64_num_wp_regs, aarch64_point_encode_ctrl_reg(), aarch64_point_is_aligned(), aarch64_debug_reg_state::dr_addr_bp, aarch64_debug_reg_state::dr_addr_wp, aarch64_debug_reg_state::dr_ctrl_bp, aarch64_debug_reg_state::dr_ctrl_wp, aarch64_debug_reg_state::dr_ref_count_bp, aarch64_debug_reg_state::dr_ref_count_wp, gdb_assert, and hw_execute.
Referenced by aarch64_handle_aligned_watchpoint(), aarch64_handle_breakpoint(), and aarch64_handle_unaligned_watchpoint().
|
static |
Definition at line 806 of file linux-aarch64-low.c.
References aarch64_notify_debug_reg_change(), aarch64_num_bp_regs, aarch64_num_wp_regs, aarch64_point_encode_ctrl_reg(), aarch64_point_is_aligned(), aarch64_debug_reg_state::dr_addr_bp, aarch64_debug_reg_state::dr_addr_wp, aarch64_debug_reg_state::dr_ctrl_bp, aarch64_debug_reg_state::dr_ctrl_wp, aarch64_debug_reg_state::dr_ref_count_bp, aarch64_debug_reg_state::dr_ref_count_wp, gdb_assert, and hw_execute.
Referenced by aarch64_handle_aligned_watchpoint(), aarch64_handle_breakpoint(), and aarch64_handle_unaligned_watchpoint().
|
static |
Definition at line 253 of file linux-aarch64-low.c.
References AARCH64_FPCR_REGNO, AARCH64_FPSR_REGNO, AARCH64_V0_REGNO, AARCH64_V_REGS_NUM, and collect_register().
|
static |
Definition at line 227 of file linux-aarch64-low.c.
References AARCH64_CPSR_REGNO, AARCH64_PC_REGNO, AARCH64_SP_REGNO, AARCH64_X0_REGNO, AARCH64_X_REGS_NUM, and collect_register().
|
static |
Definition at line 721 of file linux-aarch64-low.c.
References process_info_private::arch_private, current_process(), arch_process_info::debug_reg_state, and process_info::priv.
Referenced by aarch64_handle_aligned_watchpoint(), aarch64_handle_breakpoint(), aarch64_handle_unaligned_watchpoint(), aarch64_insert_point(), aarch64_remove_point(), and aarch64_stopped_data_address().
Definition at line 281 of file linux-aarch64-low.c.
References collect_register_by_name(), debug_printf(), and debug_threads.
|
static |
Definition at line 883 of file linux-aarch64-low.c.
References aarch64_dr_state_insert_one_point(), aarch64_dr_state_remove_one_point(), and aarch64_get_debug_reg_state().
Referenced by aarch64_handle_watchpoint().
|
static |
Definition at line 861 of file linux-aarch64-low.c.
References aarch64_dr_state_insert_one_point(), aarch64_dr_state_remove_one_point(), aarch64_get_debug_reg_state(), and aarch64_point_is_aligned().
Referenced by aarch64_insert_point(), and aarch64_remove_point().
|
static |
Definition at line 904 of file linux-aarch64-low.c.
References aarch64_align_watchpoint(), aarch64_dr_state_insert_one_point(), aarch64_dr_state_remove_one_point(), aarch64_get_debug_reg_state(), paddress(), and show_debug_regs.
Referenced by aarch64_handle_watchpoint().
|
static |
Definition at line 941 of file linux-aarch64-low.c.
References aarch64_handle_aligned_watchpoint(), aarch64_handle_unaligned_watchpoint(), and aarch64_point_is_aligned().
Referenced by aarch64_insert_point(), and aarch64_remove_point().
|
static |
Definition at line 353 of file linux-aarch64-low.c.
References AARCH64_HBP_MAX_NUM, AARCH64_HWP_MAX_NUM, aarch64_debug_reg_state::dr_addr_bp, aarch64_debug_reg_state::dr_addr_wp, aarch64_debug_reg_state::dr_ctrl_bp, aarch64_debug_reg_state::dr_ctrl_wp, aarch64_debug_reg_state::dr_ref_count_bp, and aarch64_debug_reg_state::dr_ref_count_wp.
Referenced by aarch64_linux_new_process().
|
static |
Definition at line 975 of file linux-aarch64-low.c.
References aarch64_get_debug_reg_state(), aarch64_handle_breakpoint(), aarch64_handle_watchpoint(), aarch64_show_debug_reg_state(), hw_execute, raw_bkpt_type_to_target_hw_bp_type(), and show_debug_regs.
|
static |
Definition at line 1141 of file linux-aarch64-low.c.
References process_info_private::arch_private, gdb_assert, and process_info::priv.
|
static |
Definition at line 1115 of file linux-aarch64-low.c.
References aarch64_init_debug_reg_state(), arch_process_info::debug_reg_state, and xcalloc().
|
static |
Definition at line 1127 of file linux-aarch64-low.c.
References aarch64_num_bp_regs, aarch64_num_wp_regs, lwp_info::arch_private, arch_lwp_info::dr_changed_bp, arch_lwp_info::dr_changed_wp, DR_MARK_ALL_CHANGED, and xcalloc().
|
static |
Definition at line 1171 of file linux-aarch64-low.c.
References aarch64_linux_set_debug_regs(), process_info_private::arch_private, lwp_info::arch_private, arch_process_info::debug_reg_state, arch_lwp_info::dr_changed_bp, arch_lwp_info::dr_changed_wp, DR_CLEAR_CHANGED, DR_HAS_CHANGED, find_process_pid(), get_lwp_thread, lwpid_of, process_info::priv, ptid_get_lwp(), ptid_get_pid(), ptid_of, and show_debug_regs.
|
static |
Definition at line 576 of file linux-aarch64-low.c.
References _, aarch64_num_bp_regs, aarch64_num_wp_regs, aarch64_debug_reg_state::dr_addr_bp, aarch64_debug_reg_state::dr_addr_wp, aarch64_debug_reg_state::dr_ctrl_bp, aarch64_debug_reg_state::dr_ctrl_wp, error(), and PTRACE_SETREGSET.
Referenced by aarch64_linux_prepare_to_resume().
void aarch64_notify_debug_reg_change | ( | const struct aarch64_debug_reg_state * | state, |
int | is_watchpoint, | ||
unsigned int | idx | ||
) |
Definition at line 702 of file linux-aarch64-low.c.
References all_threads, current_thread, debug_reg_change_callback(), find_inferior(), aarch64_dr_update_callback_param::idx, aarch64_dr_update_callback_param::is_watchpoint, aarch64_dr_update_callback_param::pid, and pid_of.
Referenced by aarch64_dr_state_insert_one_point(), and aarch64_dr_state_remove_one_point().
|
static |
Definition at line 414 of file linux-aarch64-low.c.
References _, hw_access, hw_execute, hw_read, hw_write, and perror_with_name().
Referenced by aarch64_dr_state_insert_one_point(), and aarch64_dr_state_remove_one_point().
|
static |
Definition at line 461 of file linux-aarch64-low.c.
References AARCH64_HBP_ALIGNMENT, and AARCH64_HWP_ALIGNMENT.
Referenced by aarch64_dr_state_insert_one_point(), aarch64_dr_state_remove_one_point(), aarch64_handle_breakpoint(), and aarch64_handle_watchpoint().
|
static |
Definition at line 1302 of file linux-aarch64-low.c.
References regs_info.
|
static |
Definition at line 1011 of file linux-aarch64-low.c.
References aarch64_get_debug_reg_state(), aarch64_handle_breakpoint(), aarch64_handle_watchpoint(), aarch64_show_debug_reg_state(), hw_execute, raw_bkpt_type_to_target_hw_bp_type(), and show_debug_regs.
Definition at line 292 of file linux-aarch64-low.c.
References supply_register_by_name().
|
static |
Definition at line 322 of file linux-aarch64-low.c.
References aarch64_num_bp_regs, aarch64_num_wp_regs, aarch64_debug_reg_state::dr_addr_bp, aarch64_debug_reg_state::dr_addr_wp, aarch64_debug_reg_state::dr_ctrl_bp, aarch64_debug_reg_state::dr_ctrl_wp, aarch64_debug_reg_state::dr_ref_count_bp, aarch64_debug_reg_state::dr_ref_count_wp, hw_access, hw_execute, hw_read, hw_write, and paddress().
Referenced by aarch64_insert_point(), and aarch64_remove_point().
|
static |
Definition at line 1081 of file linux-aarch64-low.c.
References aarch64_stopped_data_address().
|
static |
Definition at line 1043 of file linux-aarch64-low.c.
References aarch64_get_debug_reg_state(), aarch64_num_wp_regs, aarch64_watchpoint_length(), current_thread, aarch64_debug_reg_state::dr_addr_wp, DR_CONTROL_ENABLED, aarch64_debug_reg_state::dr_ctrl_wp, aarch64_debug_reg_state::dr_ref_count_wp, lwpid_of, and PTRACE_GETSIGINFO.
Referenced by aarch64_stopped_by_watchpoint().
|
static |
Definition at line 265 of file linux-aarch64-low.c.
References AARCH64_FPCR_REGNO, AARCH64_FPSR_REGNO, AARCH64_V0_REGNO, AARCH64_V_REGS_NUM, and supply_register().
|
static |
Definition at line 240 of file linux-aarch64-low.c.
References AARCH64_CPSR_REGNO, AARCH64_PC_REGNO, AARCH64_SP_REGNO, AARCH64_X0_REGNO, AARCH64_X_REGS_NUM, and supply_register().
|
static |
Definition at line 951 of file linux-aarch64-low.c.
References Z_PACKET_ACCESS_WP, Z_PACKET_HW_BP, Z_PACKET_READ_WP, Z_PACKET_SW_BP, and Z_PACKET_WRITE_WP.
|
inlinestatic |
Definition at line 392 of file linux-aarch64-low.c.
References DR_CONTROL_LENGTH.
Referenced by aarch64_stopped_data_address().
|
static |
Definition at line 621 of file linux-aarch64-low.c.
References aarch64_num_bp_regs, aarch64_num_wp_regs, lwp_info::arch_private, arch_lwp_info::dr_changed_bp, arch_lwp_info::dr_changed_wp, DR_MARK_N_CHANGED, gdb_assert, get_thread_lwp, aarch64_dr_update_callback_param::idx, aarch64_dr_update_callback_param::is_watchpoint, linux_stop_lwp(), lwpid_of, aarch64_dr_update_callback_param::pid, pid_of, show_debug_regs, and lwp_info::stopped.
Referenced by aarch64_notify_debug_reg_change().
void init_registers_aarch64 | ( | void | ) |
Referenced by initialize_low_arch().
void initialize_low_arch | ( | void | ) |
Definition at line 1336 of file linux-aarch64-low.c.
Referenced by initialize_low().
ps_err_e ps_get_thread_area | ( | const struct ps_prochandle * | ph, |
lwpid_t | lwpid, | ||
int | idx, | ||
void ** | base | ||
) |
Definition at line 1092 of file linux-aarch64-low.c.
References PS_ERR, PS_OK, and PTRACE_GETREGSET.
|
static |
Definition at line 303 of file linux-aarch64-low.c.
Referenced by aarch64_breakpoint_at().
|
static |
Definition at line 211 of file linux-aarch64-low.c.
Referenced by aarch64_arch_setup(), aarch64_dr_state_insert_one_point(), aarch64_dr_state_remove_one_point(), aarch64_linux_new_thread(), aarch64_linux_set_debug_regs(), aarch64_show_debug_reg_state(), and debug_reg_change_callback().
|
static |
Definition at line 212 of file linux-aarch64-low.c.
Referenced by aarch64_arch_setup(), aarch64_dr_state_insert_one_point(), aarch64_dr_state_remove_one_point(), aarch64_linux_new_thread(), aarch64_linux_set_debug_regs(), aarch64_show_debug_reg_state(), aarch64_stopped_data_address(), and debug_reg_change_callback().
|
static |
Definition at line 55 of file linux-aarch64-low.c.
|
static |
Definition at line 1269 of file linux-aarch64-low.c.
|
static |
Definition at line 1281 of file linux-aarch64-low.c.
|
static |
Definition at line 1288 of file linux-aarch64-low.c.
int debug_threads |
Definition at line 24 of file debug.c.
Referenced by aarch64_get_pc().
Definition at line 1294 of file linux-aarch64-low.c.
Referenced by aarch64_regs_info().
const struct target_desc* tdesc_aarch64 |
Referenced by aarch64_arch_setup().
struct linux_target_ops the_low_target |
Definition at line 1307 of file linux-aarch64-low.c.
Referenced by add_lwp(), can_hardware_single_step(), check_stopped_by_breakpoint(), check_stopped_by_watchpoint(), child_add_thread(), child_fetch_inferior_registers(), child_store_inferior_registers(), do_attach(), do_initial_child_stuff(), get_pc(), handle_extended_wait(), initialize_low(), linux_add_process(), linux_detach_one_lwp(), linux_emit_ops(), linux_fast_tracepoint_collecting(), linux_fetch_registers(), linux_get_min_fast_tracepoint_insn_len(), linux_insert_point(), linux_install_fast_tracepoint_jump_pad(), linux_low_filter_event(), linux_process_qsupported(), linux_read_pc(), linux_remove_point(), linux_resume_one_lwp_throw(), linux_store_registers(), linux_supports_range_stepping(), linux_supports_tracepoints(), linux_supports_z_point_type(), linux_wait_1(), linux_write_pc(), maybe_move_out_of_jump_pad(), nto_fetch_registers(), nto_store_registers(), siginfo_fixup(), start_step_over(), supports_breakpoints(), supports_fast_tracepoints(), thread_still_has_status_pending_p(), win32_get_thread_context(), win32_insert_point(), win32_prepare_to_resume(), win32_remove_point(), win32_resume(), win32_stopped_by_watchpoint(), win32_stopped_data_address(), and win32_supports_z_point_type().