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]

[RFC] m32c: Dereference pointer type in m32c_push_dummy_call()


This patch fixes all 11 of the gdb.cp/virtfunc.exp failures in addition
to a number of gdb.base/callfuncs.exp failures as well.

It prevents the assertion failure resulting from the call to
gdb_assert() just below the added lines in the patch below.

Comments?

	* m32c-tdep.c (m32c_push_dummy_call): Dereference pointer type.

Index: m32c-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32c-tdep.c,v
retrieving revision 1.25
diff -u -p -r1.25 m32c-tdep.c
--- m32c-tdep.c	28 Jun 2008 17:29:02 -0000	1.25
+++ m32c-tdep.c	5 Dec 2008 02:18:28 -0000
@@ -2018,6 +2018,10 @@ m32c_push_dummy_call (struct gdbarch *gd
   {
     struct type *func_type = value_type (function);
 
+    /* Dereference function pointer types.  */
+    if (TYPE_CODE (func_type) == TYPE_CODE_PTR)
+      func_type = TYPE_TARGET_TYPE (func_type);
+
     gdb_assert (TYPE_CODE (func_type) == TYPE_CODE_FUNC ||
 		TYPE_CODE (func_type) == TYPE_CODE_METHOD);
 


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