This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix gdb.cp/bool.exp for PowerPC
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Thu, 6 Sep 2007 16:22:37 -0400
- Subject: [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)
{