This is the mail archive of the gdb-patches@sources.redhat.com 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]

[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


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