35 #include <sys/syscall.h> 38 #include <asm/ptrace_offsets.h> 39 #include <sys/procfs.h> 87 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
88 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
89 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
90 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
91 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
92 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
222 -1, -1, -1, -1, -1, -1, -1, -1,
223 -1, -1, -1, -1, -1, -1, -1, -1,
224 -1, -1, -1, -1, -1, -1, -1, -1,
225 -1, -1, -1, -1, -1, -1, -1, -1,
226 -1, -1, -1, -1, -1, -1, -1, -1,
227 -1, -1, -1, -1, -1, -1, -1, -1,
228 -1, -1, -1, -1, -1, -1, -1, -1,
229 -1, -1, -1, -1, -1, -1, -1, -1,
247 -1, -1, -1, -1, -1, -1, -1, -1,
249 -1, -1, -1, -1, -1, -1, -1, -1,
272 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
273 -1, -1, -1, -1, -1, -1, -1, -1, -1,
277 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
278 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
279 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
280 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
281 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
282 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
286 -1, -1, -1, -1, -1, -1, -1, -1,
287 -1, -1, -1, -1, -1, -1, -1, -1,
288 -1, -1, -1, -1, -1, -1, -1, -1,
289 -1, -1, -1, -1, -1, -1, -1, -1,
290 -1, -1, -1, -1, -1, -1, -1, -1,
291 -1, -1, -1, -1, -1, -1, -1, -1,
292 -1, -1, -1, -1, -1, -1, -1, -1,
293 -1, -1, -1, -1, -1, -1, -1, -1,
294 -1, -1, -1, -1, -1, -1, -1, -1,
295 -1, -1, -1, -1, -1, -1, -1, -1,
296 -1, -1, -1, -1, -1, -1, -1, -1,
297 -1, -1, -1, -1, -1, -1, -1, -1,
298 -1, -1, -1, -1, -1, -1, -1, -1,
299 -1, -1, -1, -1, -1, -1, -1, -1,
300 -1, -1, -1, -1, -1, -1, -1, -1,
301 -1, -1, -1, -1, -1, -1, -1, -1,
310 error (
_(
"Invalid register number %d."), regno);
370 const greg_t *regp = (
const greg_t *) gregsetp;
407 greg_t *regp = (greg_t *) gregsetp;
409 #define COPY_REG(_idx_,_regi_) \ 410 if ((regno == -1) || regno == _regi_) \ 411 regcache_raw_collect (regcache, _regi_, regp + _idx_) 453 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
484 if ((regno == -1) || (regno == regi))
490 #define IA64_PSR_DB (1UL << 24) 491 #define IA64_PSR_DD (1UL << 39) 538 for (i = 0; i < 8 *
sizeof (val); i++)
542 return onecount <= 1;
553 long dbr_addr, dbr_mask;
554 int max_watchpoints = 4;
559 for (idx = 0; idx < max_watchpoints; idx++)
562 if ((dbr_mask & (0x3UL << 62)) == 0)
569 if (idx == max_watchpoints)
572 dbr_addr = (
long) addr;
573 dbr_mask = (~(len - 1) & 0x00ffffffffffffffL);
574 dbr_mask |= 0x0800000000000000
L;
578 dbr_mask |= (1
L << 62);
581 dbr_mask |= (1
L << 63);
584 dbr_mask |= (3
L << 62);
608 long dbr_addr, dbr_mask;
609 int max_watchpoints = 4;
614 for (idx = 0; idx < max_watchpoints; idx++)
618 if ((dbr_mask & (0x3UL << 62)) && addr == (
CORE_ADDR) dbr_addr)
642 for (i = 0; i < 8; i++)
663 if (siginfo.si_signo != SIGTRAP
664 || (siginfo.si_code & 0xffff) != 0x0004 )
686 int cnt,
int othertype)
728 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
756 error (
_(
"Couldn't read register %s (#%d): %s."),
812 error (
_(
"Couldn't write register %s (#%d): %s."),
851 static long gate_table_size;
856 if (gate_table_size == 0)
857 gate_table_size =
syscall (__NR_getunwind, NULL, 0);
858 if (gate_table_size < 0)
861 if (
offset >= gate_table_size)
864 tmp_buf = (
gdb_byte *) alloca (gate_table_size);
865 res =
syscall (__NR_getunwind, tmp_buf, gate_table_size);
870 if (
offset + len > gate_table_size)
871 len = gate_table_size -
offset;
873 memcpy (readbuf, tmp_buf +
offset, len);
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 constexpr ptid_t tid
static int ia64_cannot_fetch_register(struct gdbarch *gdbarch, int regno)
static target_xfer_partial_ftype * super_xfer_partial
static void enable_watchpoints_in_psr(ptid_t ptid)
void supply_gregset(struct regcache *regcache, const gregset_t *gregsetp)
int ptid_get_pid(const ptid_t &ptid)
struct regcache * get_thread_regcache(ptid_t ptid)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
void linux_nat_set_new_thread(struct target_ops *t, void(*new_thread)(struct lwp_info *))
ptid_t regcache_get_ptid(const struct regcache *regcache)
static int ia64_linux_status_is_event(int status)
static int ia64_linux_stopped_data_address(struct target_ops *ops, CORE_ADDR *addr_p)
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
int gdbarch_num_regs(struct gdbarch *gdbarch)
static void store_debug_register_pair(ptid_t ptid, int idx, long *dbr_addr, long *dbr_mask)
int(* to_can_use_hw_breakpoint)(struct target_ops *, enum bptype, int, int) TARGET_DEFAULT_RETURN(0)
int linux_nat_get_siginfo(ptid_t ptid, siginfo_t *siginfo)
static void ia64_linux_store_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
struct regcache * get_current_regcache(void)
void supply_fpregset(struct regcache *regcache, const fpregset_t *fpregsetp)
static void store_debug_register(ptid_t ptid, int idx, long val)
static CORE_ADDR ia64_register_addr(struct gdbarch *gdbarch, int regno)
static long debug_registers[8]
#define IA64_BSPSTORE_REGNUM
#define IA64_FR127_REGNUM
static void ia64_linux_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
static int ia64_linux_remove_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
#define COPY_REG(_idx_, _regi_)
void _initialize_ia64_linux_nat(void)
enum target_xfer_status target_xfer_partial_ftype(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)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
void linux_nat_add_target(struct target_ops *t)
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
static void ia64_linux_store_register(const struct regcache *regcache, int regnum)
enum target_xfer_status(* to_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) TARGET_DEFAULT_RETURN(TARGET_XFER_E_IO)
static int ia64_linux_stopped_by_watchpoint(struct target_ops *ops)
struct target_ops * linux_target(void)
long ptid_get_lwp(const ptid_t &ptid)
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)
void linux_nat_set_status_is_event(struct target_ops *t, int(*status_is_event)(int status))
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
static void ia64_linux_new_thread(struct lwp_info *lp)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
void fill_gregset(const struct regcache *regcache, gregset_t *gregsetp, int regno)
char * safe_strerror(int)
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)
int(* to_stopped_by_watchpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
int to_have_steppable_watchpoint
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
unsigned long long ULONGEST
int register_size(struct gdbarch *gdbarch, int regnum)
static int ia64_cannot_store_register(struct gdbarch *gdbarch, int regno)
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
pid_t get_ptrace_pid(ptid_t ptid)
int(* to_stopped_data_address)(struct target_ops *, CORE_ADDR *) TARGET_DEFAULT_RETURN(0)
void fill_fpregset(const struct regcache *regcache, fpregset_t *fpregsetp, int regno)
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
static int is_power_of_2(int val)
void error(const char *fmt,...)