GDB (xrefs)

Macros | Functions | Variables
/tmp/gdb-8.1/gdb/ia64-linux-nat.c File Reference
`#include "defs.h"`
`#include "inferior.h"`
`#include "target.h"`
`#include "gdbcore.h"`
`#include "regcache.h"`
`#include "ia64-tdep.h"`
`#include "linux-nat.h"`
`#include <signal.h>`
`#include "nat/gdb_ptrace.h"`
`#include "gdb_wait.h"`
`#include <sys/reg.h>`
`#include <sys/syscall.h>`
`#include <sys/user.h>`
`#include <asm/ptrace_offsets.h>`
`#include <sys/procfs.h>`
`#include "gregset.h"`
`#include "inf-ptrace.h"`

Go to the source code of this file.

## Macros
#define | COPY_REG(_idx_, _regi_)
#define | IA64_PSR_DB (1UL << 24)
#define | IA64_PSR_DD (1UL << 39)

## Functions
static CORE_ADDR | ia64_register_addr (struct gdbarch *gdbarch, int regno)
static int | ia64_cannot_fetch_register (struct gdbarch *gdbarch, int regno)
static int | ia64_cannot_store_register (struct gdbarch *gdbarch, int regno)
void | supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
void | fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
void | supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
void | fill_fpregset (const struct regcache *regcache, fpregset_t *fpregsetp, int regno)
static void | enable_watchpoints_in_psr (ptid_t ptid)
static void | store_debug_register (ptid_t ptid, int idx, long val)
static void | store_debug_register_pair (ptid_t ptid, int idx, long *dbr_addr, long *dbr_mask)
static int | is_power_of_2 (int val)
static int | ia64_linux_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
static int | ia64_linux_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
static void | ia64_linux_new_thread (struct lwp_info *lp)
static int | ia64_linux_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
static int | ia64_linux_stopped_by_watchpoint (struct target_ops *ops)
static int | ia64_linux_can_use_hw_breakpoint (struct target_ops *self, enum bptype type, int cnt, int othertype)
static void | ia64_linux_fetch_register (struct regcache *regcache, int regnum)
static void | ia64_linux_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
static void | ia64_linux_store_register (const struct regcache *regcache, int regnum)
static void | ia64_linux_store_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
static enum target_xfer_status | ia64_linux_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
static int | ia64_linux_status_is_event (int status)
void | _initialize_ia64_linux_nat (void)

## Variables
static int | u_offsets []
static long | debug_registers [8]
static target_xfer_partial_ftype * | super_xfer_partial

## Macro Definition Documentation

## ◆ COPY_REG

#define COPY_REG | ( |  | _idx_,
|  |  | _regi_
| ) |  |

Value:
if ((regno == -1) || regno == _regi_) \
regcache_raw_collect (regcache, _regi_, regp + _idx_)
regcache
Definition: regcache.h:232

Referenced by fill_gregset().

## ◆ IA64_PSR_DB

#define IA64_PSR_DB (1UL << 24)

Definition at line 490 of file ia64-linux-nat.c.

Referenced by enable_watchpoints_in_psr().

## ◆ IA64_PSR_DD

#define IA64_PSR_DD (1UL << 39)

Definition at line 491 of file ia64-linux-nat.c.

Referenced by ia64_linux_stopped_data_address().

## Function Documentation

## ◆ _initialize_ia64_linux_nat()

void _initialize_ia64_linux_nat | ( | void |  | ) |

Definition at line 895 of file ia64-linux-nat.c.

References ia64_linux_can_use_hw_breakpoint(), ia64_linux_fetch_registers(), ia64_linux_insert_watchpoint(), ia64_linux_new_thread(), ia64_linux_remove_watchpoint(), ia64_linux_status_is_event(), ia64_linux_stopped_by_watchpoint(), ia64_linux_stopped_data_address(), ia64_linux_store_registers(), ia64_linux_xfer_partial(), linux_nat_add_target(), linux_nat_set_new_thread(), linux_nat_set_status_is_event(), linux_target(), super_xfer_partial, target_ops::to_can_use_hw_breakpoint, target_ops::to_fetch_registers, target_ops::to_have_steppable_watchpoint, target_ops::to_insert_watchpoint, 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_xfer_partial.

## ◆ enable_watchpoints_in_psr()

static void enable_watchpoints_in_psr | ( | ptid_t | ptid | ) |
| static

Definition at line 494 of file ia64-linux-nat.c.

References get_thread_regcache(), IA64_PSR_DB, IA64_PSR_REGNUM, regcache::ptid(), regcache_cooked_read_unsigned(), and regcache_cooked_write_unsigned().

Referenced by ia64_linux_insert_watchpoint(), and ia64_linux_new_thread().

## ◆ fill_fpregset()

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

Definition at line 477 of file ia64-linux-nat.c.

References IA64_FR0_REGNUM, IA64_FR127_REGNUM, and regcache_raw_collect().

## ◆ fill_gregset()

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

