summaryrefslogtreecommitdiff
path: root/gdb/sol-thread.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2000-06-01 22:19:03 +0000
committerMichael Snyder <msnyder@specifix.com>2000-06-01 22:19:03 +0000
commit97d7aa1e75bd221716dfa4b4b23101b976199f61 (patch)
tree8e66697a9ee08b095fb4828af5e309914d4cce5b /gdb/sol-thread.c
parente48faf032a19dacee1df313f8e04a40f4fa06b9f (diff)
downloadgdb-97d7aa1e75bd221716dfa4b4b23101b976199f61.tar.gz
2000-06-01 Michael Snyder <msnyder@seadog.cygnus.com>
* sol-thread.c (rw_common): Circumstances (eg. a bug in Sun's thread_db library) may cause this function to be called with an illegal address, in which case procfs_to_xfer_memory will return zero. Return an error code instead of looping forever.
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r--gdb/sol-thread.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index e749b06fef4..0dcbb3cbfc6 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -1090,6 +1090,20 @@ rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr,
return PS_ERR;
}
+ else if (cc == 0)
+ {
+ if (dowrite == 0)
+ warning ("rw_common (): unable to read at addr 0x%lx",
+ (long) addr);
+ else
+ warning ("rw_common (): unable to write at addr 0x%lx",
+ (long) addr);
+
+ do_cleanups (old_chain);
+
+ return PS_ERR;
+ }
+
size -= cc;
buf += cc;
}