GDB (xrefs)

Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/aarch64-linux-nat.c File Reference
`#include "defs.h"`
`#include "inferior.h"`
`#include "gdbcore.h"`
`#include "regcache.h"`
`#include "linux-nat.h"`
`#include "target-descriptions.h"`
`#include "auxv.h"`
`#include "gdbcmd.h"`
`#include "aarch64-tdep.h"`
`#include "aarch64-linux-tdep.h"`
`#include "aarch32-linux-nat.h"`
`#include "nat/aarch64-linux.h"`
`#include "nat/aarch64-linux-hw-point.h"`
`#include "elf/external.h"`
`#include "elf/common.h"`
`#include "nat/gdb_ptrace.h"`
`#include <sys/utsname.h>`
`#include <asm/ptrace.h>`
`#include "gregset.h"`
`#include "gdb_proc_service.h"`

Go to the source code of this file.

## Classes
struct | aarch64_process_info

## Macros
#define | TRAP_HWBKPT 0x0004

## Functions
static struct aarch64_process_info * | aarch64_find_process_pid (pid_t pid)
static struct aarch64_process_info * | aarch64_add_process (pid_t pid)
static struct aarch64_process_info * | aarch64_process_info_get (pid_t pid)
static void | aarch64_forget_process (pid_t pid)
struct aarch64_debug_reg_state * | aarch64_get_debug_reg_state (pid_t pid)
static void | fetch_gregs_from_thread (struct regcache *regcache)
static void | store_gregs_to_thread (const struct regcache *regcache)
static void | fetch_fpregs_from_thread (struct regcache *regcache)
static void | store_fpregs_to_thread (const struct regcache *regcache)
static void | aarch64_linux_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno)
static void | aarch64_linux_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno)
void | fill_gregset (const struct regcache *regcache, gdb_gregset_t *gregsetp, int regno)
void | supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
void | fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *fpregsetp, int regno)
void | supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
static void | aarch64_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
ps_err_e | ps_get_thread_area (struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
static void | aarch64_linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
static const struct target_desc * | aarch64_linux_read_description (struct target_ops *ops)
static int | aarch64_linux_siginfo_fixup (siginfo_t *native, gdb_byte *inf, int direction)
static int | aarch64_linux_can_use_hw_breakpoint (struct target_ops *self, enum bptype type, int cnt, int othertype)
static int | aarch64_linux_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static int | aarch64_linux_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static int | aarch64_linux_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
static int | aarch64_linux_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
static int | aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR addr, int len)
static int | aarch64_linux_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
static int | aarch64_linux_stopped_by_watchpoint (struct target_ops *ops)
static int | aarch64_linux_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, CORE_ADDR start, int length)
static int | aarch64_linux_can_do_single_step (struct target_ops *target)
static void | add_show_debug_regs_command (void)
void | _initialize_aarch64_linux_nat (void)

## Variables
static struct aarch64_process_info * | aarch64_process_list = NULL
static void(* | super_post_startup_inferior )(struct target_ops *self, ptid_t ptid)
struct target_desc * | tdesc_arm_with_neon

## Macro Definition Documentation

## ◆ TRAP_HWBKPT

#define TRAP_HWBKPT 0x0004

Definition at line 49 of file aarch64-linux-nat.c.

Referenced by aarch64_linux_stopped_data_address().

## Function Documentation

## ◆ _initialize_aarch64_linux_nat()

void _initialize_aarch64_linux_nat | ( | void |  | ) |

Definition at line 805 of file aarch64-linux-nat.c.

