This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Fix for tdep/1623 and tdep/1624
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 25 Apr 2004 13:28:53 +0200 (CEST)
- Subject: [PATCH] Fix for tdep/1623 and tdep/1624
The bug here isn't really in tdep code. The problem was that the type
passed to return_value() is a typedef. While it could be argued that
the tdep code should do a CHECK_TYPEDEF(), looking at
stack.c:return_command() reveals that this functions looks at
TYPE_CODE, and therefore it really should do the CHECK_TYPEDEF itself.
So I've committed the attached patch.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* stack.c (return_command): Use CHECK_TYPEDEF on the return type.
Fixes PR tdep/1623 and PR tdep/1624.
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.103
diff -u -p -r1.103 stack.c
--- stack.c 21 Apr 2004 23:52:21 -0000 1.103
+++ stack.c 25 Apr 2004 11:25:43 -0000
@@ -1844,6 +1844,7 @@ return_command (char *retval_exp, int fr
return_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (thisfun));
if (return_type == NULL)
return_type = builtin_type_int;
+ CHECK_TYPEDEF (return_type);
return_value = value_cast (return_type, return_value);
/* Make sure the value is fully evaluated. It may live in the