[committed, spu] Fix spu_xfer_partial return value

Ulrich Weigand uweigand@de.ibm.com
Thu Mar 8 23:55:00 GMT 2007


Hello,

spu_xfer_partial was erroneously returning 0 instead of -1 for
unsupported object types; this would manifest as 

warning: while parsing target description: no element found
warning: Could not load XML target description; ignoring

on every startup, as the target would report an existing, but empty
TARGET_OBJECT_AVAILABLE_FEATURES object.

Tested on spu-elf, committed to mainline.

Bye,
Ulrich


ChangeLog:

	* spu-linux-nat.c (spu_xfer_partial): Return -1 for unsupported
	object types, not 0.

Index: gdb/spu-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/spu-linux-nat.c,v
retrieving revision 1.3
diff -u -p -r1.3 spu-linux-nat.c
--- gdb/spu-linux-nat.c	9 Jan 2007 17:58:58 -0000	1.3
+++ gdb/spu-linux-nat.c	8 Mar 2007 23:48:27 -0000
@@ -536,7 +536,7 @@ spu_xfer_partial (struct target_ops *ops
       return spu_proc_xfer_spu (mem_annex, readbuf, writebuf, offset, len);
     }
 
-  return 0;
+  return -1;
 }
 
 /* Override the to_can_use_hw_breakpoint routine.  */
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gdb-patches mailing list