References aarch64_forget_process(), aarch64_linux_can_do_single_step(), aarch64_linux_can_use_hw_breakpoint(), aarch64_linux_child_post_startup_inferior(), aarch64_linux_delete_thread(), aarch64_linux_fetch_inferior_registers(), aarch64_linux_insert_hw_breakpoint(), aarch64_linux_insert_watchpoint(), aarch64_linux_new_fork(), aarch64_linux_new_thread(), aarch64_linux_prepare_to_resume(), aarch64_linux_read_description(), aarch64_linux_region_ok_for_hw_watchpoint(), aarch64_linux_remove_hw_breakpoint(), aarch64_linux_remove_watchpoint(), aarch64_linux_siginfo_fixup(), aarch64_linux_stopped_by_watchpoint(), aarch64_linux_stopped_data_address(), aarch64_linux_store_inferior_registers(), aarch64_linux_watchpoint_addr_within_range(), add_show_debug_regs_command(), linux_nat_add_target(), linux_nat_set_delete_thread(), linux_nat_set_forget_process(), linux_nat_set_new_fork(), linux_nat_set_new_thread(), linux_nat_set_prepare_to_resume(), linux_nat_set_siginfo_fixup(), linux_target(), super_post_startup_inferior, target_ops::to_can_do_single_step, target_ops::to_can_use_hw_breakpoint, target_ops::to_fetch_registers, target_ops::to_insert_hw_breakpoint, target_ops::to_insert_watchpoint, target_ops::to_post_startup_inferior, target_ops::to_read_description, target_ops::to_region_ok_for_hw_watchpoint, target_ops::to_remove_hw_breakpoint, target_ops::to_remove_watchpoint, target_ops::to_stopped_by_watchpoint, target_ops::to_stopped_data_address, target_ops::to_store_registers, and target_ops::to_watchpoint_addr_within_range.

## ◆ aarch64_add_process()

static struct aarch64_process_info* aarch64_add_process | ( | pid_t | pid | ) |
| static

Definition at line 89 of file aarch64-linux-nat.c.

References aarch64_process_list, proc::next, pid, and XCNEW.

Referenced by aarch64_process_info_get().

## ◆ aarch64_find_process_pid()

static struct aarch64_process_info* aarch64_find_process_pid | ( | pid_t | pid | ) |
| static

Definition at line 74 of file aarch64-linux-nat.c.

References aarch64_process_list, proc::next, and pid.

Referenced by aarch64_process_info_get().

## ◆ aarch64_forget_process()

static void aarch64_forget_process | ( | pid_t | pid | ) |
| static

Definition at line 121 of file aarch64-linux-nat.c.

References aarch64_process_list, proc::next, pid, and xfree().

Referenced by _initialize_aarch64_linux_nat(), and aarch64_linux_child_post_startup_inferior().

## ◆ aarch64_get_debug_reg_state()

struct aarch64_debug_reg_state* aarch64_get_debug_reg_state | ( | pid_t | pid | ) |

Definition at line 146 of file aarch64-linux-nat.c.

References aarch64_process_info_get(), pid, and aarch64_process_info::state.

Referenced by aarch64_linux_insert_hw_breakpoint(), aarch64_linux_insert_watchpoint(), aarch64_linux_new_fork(), aarch64_linux_prepare_to_resume(), aarch64_linux_remove_hw_breakpoint(), aarch64_linux_remove_watchpoint(), and aarch64_linux_stopped_data_address().

## ◆ aarch64_linux_can_do_single_step()

static int aarch64_linux_can_do_single_step | ( | struct target_ops * | target | ) |
| static

Definition at line 778 of file aarch64-linux-nat.c.

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_can_use_hw_breakpoint()

static int aarch64_linux_can_use_hw_breakpoint | ( | struct target_ops * | self,
|  | enum bptype | type,
|  | int | cnt,
|  | int | othertype
| ) |  |
| static

Definition at line 546 of file aarch64-linux-nat.c.

References aarch64_num_bp_regs, aarch64_num_wp_regs, bp_access_watchpoint, bp_hardware_breakpoint, bp_hardware_watchpoint, bp_read_watchpoint, bp_watchpoint, and gdb_assert_not_reached.

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_child_post_startup_inferior()

static void aarch64_linux_child_post_startup_inferior | ( | struct target_ops * | self,
|  | ptid_t | ptid
| ) |  |
| static

Definition at line 476 of file aarch64-linux-nat.c.

References aarch64_forget_process(), aarch64_linux_get_debug_reg_capacity(), ptid_get_pid(), and super_post_startup_inferior.

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_fetch_inferior_registers()

