Fix remote/17230

Message ID 1407305607-3602-1-git-send-email-yao@codesourcery.com
State Committed
Headers

Commit Message

Yao Qi Aug. 6, 2014, 6:13 a.m. UTC
  This patch is to fix PR remote/17230, which is a leftover of the
to_xfer_partial interface change.  I tried splint and it reports this
problem like this,

../../../git/gdb/remote-mips.c:2236: Return value type unsigned long long does not match declared type enum target_xfer_status: len

and this problem only exists in remote-mips.c.  Rebuild GDB with all
targets enabled.  I'll commit it in two days.

gdb:

2014-08-06  Yao Qi  <yao@codesourcery.com>

	PR remote/17230
	* remote-mips.c (mips_xfer_memory): Set *xfered_len and return
	TARGET_XFER_OK instead of 0.
---
 gdb/remote-mips.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Tom Tromey Aug. 6, 2014, 4 p.m. UTC | #1
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> ../../../git/gdb/remote-mips.c:2236: Return value type unsigned long long does not match declared type enum target_xfer_status: len

Nice.

Yao> and this problem only exists in remote-mips.c.  Rebuild GDB with all
Yao> targets enabled.  I'll commit it in two days.

FWIW it looks good to me.

Tom
  
Yao Qi Aug. 7, 2014, 9:46 a.m. UTC | #2
On 08/07/2014 12:00 AM, Tom Tromey wrote:
> FWIW it looks good to me.

Thanks for the review, Tom.  Patch is pushed in.
  

Patch

diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 236f3cd..7397148 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -2233,7 +2233,8 @@  mips_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
       /* Copy appropriate bytes out of the buffer.  */
       memcpy (readbuf, buffer + (memaddr & 3), len);
     }
-  return len;
+  *xfered_len = len;
+  return TARGET_XFER_OK;
 }
 
 /* Target to_xfer_partial implementation.  */