Definition at line 404 of file ia64-linux-nat.c.

References COPY_REG, IA64_BR0_REGNUM, IA64_BR7_REGNUM, IA64_BSP_REGNUM, IA64_BSPSTORE_REGNUM, IA64_CCV_REGNUM, IA64_CFM_REGNUM, IA64_EC_REGNUM, IA64_FPSR_REGNUM, IA64_GR0_REGNUM, IA64_GR31_REGNUM, IA64_IP_REGNUM, IA64_LC_REGNUM, IA64_PFS_REGNUM, IA64_PR_REGNUM, IA64_PSR_REGNUM, IA64_RNAT_REGNUM, IA64_RSC_REGNUM, and IA64_UNAT_REGNUM.

## ◆ ia64_cannot_fetch_register()

static int ia64_cannot_fetch_register | ( | struct gdbarch * | gdbarch,
|  | int | regno
| ) |  |
| static

Definition at line 321 of file ia64-linux-nat.c.

References gdbarch_num_regs(), and u_offsets.

Referenced by ia64_linux_fetch_register().

## ◆ ia64_cannot_store_register()

static int ia64_cannot_store_register | ( | struct gdbarch * | gdbarch,
|  | int | regno
| ) |  |
| static

Definition at line 329 of file ia64-linux-nat.c.

References gdbarch_num_regs(), IA64_BSPSTORE_REGNUM, and u_offsets.

Referenced by ia64_linux_store_register().

## ◆ ia64_linux_can_use_hw_breakpoint()

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

Definition at line 684 of file ia64-linux-nat.c.

Referenced by _initialize_ia64_linux_nat().

## ◆ ia64_linux_fetch_register()

static void ia64_linux_fetch_register | ( | struct regcache * | regcache,
|  | int | regnum
| ) |  |
| static

Definition at line 695 of file ia64-linux-nat.c.

References _, regcache::arch(), error(), gdb_assert, gdbarch_register_name(), get_ptrace_pid(), ia64_cannot_fetch_register(), IA64_FR0_REGNUM, IA64_FR1_REGNUM, IA64_GR0_REGNUM, ia64_register_addr(), pid, PT_READ_U, ptrace(), PTRACE_TYPE_ARG3, PTRACE_TYPE_RET, regcache_get_ptid(), regcache_raw_supply(), register_size(), regnum, safe_strerror(), and size.

Referenced by ia64_linux_fetch_registers().

## ◆ ia64_linux_fetch_registers()

static void ia64_linux_fetch_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regnum
| ) |  |
| static

Definition at line 769 of file ia64-linux-nat.c.

References regcache::arch(), gdbarch_num_regs(), ia64_linux_fetch_register(), and regnum.

Referenced by _initialize_ia64_linux_nat().

## ◆ ia64_linux_insert_watchpoint()

static int ia64_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 546 of file ia64-linux-nat.c.

References ALL_LWPS, debug_registers, enable_watchpoints_in_psr(), hw_access, hw_read, hw_write, is_power_of_2(), L, gdb.printer.bound_registers::long, lwp_info::ptid, and store_debug_register_pair().

Referenced by _initialize_ia64_linux_nat().

## ◆ ia64_linux_new_thread()

static void ia64_linux_new_thread | ( | struct lwp_info * | lp | ) |
| static

Definition at line 637 of file ia64-linux-nat.c.

References debug_registers, enable_watchpoints_in_psr(), lwp_info::ptid, and store_debug_register().

Referenced by _initialize_ia64_linux_nat().

## ◆ ia64_linux_remove_watchpoint()

static int ia64_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 602 of file ia64-linux-nat.c.

References ALL_LWPS, debug_registers, is_power_of_2(), lwp_info::ptid, and store_debug_register_pair().

Referenced by _initialize_ia64_linux_nat().

## ◆ ia64_linux_status_is_event()

static int ia64_linux_status_is_event | ( | int | status | ) |
| static

Definition at line 888 of file ia64-linux-nat.c.

References status, WIFSTOPPED, and WSTOPSIG.

Referenced by _initialize_ia64_linux_nat().

## ◆ ia64_linux_stopped_by_watchpoint()

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

Definition at line 677 of file ia64-linux-nat.c.

References ia64_linux_stopped_data_address().

Referenced by _initialize_ia64_linux_nat().

## ◆ ia64_linux_stopped_data_address()

static int ia64_linux_stopped_data_address | ( | struct target_ops * | ops,
|  | CORE_ADDR * | addr_p
| ) |  |
| static

Definition at line 654 of file ia64-linux-nat.c.

References get_current_regcache(), IA64_PSR_DD, IA64_PSR_REGNUM, inferior_ptid, linux_nat_get_siginfo(), regcache_cooked_read_unsigned(), and regcache_cooked_write_unsigned().

Referenced by _initialize_ia64_linux_nat(), and ia64_linux_stopped_by_watchpoint().

## ◆ ia64_linux_store_register()

