diff options
author | Fred Fish <fnf@specifix.com> | 1994-08-11 00:04:03 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1994-08-11 00:04:03 +0000 |
commit | 04dd69e185c1be818b9908cad820f06897dbc87d (patch) | |
tree | 9b68db74a34025e0bd794e7b98cbb9c8750b9701 /gdb/i386v-nat.c | |
parent | 8164ec2eb5c6b68d851af2850b20ef75a5bb1682 (diff) | |
download | gdb-04dd69e185c1be818b9908cad820f06897dbc87d.zip gdb-04dd69e185c1be818b9908cad820f06897dbc87d.tar.gz gdb-04dd69e185c1be818b9908cad820f06897dbc87d.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/i386v-nat.c')
-rw-r--r-- | gdb/i386v-nat.c | 38 |
1 files changed, 27 insertions, 11 deletions
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; |