diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-05-12 00:17:05 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-05-12 00:17:05 +0000 |
commit | 7b86a1b8dd4e65d07afa350255c42c7aed7d2a3a (patch) | |
tree | 98656ca82c83912b2a78acbf750b25684a8da563 | |
parent | 45ecac4b41626c5f43dd90d0174f56c3d1350cc9 (diff) | |
download | gdb-7b86a1b8dd4e65d07afa350255c42c7aed7d2a3a.zip gdb-7b86a1b8dd4e65d07afa350255c42c7aed7d2a3a.tar.gz gdb-7b86a1b8dd4e65d07afa350255c42c7aed7d2a3a.tar.bz2 |
* i386-linux-nat.c (i386_linux_resume): Use regcache functions
instead of read_register and read_register_pid.
* ia64-linux-nat.c (enable_watchpoints_in_psr): Use REGCACHE
argument instead of PTID. Use regcache functions instead of
read_register_pid.
(ia64_linux_insert_watchpoint): Update call.
(ia64_linux_stopped_data_address): Use regcache functions
instead of read_register_pid and write_register_pid.
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/i386-linux-nat.c | 20 | ||||
-rw-r--r-- | gdb/ia64-linux-nat.c | 15 |
3 files changed, 35 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ba1b51d..a3762f5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ 2007-05-11 Ulrich Weigand <uweigand@de.ibm.com> + * i386-linux-nat.c (i386_linux_resume): Use regcache functions + instead of read_register and read_register_pid. + + * ia64-linux-nat.c (enable_watchpoints_in_psr): Use REGCACHE + argument instead of PTID. Use regcache functions instead of + read_register_pid. + (ia64_linux_insert_watchpoint): Update call. + (ia64_linux_stopped_data_address): Use regcache functions + instead of read_register_pid and write_register_pid. + +2007-05-11 Ulrich Weigand <uweigand@de.ibm.com> + * libunwind-frame.h (struct regcache): Add forward declaration. (libunwind_get_reg_special): Add REGCACHE argument. * libunwind-frame.c (libunwind_get_reg_special): Add REGCACHE diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 7a71c60..3275ccb 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -736,11 +736,16 @@ i386_linux_resume (ptid_t ptid, int step, enum target_signal signal) if (step) { - CORE_ADDR pc = read_pc_pid (pid_to_ptid (pid)); + struct cleanup *old_chain = save_inferior_ptid (); + struct regcache *regcache = current_regcache; + ULONGEST pc; gdb_byte buf[LINUX_SYSCALL_LEN]; request = PTRACE_SINGLESTEP; + inferior_ptid = pid_to_ptid (pid); + regcache_cooked_read_unsigned (regcache, PC_REGNUM, &pc); + /* Returning from a signal trampoline is done by calling a special system call (sigreturn or rt_sigreturn, see i386-linux-tdep.c for more information). This system call @@ -753,18 +758,21 @@ i386_linux_resume (ptid_t ptid, int step, enum target_signal signal) if (read_memory_nobpt (pc, buf, LINUX_SYSCALL_LEN) == 0 && memcmp (buf, linux_syscall, LINUX_SYSCALL_LEN) == 0) { - int syscall = read_register_pid (LINUX_SYSCALL_REGNUM, - pid_to_ptid (pid)); + ULONGEST syscall; + regcache_cooked_read_unsigned (regcache, + LINUX_SYSCALL_REGNUM, &syscall); /* Then check the system call number. */ if (syscall == SYS_sigreturn || syscall == SYS_rt_sigreturn) { - CORE_ADDR sp = read_register (I386_ESP_REGNUM); - CORE_ADDR addr = sp; + ULONGEST sp, addr; unsigned long int eflags; + regcache_cooked_read_unsigned (regcache, I386_ESP_REGNUM, &sp); if (syscall == SYS_rt_sigreturn) addr = read_memory_integer (sp + 8, 4) + 20; + else + addr = sp; /* Set the trace flag in the context that's about to be restored. */ @@ -774,6 +782,8 @@ i386_linux_resume (ptid_t ptid, int step, enum target_signal signal) write_memory (addr, (gdb_byte *) &eflags, 4); } } + + do_cleanups (old_chain); } if (ptrace (request, pid, 0, target_signal_to_host (signal)) == -1) diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index dbe6e53..ff2d61c 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -477,16 +477,16 @@ fill_fpregset (const struct regcache *regcache, #define IA64_PSR_DD (1UL << 39) static void -enable_watchpoints_in_psr (ptid_t ptid) +enable_watchpoints_in_psr (struct regcache *regcache) { - CORE_ADDR psr; + ULONGEST psr; - psr = read_register_pid (IA64_PSR_REGNUM, ptid); + regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr); if (!(psr & IA64_PSR_DB)) { psr |= IA64_PSR_DB; /* Set the db bit - this enables hardware watchpoints and breakpoints. */ - write_register_pid (IA64_PSR_REGNUM, psr, ptid); + regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr); } } @@ -591,7 +591,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw) } store_debug_register_pair (ptid, idx, &dbr_addr, &dbr_mask); - enable_watchpoints_in_psr (ptid); + enable_watchpoints_in_psr (current_regcache); return 0; } @@ -628,6 +628,7 @@ ia64_linux_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p) int tid; struct siginfo siginfo; ptid_t ptid = inferior_ptid; + struct regcache *regcache = current_regcache; tid = TIDGET(ptid); if (tid == 0) @@ -640,10 +641,10 @@ ia64_linux_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p) (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */) return 0; - psr = read_register_pid (IA64_PSR_REGNUM, ptid); + regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr); psr |= IA64_PSR_DD; /* Set the dd bit - this will disable the watchpoint for the next instruction */ - write_register_pid (IA64_PSR_REGNUM, psr, ptid); + regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr); *addr_p = (CORE_ADDR)siginfo.si_addr; return 1; |