summaryrefslogtreecommitdiff
path: root/gdb/go32-nat.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2000-04-03 15:27:42 +0000
committerEli Zaretskii <eliz@gnu.org>2000-04-03 15:27:42 +0000
commit782aefbd51eff16bb39380365b692283b8d6d42a (patch)
tree455f8c90c5228f3cc6c98cf76250c8501cc631c7 /gdb/go32-nat.c
parent2bce8801bd4190989f8baf336b36075ee3fc424d (diff)
downloadgdb-782aefbd51eff16bb39380365b692283b8d6d42a.tar.gz
* go32-nat.c (go32_handle_nonaligned_watchpoint): Use a
two-dimensional array instead of faking it with index arithmetics.
Diffstat (limited to 'gdb/go32-nat.c')
-rw-r--r--gdb/go32-nat.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 7d35d7b9eb0..c839d11b6d9 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -859,20 +859,19 @@ go32_handle_nonaligned_watchpoint (wp_op what, CORE_ADDR waddr, CORE_ADDR addr,
int size;
int rv = 0, status = 0;
- static int size_try_array[16] =
+ static int size_try_array[4][4] =
{
- 1, 1, 1, 1, /* trying size one */
- 2, 1, 2, 1, /* trying size two */
- 2, 1, 2, 1, /* trying size three */
- 4, 1, 2, 1 /* trying size four */
+ { 1, 1, 1, 1 }, /* trying size one */
+ { 2, 1, 2, 1 }, /* trying size two */
+ { 2, 1, 2, 1 }, /* trying size three */
+ { 4, 1, 2, 1 } /* trying size four */
};
while (len > 0)
{
align = addr % 4;
- /* Four is the maximum length for 386. */
- size = (len > 4) ? 3 : len - 1;
- size = size_try_array[size * 4 + align];
+ /* Four is the maximum length a 386 debug register can watch. */
+ size = size_try_array[len > 4 ? 3 : len - 1][align];
if (what == wp_insert)
status = go32_insert_aligned_watchpoint (waddr, addr, size, rw);
else if (what == wp_remove)