30 #include <sys/ptrace.h>
35 #include <sys/syscall.h>
38 #include <asm/ptrace_offsets.h>
39 #include <sys/procfs.h>
85 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
86 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
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,
220 -1, -1, -1, -1, -1, -1, -1, -1,
221 -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,
245 -1, -1, -1, -1, -1, -1, -1, -1,
247 -1, -1, -1, -1, -1, -1, -1, -1,
270 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
271 -1, -1, -1, -1, -1, -1, -1, -1, -1,
275 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
276 -1, -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,
284 -1, -1, -1, -1, -1, -1, -1, -1,
285 -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,
308 error (
_(
"Invalid register number %d."), regno);
368 const greg_t *regp = (
const greg_t *) gregsetp;
405 greg_t *regp = (greg_t *) gregsetp;
407 #define COPY_REG(_idx_,_regi_) \
408 if ((regno == -1) || regno == _regi_) \
409 regcache_raw_collect (regcache, _regi_, regp + _idx_)
451 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
482 if ((regno == -1) || (regno == regi))
488 #define IA64_PSR_DB (1UL << 24)
489 #define IA64_PSR_DD (1UL << 39)
536 for (i = 0; i < 8 *
sizeof (val); i++)
540 return onecount <= 1;
550 long dbr_addr, dbr_mask;
551 int max_watchpoints = 4;
556 for (idx = 0; idx < max_watchpoints; idx++)
559 if ((dbr_mask & (0x3UL << 62)) == 0)
566 if (idx == max_watchpoints)
569 dbr_addr = (
long) addr;
570 dbr_mask = (~(len - 1) & 0x00ffffffffffffffL);
571 dbr_mask |= 0x0800000000000000
L;
575 dbr_mask |= (1
L << 62);
578 dbr_mask |= (1
L << 63);
581 dbr_mask |= (3
L << 62);
604 long dbr_addr, dbr_mask;
605 int max_watchpoints = 4;
610 for (idx = 0; idx < max_watchpoints; idx++)
614 if ((dbr_mask & (0x3UL << 62)) && addr == (
CORE_ADDR) dbr_addr)
638 for (i = 0; i < 8; i++)
659 if (siginfo.si_signo != SIGTRAP
660 || (siginfo.si_code & 0xffff) != 0x0004 )
681 int type,
int cnt,
int othertype)
722 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
754 error (
_(
"Couldn't read register %s (#%d): %s."),
813 error (
_(
"Couldn't write register %s (#%d): %s."),
852 static long gate_table_size;
857 if (gate_table_size == 0)
858 gate_table_size =
syscall (__NR_getunwind, NULL, 0);
859 if (gate_table_size < 0)
862 if (offset >= gate_table_size)
865 tmp_buf = alloca (gate_table_size);
866 res =
syscall (__NR_getunwind, tmp_buf, gate_table_size);
871 if (offset + len > gate_table_size)
872 len = gate_table_size -
offset;
874 memcpy (readbuf, tmp_buf + offset, len);
880 offset, len, xfered_len);
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)
struct regcache * get_thread_regcache(ptid_t ptid)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
void linux_nat_set_new_thread(struct target_ops *t, void(*new_thread)(struct lwp_info *))
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 gdbarch_num_regs(struct gdbarch *gdbarch)
static int ia64_linux_can_use_hw_breakpoint(struct target_ops *self, int type, int cnt, int othertype)
static void store_debug_register_pair(ptid_t ptid, int idx, long *dbr_addr, long *dbr_mask)
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]
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, int, struct expression *) TARGET_DEFAULT_RETURN(-1)
static int ia64_linux_insert_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, int rw, struct expression *cond)
#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)
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, int, struct expression *) TARGET_DEFAULT_RETURN(-1)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
#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)
void linux_nat_add_target(struct target_ops *t)
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)
int ptid_get_pid(ptid_t ptid)
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()
int(* to_can_use_hw_breakpoint)(struct target_ops *, int, int, int) TARGET_DEFAULT_RETURN(0)
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)
long ptid_get_lwp(ptid_t ptid)
static int ia64_cannot_store_register(struct gdbarch *gdbarch, int regno)
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
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,...)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int int rusage_t pid_t pid
static int ia64_linux_remove_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, int type, struct expression *cond)
const ULONGEST const LONGEST len