diff options
author | Eli Zaretskii <eliz@gnu.org> | 2000-04-03 15:27:42 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2000-04-03 15:27:42 +0000 |
commit | 184a103e6d65b29e4b40e3383dd46ab414afd6a4 (patch) | |
tree | f4d21c7928623eb7ccd2e441176e07073ca644be /gdb | |
parent | 7f668b86584c56415f47883c75b75aa6638f5d88 (diff) | |
download | gdb-184a103e6d65b29e4b40e3383dd46ab414afd6a4.zip gdb-184a103e6d65b29e4b40e3383dd46ab414afd6a4.tar.gz gdb-184a103e6d65b29e4b40e3383dd46ab414afd6a4.tar.bz2 |
* go32-nat.c (go32_handle_nonaligned_watchpoint): Use a
two-dimensional array instead of faking it with index
arithmetics.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/go32-nat.c | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a9f9a5a..2f1ac00 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2000-04-03 Eli Zaretskii <eliz@is.elta.co.il> + * go32-nat.c (go32_handle_nonaligned_watchpoint): Use a + two-dimensional array instead of faking it with index + arithmetics. + +2000-04-03 Eli Zaretskii <eliz@is.elta.co.il> + * config/i386/xm-go32.h (HOST_LONG_DOUBLE_FORMAT): Define. * config/i386/tm-go32.h (TARGET_LONG_DOUBLE_BIT): Remove diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index 7d35d7b..c839d11 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) |