This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix core_xfer_partial buggy


Hi,

Daniel spotted this in one of the Windows DLL update rounds.  Here it is on
its own, and regtested on i686-pc-linux and i686-pc-cygwin.

(doesn't Coverity catch this?)

Cheers,
Pedro Alves



2007-08-19  Daniel Jacobowitz  <dan@codesourcery.com>

	* corelow.c (core_xfer_partial): Pass writebuf to
	deprecated_xfer_memory in TARGET_OBJECT_MEMORY write case.

---
 gdb/corelow.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: src/gdb/corelow.c
===================================================================
--- src.orig/gdb/corelow.c	2007-08-19 18:14:42.000000000 +0100
+++ src/gdb/corelow.c	2007-08-19 18:22:22.000000000 +0100
@@ -523,11 +523,11 @@ core_xfer_partial (struct target_ops *op
     {
     case TARGET_OBJECT_MEMORY:
       if (readbuf)
-	return (*ops->deprecated_xfer_memory) (offset, readbuf, len,
-					       0/*write*/, NULL, ops);
+	return (*ops->deprecated_xfer_memory) (offset, readbuf,
+					       len, 0/*write*/, NULL, ops);
       if (writebuf)
-	return (*ops->deprecated_xfer_memory) (offset, readbuf, len,
-					       1/*write*/, NULL, ops);
+	return (*ops->deprecated_xfer_memory) (offset, (gdb_byte *) writebuf,
+					       len, 1/*write*/, NULL, ops);
       return -1;
 
     case TARGET_OBJECT_AUXV:




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]