static void aarch64_linux_fetch_inferior_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regno
| ) |  |
| static

Definition at line 348 of file aarch64-linux-nat.c.

References AARCH64_V0_REGNUM, fetch_fpregs_from_thread(), and fetch_gregs_from_thread().

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_insert_hw_breakpoint()

static int aarch64_linux_insert_hw_breakpoint | ( | struct target_ops * | self,
|  | struct gdbarch * | gdbarch,
|  | struct bp_target_info * | bp_tgt
| ) |  |
| static

Definition at line 577 of file aarch64-linux-nat.c.

References aarch64_get_debug_reg_state(), aarch64_handle_breakpoint(), aarch64_show_debug_reg_state(), fprintf_unfiltered(), gdb_stdlog, gdbarch_breakpoint_from_pc(), hw_execute, inferior_ptid, bp_target_info::placed_address, ptid_get_pid(), bp_target_info::reqstd_address, and show_debug_regs.

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_insert_watchpoint()

static int aarch64_linux_insert_watchpoint | ( | struct target_ops * | self,
|  | CORE_ADDR | addr,
|  | int | len,
|  | enum target_hw_bp_type | type,
|  | struct expression * | cond
| ) |  |
| static

Definition at line 647 of file aarch64-linux-nat.c.

References aarch64_get_debug_reg_state(), aarch64_handle_watchpoint(), aarch64_show_debug_reg_state(), fprintf_unfiltered(), gdb_assert, gdb_stdlog, hw_execute, inferior_ptid, ptid_get_pid(), and show_debug_regs.

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_new_fork()

static void aarch64_linux_new_fork | ( | struct lwp_info * | parent,
|  | pid_t | child_pid
| ) |  |
| static

Definition at line 432 of file aarch64-linux-nat.c.

References aarch64_get_debug_reg_state(), lwp_info::arch_private, lwp_info::ptid, and ptid_get_pid().

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_read_description()

static const struct target_desc* aarch64_linux_read_description | ( | struct target_ops * | ops | ) |
| static

Definition at line 489 of file aarch64-linux-nat.c.

References aarch64_read_description(), inferior_ptid, ptid_get_lwp(), ptrace(), PTRACE_GETREGSET, tdesc_arm_with_neon, selftests::ptid::tid, and VFP_REGS_SIZE.

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_region_ok_for_hw_watchpoint()

static int aarch64_linux_region_ok_for_hw_watchpoint | ( | struct target_ops * | self,
|  | CORE_ADDR | addr,
|  | int | len
| ) |  |
| static

Definition at line 710 of file aarch64-linux-nat.c.

References aarch64_linux_region_ok_for_watchpoint().

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_remove_hw_breakpoint()

static int aarch64_linux_remove_hw_breakpoint | ( | struct target_ops * | self,
|  | struct gdbarch * | gdbarch,
|  | struct bp_target_info * | bp_tgt
| ) |  |
| static

Definition at line 611 of file aarch64-linux-nat.c.

References aarch64_get_debug_reg_state(), aarch64_handle_breakpoint(), aarch64_show_debug_reg_state(), fprintf_unfiltered(), gdb_stdlog, gdbarch_breakpoint_from_pc(), hw_execute, inferior_ptid, bp_target_info::placed_address, ptid_get_pid(), and show_debug_regs.

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_remove_watchpoint()

static int aarch64_linux_remove_watchpoint | ( | struct target_ops * | self,
|  | CORE_ADDR | addr,
|  | int | len,
|  | enum target_hw_bp_type | type,
|  | struct expression * | cond
| ) |  |
| static

Definition at line 680 of file aarch64-linux-nat.c.

References aarch64_get_debug_reg_state(), aarch64_handle_watchpoint(), aarch64_show_debug_reg_state(), fprintf_unfiltered(), gdb_assert, gdb_stdlog, hw_execute, inferior_ptid, ptid_get_pid(), and show_debug_regs.

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_siginfo_fixup()

static int aarch64_linux_siginfo_fixup | ( | siginfo_t * | native,
|  | gdb_byte * | inf,
|  | int | direction
| ) |  |
| static