static void ia64_linux_store_register | ( | const struct regcache * | regcache,
|  | int | regnum
| ) |  |
| static

Definition at line 784 of file ia64-linux-nat.c.

References _, regcache::arch(), error(), gdb_assert, gdbarch_register_name(), get_ptrace_pid(), ia64_cannot_store_register(), ia64_register_addr(), pid, PT_WRITE_U, ptrace(), PTRACE_TYPE_ARG3, PTRACE_TYPE_RET, regcache_get_ptid(), regcache_raw_collect(), register_size(), regnum, safe_strerror(), and size.

Referenced by ia64_linux_store_registers().

## ◆ ia64_linux_store_registers()

static void ia64_linux_store_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regnum
| ) |  |
| static

Definition at line 824 of file ia64-linux-nat.c.

References regcache::arch(), gdbarch_num_regs(), ia64_linux_store_register(), and regnum.

Referenced by _initialize_ia64_linux_nat().

## ◆ ia64_linux_xfer_partial()

static enum target_xfer_status ia64_linux_xfer_partial | ( | struct target_ops * | ops,
|  | enum target_object | object,
|  | const char * | annex,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf,
|  | ULONGEST | offset,
|  | ULONGEST | len,
|  | ULONGEST * | xfered_len
| ) |  |
| static

Definition at line 842 of file ia64-linux-nat.c.

References gdb_assert, offset, super_xfer_partial, TARGET_OBJECT_UNWIND_TABLE, TARGET_XFER_E_IO, TARGET_XFER_EOF, and TARGET_XFER_OK.

Referenced by _initialize_ia64_linux_nat().

## ◆ ia64_register_addr()

static CORE_ADDR ia64_register_addr | ( | struct gdbarch * | gdbarch,
|  | int | regno
| ) |  |
| static

Definition at line 305 of file ia64-linux-nat.c.

References _, error(), gdbarch_num_regs(), and u_offsets.

Referenced by ia64_linux_fetch_register(), and ia64_linux_store_register().

## ◆ is_power_of_2()

static int is_power_of_2 | ( | int | val | ) |
| static

Definition at line 533 of file ia64-linux-nat.c.

Referenced by ia64_linux_insert_watchpoint(), and ia64_linux_remove_watchpoint().

## ◆ store_debug_register()

static void store_debug_register | ( | ptid_t | ptid,
|  | int | idx,
|  | long | val
| ) |  |
| static

Definition at line 511 of file ia64-linux-nat.c.

References PT_WRITE_U, regcache::ptid(), ptid_get_lwp(), ptid_get_pid(), ptrace(), PTRACE_TYPE_ARG3, and selftests::ptid::tid.

Referenced by ia64_linux_new_thread(), and store_debug_register_pair().

## ◆ store_debug_register_pair()

static void store_debug_register_pair | ( | ptid_t | ptid,
|  | int | idx,
|  | long * | dbr_addr,
|  | long * | dbr_mask
| ) |  |
| static

Definition at line 523 of file ia64-linux-nat.c.

References regcache::ptid(), and store_debug_register().

Referenced by ia64_linux_insert_watchpoint(), and ia64_linux_remove_watchpoint().

## ◆ supply_fpregset()

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

Definition at line 447 of file ia64-linux-nat.c.

References IA64_FR0_REGNUM, IA64_FR127_REGNUM, IA64_FR1_REGNUM, IA64_FR2_REGNUM, and regcache_raw_supply().

## ◆ supply_gregset()

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

Definition at line 367 of file ia64-linux-nat.c.

References IA64_BR0_REGNUM, IA64_BR7_REGNUM, IA64_BSP_REGNUM, IA64_BSPSTORE_REGNUM, IA64_CCV_REGNUM, IA64_CFM_REGNUM, IA64_EC_REGNUM, IA64_FPSR_REGNUM, IA64_GR0_REGNUM, IA64_GR31_REGNUM, IA64_IP_REGNUM, IA64_LC_REGNUM, IA64_PFS_REGNUM, IA64_PR_REGNUM, IA64_PSR_REGNUM, IA64_RNAT_REGNUM, IA64_RSC_REGNUM, IA64_UNAT_REGNUM, and regcache_raw_supply().

## Variable Documentation

## ◆ debug_registers

long debug_registers[8]
| static

Definition at line 508 of file ia64-linux-nat.c.

Referenced by ia64_linux_insert_watchpoint(), ia64_linux_new_thread(), and ia64_linux_remove_watchpoint().

## ◆ super_xfer_partial

target_xfer_partial_ftype* super_xfer_partial
| static

Definition at line 837 of file ia64-linux-nat.c.

Referenced by _initialize_ia64_linux_nat(), fbsd_nat_add_target(), and ia64_linux_xfer_partial().

## ◆ u_offsets

int u_offsets[]
| static

Definition at line 51 of file ia64-linux-nat.c.

Referenced by ia64_cannot_fetch_register(), ia64_cannot_store_register(), and ia64_register_addr().