From: Fred Fish Date: Thu, 11 Aug 1994 00:04:03 +0000 (+0000) Subject: * i386v-nat.c (i386_insert_nonaligned_watchpoint): X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=04dd69e185c1be818b9908cad820f06897dbc87d;p=binutils-gdb.git * i386v-nat.c (i386_insert_nonaligned_watchpoint): add additional argument specifying raw address to permit proper release of debug registers. (i386_insert_watchpoint, i386_insert_aligned_watchpoint): change all callers. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2969e674816..ea3c2119eef 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +Wed Aug 10 13:23:47 1994 Rick Sladkey (jrs@world.std.com) + + * i386v-nat.c (i386_insert_nonaligned_watchpoint): + add additional argument specifying raw address to permit + proper release of debug registers. + (i386_insert_watchpoint, i386_insert_aligned_watchpoint): + change all callers. + Wed Aug 10 16:13:45 1994 Stu Grossman (grossman@cygnus.com) * defs.h, top.c: Use `extern' in declarations of GUI hooks, and diff --git a/gdb/i386v-nat.c b/gdb/i386v-nat.c index 25d3d939960..07ddc9f7b5d 100644 --- a/gdb/i386v-nat.c +++ b/gdb/i386v-nat.c @@ -101,7 +101,11 @@ static int debug_control_mirror; static CORE_ADDR address_lookup[DR_LASTADDR - DR_FIRSTADDR + 1]; static int -i386_insert_nonaligned_watchpoint PARAMS ((int, CORE_ADDR, int, int)); +i386_insert_nonaligned_watchpoint PARAMS ((int, CORE_ADDR, CORE_ADDR, int, + int)); + +static int +i386_insert_aligned_watchpoint PARAMS ((pid, addr, len, rw)); /* Insert a watchpoint. */ @@ -111,6 +115,17 @@ i386_insert_watchpoint (pid, addr, len, rw) CORE_ADDR addr; int len; int rw; +{ + return i386_insert_aligned_watchpoint (pid, addr, addr, len, rw); +} + +static int +i386_insert_aligned_watchpoint (pid, waddr, addr, len, rw) + int pid; + CORE_ADDR waddr; + CORE_ADDR addr; + int len; + int rw; { int i; int read_write_bits, len_bits; @@ -135,18 +150,18 @@ i386_insert_watchpoint (pid, addr, len, rw) else if (len == 2) { if (addr % 2) - return i386_insert_nonaligned_watchpoint (pid, addr, len, rw); + return i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw); len_bits = DR_LEN_2; } else if (len == 4) { if (addr % 4) - return i386_insert_nonaligned_watchpoint (pid, addr, len, rw); + return i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw); len_bits = DR_LEN_4; } else - return i386_insert_nonaligned_watchpoint (pid, addr, len, rw); + return i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw); free_debug_register = i; register_number = free_debug_register - DR_FIRSTADDR; @@ -169,11 +184,12 @@ i386_insert_watchpoint (pid, addr, len, rw) } static int -i386_insert_nonaligned_watchpoint (pid, addr, len, rw) - int pid; - CORE_ADDR addr; - int len; - int rw; +i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw) + int pid; + CORE_ADDR waddr; + CORE_ADDR addr; + int len; + int rw; { int align; int size; @@ -194,10 +210,10 @@ i386_insert_nonaligned_watchpoint (pid, addr, len, rw) size = (len > 4) ? 3 : len - 1; size = size_try_array[size * 4 + align]; - rv = i386_insert_watchpoint (pid, addr, size, rw); + rv = i386_insert_watchpoint (pid, waddr, addr, size, rw); if (rv) { - i386_remove_watchpoint (pid, addr, size); + i386_remove_watchpoint (pid, waddr, size); return rv; } addr += size;