From 97d7aa1e75bd221716dfa4b4b23101b976199f61 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Thu, 1 Jun 2000 22:19:03 +0000 Subject: [PATCH] 2000-06-01 Michael Snyder * 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. --- gdb/ChangeLog | 7 +++++++ gdb/sol-thread.c | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 351ae16bb6..a43f61a863 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2000-06-01 Michael Snyder + + * 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. + Thu Jun 1 20:05:26 2000 Andrew Cagney * TODO: More suggestions added. diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index e749b06fef..0dcbb3cbfc 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; } -- 2.11.0