Definition at line 514 of file aarch64-linux-nat.c.

References aarch64_compat_siginfo_from_siginfo(), aarch64_siginfo_from_compat_siginfo(), gdbarch_bfd_arch_info(), get_current_frame(), and get_frame_arch().

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_stopped_by_watchpoint()

static int aarch64_linux_stopped_by_watchpoint | ( | struct target_ops * | ops | ) |
| static

Definition at line 758 of file aarch64-linux-nat.c.

References aarch64_linux_stopped_data_address().

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_stopped_data_address()

static int aarch64_linux_stopped_data_address | ( | struct target_ops * | target,
|  | CORE_ADDR * | addr_p
| ) |  |
| static

Definition at line 719 of file aarch64-linux-nat.c.

References aarch64_get_debug_reg_state(), aarch64_num_wp_regs, aarch64_watchpoint_length(), 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, if(), inferior_ptid, linux_nat_get_siginfo(), ptid_get_pid(), selftests::ptid::tid, and TRAP_HWBKPT.

Referenced by _initialize_aarch64_linux_nat(), and aarch64_linux_stopped_by_watchpoint().

## ◆ aarch64_linux_store_inferior_registers()

static void aarch64_linux_store_inferior_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regno
| ) |  |
| static

Definition at line 366 of file aarch64-linux-nat.c.

References AARCH64_V0_REGNUM, store_fpregs_to_thread(), and store_gregs_to_thread().

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_linux_watchpoint_addr_within_range()

static int aarch64_linux_watchpoint_addr_within_range | ( | struct target_ops * | target,
|  | CORE_ADDR | addr,
|  | CORE_ADDR | start,
|  | int | length
| ) |  |
| static

Definition at line 768 of file aarch64-linux-nat.c.

Referenced by _initialize_aarch64_linux_nat().

## ◆ aarch64_process_info_get()

static struct aarch64_process_info* aarch64_process_info_get | ( | pid_t | pid | ) |
| static

Definition at line 106 of file aarch64-linux-nat.c.

References aarch64_add_process(), aarch64_find_process_pid(), and pid.

Referenced by aarch64_get_debug_reg_state().

## ◆ add_show_debug_regs_command()

static void add_show_debug_regs_command | ( | void |  | ) |
| static

Definition at line 786 of file aarch64-linux-nat.c.

References _, add_setshow_boolean_cmd(), class_maintenance, maintenance_set_cmdlist, maintenance_show_cmdlist, and show_debug_regs.

Referenced by _initialize_aarch64_linux_nat().

## ◆ fetch_fpregs_from_thread()

static void fetch_fpregs_from_thread | ( | struct regcache * | regcache | ) |
| static

Definition at line 236 of file aarch64-linux-nat.c.

References _, aarch32_vfp_regcache_supply(), AARCH64_FPCR_REGNUM, AARCH64_FPSR_REGNUM, AARCH64_V0_REGNUM, AARCH64_V31_REGNUM, regcache::arch(), gdb_static_assert, gdbarch_bfd_arch_info(), perror_with_name(), ptid_get_lwp(), ptrace(), PTRACE_GETREGSET, regcache_get_ptid(), regcache_raw_supply(), selftests::ptid::tid, and VFP_REGS_SIZE.

Referenced by aarch64_linux_fetch_inferior_registers().

## ◆ fetch_gregs_from_thread()

static void fetch_gregs_from_thread | ( | struct regcache * | regcache | ) |
| static

Definition at line 155 of file aarch64-linux-nat.c.

References _, aarch32_gp_regcache_supply(), AARCH64_CPSR_REGNUM, AARCH64_X0_REGNUM, regcache::arch(), gdb_static_assert, gdbarch_bfd_arch_info(), perror_with_name(), ptid_get_lwp(), ptrace(), PTRACE_GETREGSET, regcache_get_ptid(), regcache_raw_supply(), and selftests::ptid::tid.

Referenced by aarch64_linux_fetch_inferior_registers().

## ◆ fill_fpregset()

