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]

[commit] Fix gdb.cp/bool.exp for PowerPC


gdb.cp/bool.exp had an amusing failure: return_true() was returning
false.  This was because the return value code was treating integers
specially, but not other integer-like types.  It would fail similarly
for -fshort-enums.

Tested on powerpc-linux and committed.

-- 
Daniel Jacobowitz
CodeSourcery

2007-09-06  Daniel Jacobowitz  <dan@codesourcery.com>

	* ppc-sysv-tdep.c (do_ppc_sysv_return_value): Handle other integer
	types.

--- gdb/ppc-sysv-tdep.c	(revision 180913)
+++ gdb/ppc-sysv-tdep.c	(working copy)
@@ -503,8 +503,13 @@ do_ppc_sysv_return_value (struct gdbarch
 	}
       return RETURN_VALUE_REGISTER_CONVENTION;
     }
-  if (TYPE_CODE (type) == TYPE_CODE_INT
-      && TYPE_LENGTH (type) <= tdep->wordsize)
+  else if ((TYPE_CODE (type) == TYPE_CODE_INT
+	    || TYPE_CODE (type) == TYPE_CODE_CHAR
+	    || TYPE_CODE (type) == TYPE_CODE_BOOL
+	    || TYPE_CODE (type) == TYPE_CODE_PTR
+	    || TYPE_CODE (type) == TYPE_CODE_REF
+	    || TYPE_CODE (type) == TYPE_CODE_ENUM)
+	   && TYPE_LENGTH (type) <= tdep->wordsize)
     {
       if (readbuf)
 	{


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