This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Remove a bogus C++ pointer-to-member case in parsers
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Tue, 1 Aug 2006 23:17:25 -0400
- Subject: [commit] Remove a bogus C++ pointer-to-member case in parsers
I'm trying to break up a large patch for improved pointer-to-member support
into logical pieces. I don't think I'm going to succeed; it's all pretty
tightly intertwined. But I shook it and this fell out.
The reference to builtin_int should tip you off that this code didn't make
much sense. We were parsing TYPE :: * as a pointer to member type, but in
fact it's nonsense; you need TYPE NAME :: *. This gave us such gems as:
(gdb) ptype float::*
type = int float::
This patch removes the incorrect case, and the useless copies of it in
Pascal and ObjC files. Tested x86_64-linux and committed.
--
Daniel Jacobowitz
CodeSourcery
2006-08-01 Daniel Jacobowitz <dan@codesourcery.com>
* c-exp.y (type): Remove incorrect pointer to member case.
* objc-exp.y (type): Likewise.
* p-exp.y (type): Likewise.
--- src.orig/gdb/c-exp.y 2006-08-01 18:17:22.000000000 -0400
+++ src/gdb/c-exp.y 2006-08-01 19:00:12.000000000 -0400
@@ -790,7 +790,7 @@ func_mod: '(' ')'
{ free ($2); $$ = 0; }
;
-/* We used to try to recognize more pointer to member types here, but
+/* We used to try to recognize pointer to member types here, but
that didn't work (shift/reduce conflicts meant that these rules never
got executed). The problem is that
int (foo::bar::baz::bizzle)
@@ -799,8 +799,6 @@ func_mod: '(' ')'
is a pointer to member type. Stroustrup loses again! */
type : ptype
- | typebase COLONCOLON '*'
- { $$ = lookup_member_type (builtin_type (current_gdbarch)->builtin_int, $1); }
;
typebase /* Implements (approximately): (type-qualifier)* type-specifier */
--- src.orig/gdb/objc-exp.y 2006-08-01 18:17:22.000000000 -0400
+++ src/gdb/objc-exp.y 2006-08-01 19:00:12.000000000 -0400
@@ -858,8 +858,6 @@ func_mod: '(' ')'
is a pointer to member type. Stroustrup loses again! */
type : ptype
- | typebase COLONCOLON '*'
- { $$ = lookup_member_type (builtin_type_int, $1); }
;
typebase /* Implements (approximately): (type-qualifier)* type-specifier. */
--- src.orig/gdb/p-exp.y 2006-08-01 18:17:22.000000000 -0400
+++ src/gdb/p-exp.y 2006-08-01 19:00:12.000000000 -0400
@@ -718,8 +718,6 @@ ptype : typebase
is a pointer to member type. Stroustrup loses again! */
type : ptype
- | typebase COLONCOLON '*'
- { $$ = lookup_member_type (builtin_type_int, $1); }
;
typebase /* Implements (approximately): (type-qualifier)* type-specifier */