void fill_fpregset | ( | const struct regcache * | regcache,
|  | gdb_fpregset_t * | fpregsetp,
|  | int | regno
| ) |  |

Definition at line 410 of file aarch64-linux-nat.c.

Referenced by procfs_do_thread_registers(), procfs_store_registers(), ps_lgetfpregs(), and sol_thread_store_registers().

## ◆ fill_gregset()

void fill_gregset | ( | const struct regcache * | regcache,
|  | gdb_gregset_t * | gregsetp,
|  | int | regno
| ) |  |

Definition at line 386 of file aarch64-linux-nat.c.

Referenced by procfs_do_thread_registers(), procfs_make_note_section(), procfs_store_registers(), ps_lgetregs(), and sol_thread_store_registers().

## ◆ ps_get_thread_area()

ps_err_e ps_get_thread_area | ( | struct ps_prochandle * | ph,
|  | lwpid_t | lwpid,
|  | int | idx,
|  | void ** | base
| ) |  |

Definition at line 460 of file aarch64-linux-nat.c.

## ◆ store_fpregs_to_thread()

static void store_fpregs_to_thread | ( | const struct regcache * | regcache | ) |
| static

Definition at line 284 of file aarch64-linux-nat.c.

References _, aarch32_vfp_regcache_collect(), AARCH64_FPCR_REGNUM, AARCH64_FPSR_REGNUM, AARCH64_V0_REGNUM, AARCH64_V31_REGNUM, regcache::arch(), gdb_static_assert, gdbarch_bfd_arch_info(), perror_with_name(), ptid_get_lwp(), ptrace(), PTRACE_GETREGSET, PTRACE_SETREGSET, REG_VALID, regcache_get_ptid(), regcache_raw_collect(), regcache_register_status(), selftests::ptid::tid, and VFP_REGS_SIZE.

Referenced by aarch64_linux_store_inferior_registers().

## ◆ store_gregs_to_thread()

static void store_gregs_to_thread | ( | const struct regcache * | regcache | ) |
| static

Definition at line 193 of file aarch64-linux-nat.c.

References _, aarch32_gp_regcache_collect(), AARCH64_CPSR_REGNUM, AARCH64_X0_REGNUM, regcache::arch(), gdb_static_assert, gdbarch_bfd_arch_info(), perror_with_name(), ptid_get_lwp(), ptrace(), PTRACE_GETREGSET, PTRACE_SETREGSET, REG_VALID, regcache_get_ptid(), regcache_raw_collect(), regcache_register_status(), and selftests::ptid::tid.

Referenced by aarch64_linux_store_inferior_registers().

## ◆ supply_fpregset()

void supply_fpregset | ( | struct regcache * | regcache,
|  | const gdb_fpregset_t * | fpregsetp
| ) |  |

Definition at line 422 of file aarch64-linux-nat.c.

Referenced by procfs_fetch_registers(), ps_lsetfpregs(), and sol_thread_fetch_registers().

## ◆ supply_gregset()

void supply_gregset | ( | struct regcache * | regcache,
|  | const gdb_gregset_t * | gregsetp
| ) |  |

Definition at line 398 of file aarch64-linux-nat.c.

Referenced by procfs_fetch_registers(), ps_lsetregs(), and sol_thread_fetch_registers().

## Variable Documentation

## ◆ aarch64_process_list

struct aarch64_process_info* aarch64_process_list = NULL
| static

Definition at line 69 of file aarch64-linux-nat.c.

Referenced by aarch64_add_process(), aarch64_find_process_pid(), and aarch64_forget_process().

## ◆ super_post_startup_inferior

void(* super_post_startup_inferior) (struct target_ops *self, ptid_t ptid)
| static

Definition at line 470 of file aarch64-linux-nat.c.

Referenced by _initialize_aarch64_linux_nat(), and aarch64_linux_child_post_startup_inferior().

## ◆ tdesc_arm_with_neon

struct target_desc* tdesc_arm_with_neon

Definition at line 8 of file arm-with-neon.c.

Referenced by aarch64_linux_read_description(), arm_fbsd_read_description_auxv(), arm_linux_core_read_description(), and arm_linux_read_description().