aboutsummaryrefslogtreecommitdiff
path: root/gdb/go32-nat.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2001-07-26 14:41:16 +0000
committerEli Zaretskii <eliz@gnu.org>2001-07-26 14:41:16 +0000
commit2033c18a5fa97ec584aa3e7c9683345dddf5e579 (patch)
tree56e68c096928497763fddedee3d1bbf94a1af642 /gdb/go32-nat.c
parent4dca840345bb0da94b1085914222526dd67458e5 (diff)
downloadgdb-2033c18a5fa97ec584aa3e7c9683345dddf5e579.zip
gdb-2033c18a5fa97ec584aa3e7c9683345dddf5e579.tar.gz
gdb-2033c18a5fa97ec584aa3e7c9683345dddf5e579.tar.bz2
* go32-nat.c (read_memory_region): Make sure the segment limit was
indeed set, to work around a Windows 2000 bug.
Diffstat (limited to 'gdb/go32-nat.c')
-rw-r--r--gdb/go32-nat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index fce7a0f..b2828eb 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -1331,7 +1331,10 @@ read_memory_region (unsigned long addr, void *dest, size_t len)
if (__dpmi_set_segment_base_address (sel, addr) != -1
&& __dpmi_set_descriptor_access_rights (sel, access_rights) != -1
- && __dpmi_set_segment_limit (sel, segment_limit) != -1)
+ && __dpmi_set_segment_limit (sel, segment_limit) != -1
+ /* W2K silently fails to set the segment limit, leaving
+ it at zero; this test avoids the resulting crash. */
+ && __dpmi_get_segment_limit (sel) >= segment_limit)
movedata (sel, 0, _my_ds (), (unsigned)dest, len);
else
retval = 0;