This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] Extend parse rules for const, volatile
- To: gdb-patches at sources dot redhat dot com
- Subject: [RFA] Extend parse rules for const, volatile
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Mon, 17 Sep 2001 15:53:24 -0700
- CC: jimb at redhat dot com
- Organization: Red Hat
[Jim, tapping you as someone knowledgeable]
The following change extends gdb's expression parser for types,
so that in addition to accepting casts of the form
(char const *)
it will also accept casts of the form
(char * const)
Note that it still doesn't do anything with the "const"
or "volatile" information -- it merely accepts the expr.
2001-09-17 Michael Snyder <msnyder@redhat.com>
* c-exp.y (ptype): New rules for CONST_KEYWORD, VOLATILE_KEYWORD.
Index: c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.4
diff -c -3 -p -r1.4 c-exp.y
*** c-exp.y 2001/03/06 08:21:06 1.4
--- c-exp.y 2001/09/17 22:47:36
*************** ptype : typebase
*** 731,737 ****
--- 731,741 ----
{ $$ = follow_types ($1); }
| typebase CONST_KEYWORD abs_decl
{ $$ = follow_types ($1); }
+ | typebase abs_decl CONST_KEYWORD
+ { $$ = follow_types ($1); }
| typebase VOLATILE_KEYWORD abs_decl
+ { $$ = follow_types ($1); }
+ | typebase abs_decl VOLATILE_KEYWORD
{ $$ = follow_types ($1); }
;