From 04dd69e185c1be818b9908cad820f06897dbc87d Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Thu, 11 Aug 1994 00:04:03 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 8 ++++++++ gdb/i386v-nat.c | 38 +++++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2969e67..ea3c211 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 25d3d93..07ddc9f 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. */ @@ -112,6 +116,17 @@ i386_insert_watchpoint (pid, addr, len, rw) 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; int free_debug_register; @@ -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; -- 2.7.4