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]

[PATCH] Fixing parse error for "pointer to a function pointer"


Today GDB complains to parse a pointer to a function pointer.

GNU gdb (GDB) 7.3.50.20110916-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) ptype int(**)()
A syntax error in expression, near `*)()'.
(gdb)

I am sending this patch to fix this issue.  Please review the same.
NB: I am working on the test-cases and will update the patch with the
same very soon.

Regards,
Abhijit Halder

Attachment: ChangeLog.txt
Description: Text document

Index: gdb/c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.82
diff -u -p -r1.82 c-exp.y
--- gdb/c-exp.y	6 May 2011 14:12:17 -0000	1.82
+++ gdb/c-exp.y	19 Sep 2011 14:24:13 -0000
@@ -953,6 +953,9 @@ direct_abs_decl: '(' abs_decl ')'
 			{ push_type (tp_function); }
 	|	func_mod
 			{ push_type (tp_function); }
+
+	|	abs_decl '*'
+			{ push_type (tp_pointer); $$ = $1; }
 	;
 
 array_mod:	'[' ']'

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