aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-03-04 17:47:59 +0000
committerDaniel Jacobowitz <drow@false.org>2005-03-04 17:47:59 +0000
commitf90221d302a76d152db1ff293985d0c018593dc2 (patch)
treed17ae062d79c064c50d94eb95d6f44b63168a3f3 /gdb
parentae051c1bca4a725f911d253efc85456f5dc49550 (diff)
downloadgdb-f90221d302a76d152db1ff293985d0c018593dc2.zip
gdb-f90221d302a76d152db1ff293985d0c018593dc2.tar.gz
gdb-f90221d302a76d152db1ff293985d0c018593dc2.tar.bz2
* target.c (target_read_memory_partial): Always initialize
ERR. (target_write_memory_partial): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/target.c46
2 files changed, 47 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 31d5950..8ba4745 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-04 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * target.c (target_read_memory_partial): Always initialize
+ ERR.
+ (target_write_memory_partial): Likewise.
+
2005-03-03 Daniel Jacobowitz <dan@codesourcery.com>
* remote.c (remote_open_1): Call observer_notify_inferior_created.
diff --git a/gdb/target.c b/gdb/target.c
index c008bfc..e2bb96d 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1,7 +1,7 @@
/* Select target systems and architectures at runtime for GDB.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -1249,8 +1249,26 @@ int
target_read_memory_partial (CORE_ADDR memaddr, char *buf, int len, int *err)
{
if (target_xfer_partial_p ())
- return target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY, NULL,
- buf, NULL, memaddr, len);
+ {
+ int retval;
+
+ retval = target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY,
+ NULL, buf, NULL, memaddr, len);
+
+ if (retval <= 0)
+ {
+ if (errno)
+ *err = errno;
+ else
+ *err = EIO;
+ return -1;
+ }
+ else
+ {
+ *err = 0;
+ return retval;
+ }
+ }
else
return target_xfer_memory_partial (memaddr, buf, len, 0, err);
}
@@ -1259,8 +1277,26 @@ int
target_write_memory_partial (CORE_ADDR memaddr, char *buf, int len, int *err)
{
if (target_xfer_partial_p ())
- return target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY, NULL,
- NULL, buf, memaddr, len);
+ {
+ int retval;
+
+ retval = target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY,
+ NULL, NULL, buf, memaddr, len);
+
+ if (retval <= 0)
+ {
+ if (errno)
+ *err = errno;
+ else
+ *err = EIO;
+ return -1;
+ }
+ else
+ {
+ *err = 0;
+ return retval;
+ }
+ }
else
return target_xfer_memory_partial (memaddr, buf, len, 1, err);
}