32#include "gdbsupport/gdb_wait.h"
36#include <sys/syscall.h>
39#include <asm/ptrace_offsets.h>
40#include <sys/procfs.h>
57 const gdb_byte *writebuf,
58 ULONGEST offset, ULONGEST len,
59 ULONGEST *xfered_len)
override;
131 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
132 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
133 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
134 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
135 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
136 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
266 -1, -1, -1, -1, -1, -1, -1, -1,
267 -1, -1, -1, -1, -1, -1, -1, -1,
268 -1, -1, -1, -1, -1, -1, -1, -1,
269 -1, -1, -1, -1, -1, -1, -1, -1,
270 -1, -1, -1, -1, -1, -1, -1, -1,
271 -1, -1, -1, -1, -1, -1, -1, -1,
272 -1, -1, -1, -1, -1, -1, -1, -1,
273 -1, -1, -1, -1, -1, -1, -1, -1,
291 -1, -1, -1, -1, -1, -1, -1, -1,
293 -1, -1, -1, -1, -1, -1, -1, -1,
316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
317 -1, -1, -1, -1, -1, -1, -1, -1, -1,
321 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
322 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
323 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
324 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
326 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
330 -1, -1, -1, -1, -1, -1, -1, -1,
331 -1, -1, -1, -1, -1, -1, -1, -1,
332 -1, -1, -1, -1, -1, -1, -1, -1,
333 -1, -1, -1, -1, -1, -1, -1, -1,
334 -1, -1, -1, -1, -1, -1, -1, -1,
335 -1, -1, -1, -1, -1, -1, -1, -1,
336 -1, -1, -1, -1, -1, -1, -1, -1,
337 -1, -1, -1, -1, -1, -1, -1, -1,
338 -1, -1, -1, -1, -1, -1, -1, -1,
339 -1, -1, -1, -1, -1, -1, -1, -1,
340 -1, -1, -1, -1, -1, -1, -1, -1,
341 -1, -1, -1, -1, -1, -1, -1, -1,
342 -1, -1, -1, -1, -1, -1, -1, -1,
343 -1, -1, -1, -1, -1, -1, -1, -1,
344 -1, -1, -1, -1, -1, -1, -1, -1,
345 -1, -1, -1, -1, -1, -1, -1, -1,
354 error (_(
"Invalid register number %d."), regno);
414 const greg_t *regp = (
const greg_t *) gregsetp;
450 greg_t *regp = (greg_t *) gregsetp;
452#define COPY_REG(_idx_,_regi_) \
453 if ((regno == -1) || regno == _regi_) \
454 regcache->raw_collect (_regi_, regp + _idx_)
494 const gdb_byte f_zero[16] = { 0 };
495 const gdb_byte f_one[16] =
496 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
521 fpregset_t *fpregsetp,
int regno)
527 if ((regno == -1) || (regno == regi))
532#define IA64_PSR_DB (1UL << 24)
533#define IA64_PSR_DD (1UL << 39)
580 for (i = 0; i < 8 *
sizeof (val); i++)
584 return onecount <= 1;
589 enum target_hw_bp_type
type,
593 long dbr_addr, dbr_mask;
594 int max_watchpoints = 4;
599 for (idx = 0; idx < max_watchpoints; idx++)
602 if ((dbr_mask & (0x3UL << 62)) == 0)
609 if (idx == max_watchpoints)
612 dbr_addr = (long) addr;
613 dbr_mask = (~(len - 1) & 0x00ffffffffffffffL);
614 dbr_mask |= 0x0800000000000000L;
618 dbr_mask |= (1L << 62);
621 dbr_mask |= (1L << 63);
624 dbr_mask |= (3L << 62);
644 enum target_hw_bp_type
type,
648 long dbr_addr, dbr_mask;
649 int max_watchpoints = 4;
654 for (idx = 0; idx < max_watchpoints; idx++)
658 if ((dbr_mask & (0x3UL << 62)) && addr == (CORE_ADDR) dbr_addr)
680 for (i = 0; i < 8; i++)
701 if (siginfo.si_signo != SIGTRAP
702 || (siginfo.si_code & 0xffff) != 0x0004 )
710 *addr_p = (CORE_ADDR) siginfo.si_addr;
723 int cnt,
int othertype)
744 const gdb_byte zero[8] = { 0 };
754 const gdb_byte f_zero[16] = { 0 };
764 const gdb_byte f_one[16] =
765 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
793 error (_(
"Couldn't read register %s (#%d): %s."),
795 regnum, safe_strerror (errno));
848 error (_(
"Couldn't write register %s (#%d): %s."),
850 regnum, safe_strerror (errno));
876 gdb_byte *readbuf,
const gdb_byte *writebuf,
877 ULONGEST offset, ULONGEST len,
878 ULONGEST *xfered_len)
882 static long gate_table_size;
887 if (gate_table_size == 0)
888 gate_table_size =
syscall (__NR_getunwind, NULL, 0);
889 if (gate_table_size < 0)
892 if (offset >= gate_table_size)
895 tmp_buf = (gdb_byte *) alloca (gate_table_size);
896 res =
syscall (__NR_getunwind, tmp_buf, gate_table_size);
899 gdb_assert (res == gate_table_size);
901 if (offset + len > gate_table_size)
902 len = gate_table_size - offset;
904 memcpy (readbuf, tmp_buf + offset, len);
910 offset, len, xfered_len);
921 return WIFSTOPPED (
status) && (WSTOPSIG (
status) == SIGTRAP
922 || WSTOPSIG (
status) == SIGILL);
void enable_watchpoints_in_psr(ptid_t ptid)
int insert_watchpoint(CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override
enum target_xfer_status xfer_partial(enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) override
bool stopped_by_watchpoint() override
void low_new_thread(struct lwp_info *lp) override
bool stopped_data_address(CORE_ADDR *) override
void store_registers(struct regcache *, int) override
bool low_status_is_event(int status) override
int remove_watchpoint(CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override
int can_use_hw_breakpoint(enum bptype, int, int) override
bool have_steppable_watchpoint() override
void fetch_registers(struct regcache *, int) override
enum target_xfer_status xfer_partial(enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) override
void raw_collect(int regnum, void *buf) const override
void raw_supply(int regnum, const void *buf) override
#define ptrace(request, pid, addr, data)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
int gdbarch_num_regs(struct gdbarch *gdbarch)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
static void store_debug_register(ptid_t ptid, int idx, long val)
static int is_power_of_2(int val)
void fill_fpregset(const struct regcache *regcache, fpregset_t *fpregsetp, int regno)
static void ia64_linux_fetch_register(struct regcache *regcache, int regnum)
static CORE_ADDR ia64_register_addr(struct gdbarch *gdbarch, int regno)
static void store_debug_register_pair(ptid_t ptid, int idx, long *dbr_addr, long *dbr_mask)
void fill_gregset(const struct regcache *regcache, gregset_t *gregsetp, int regno)
static void ia64_linux_store_register(const struct regcache *regcache, int regnum)
void supply_fpregset(struct regcache *regcache, const fpregset_t *fpregsetp)
void supply_gregset(struct regcache *regcache, const gregset_t *gregsetp)
static ia64_linux_nat_target the_ia64_linux_nat_target
void _initialize_ia64_linux_nat()
static long debug_registers[8]
static int ia64_cannot_store_register(struct gdbarch *gdbarch, int regno)
#define COPY_REG(_idx_, _regi_)
static int ia64_cannot_fetch_register(struct gdbarch *gdbarch, int regno)
#define IA64_BSPSTORE_REGNUM
#define IA64_FR127_REGNUM
void add_inf_child_target(inf_child_target *target)
pid_t get_ptrace_pid(ptid_t ptid)
lwp_info_range all_lwps()
bool linux_nat_get_siginfo(ptid_t ptid, siginfo_t *siginfo)
struct linux_nat_target * linux_target
int register_size(struct gdbarch *gdbarch, int regnum)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
struct regcache * get_current_regcache(void)
struct regcache * get_thread_regcache(process_stratum_target *target, ptid_t ptid)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
@ TARGET_OBJECT_UNWIND_TABLE