This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[PATCH]: avoid infinite loop on Solaris
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH]: avoid infinite loop on Solaris
- From: msnyder at cygnus dot com
- Date: Thu, 1 Jun 2000 15:18:41 -0700 (PDT)
FYI, checking in this change:
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.
Index: sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.9
diff -p -r1.9 sol-thread.c
*** sol-thread.c 2000/05/28 01:12:29 1.9
--- sol-thread.c 2000/06/01 22:17:36
*************** rw_common (int dowrite, const struct ps_
*** 1090,1095 ****
--- 1090,1109 ----
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;
}