diff options
author | Jim Blandy <jimb@codesourcery.com> | 2000-04-19 22:55:38 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2000-04-19 22:55:38 +0000 |
commit | 8557886114408e2f21eac0e877397f57c321b765 (patch) | |
tree | 2b8a908f47071b58c6cbd69dc6cb38c5546c3346 /gdb | |
parent | 72a0cf8f1728776a5f395da19416a33329ad6244 (diff) | |
download | gdb-8557886114408e2f21eac0e877397f57c321b765.zip gdb-8557886114408e2f21eac0e877397f57c321b765.tar.gz gdb-8557886114408e2f21eac0e877397f57c321b765.tar.bz2 |
* i386v-nat.c (i386_insert_nonaligned_watchpoint): Use a
two-dimensional array, instead of faking it with explicit index
arithmetic.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/i386v-nat.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gdb/i386v-nat.c b/gdb/i386v-nat.c index 0bf702c..274d59e 100644 --- a/gdb/i386v-nat.c +++ b/gdb/i386v-nat.c @@ -229,12 +229,12 @@ i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw) int size; int rv; - 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 */ }; rv = 0; @@ -242,8 +242,7 @@ i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw) { align = addr % 4; /* Four is the maximum length for 386. */ - size = (len > 4) ? 3 : len - 1; - size = size_try_array[size * 4 + align]; + size = size_try_array[len > 4 ? 3 : len - 1][align]; rv = i386_insert_aligned_watchpoint (pid, waddr, addr, size, rw); if (rv) |