summaryrefslogtreecommitdiff
path: root/gdb/cp-name-parser.y
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-09-21 20:01:10 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-09-21 20:01:10 +0000
commite4ee67cf2aa71e7f3918ea92b2313b0d15636c27 (patch)
treeb0d813ba68b444b62e9ee658a0c932ec43dc113e /gdb/cp-name-parser.y
parentcc0fa2ebc0d9e5290e24f09b94b69e9018a290fd (diff)
downloadgdb-e4ee67cf2aa71e7f3918ea92b2313b0d15636c27.tar.gz
gdb/
Fix internal error on canonicalization of clang types. * cp-name-parser.y (operator): New comment at make_operator call for new, delete, new[] and delete[]. (exp): Use "sizeof ". Add new comment at make_operator call. gdb/testsuite/ Fix internal error on canonicalization of clang types. * gdb.dwarf2/dw2-canonicalize-type.S: New file. * gdb.dwarf2/dw2-canonicalize-type.exp: New file. * lib/gdb.exp (gdb_file_cmd): Catch also GDB internal error.
Diffstat (limited to 'gdb/cp-name-parser.y')
-rw-r--r--gdb/cp-name-parser.y30
1 files changed, 25 insertions, 5 deletions
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
index 6767fa5fde5..c218244c9e8 100644
--- a/gdb/cp-name-parser.y
+++ b/gdb/cp-name-parser.y
@@ -446,13 +446,29 @@ demangler_special
;
operator : OPERATOR NEW
- { $$ = make_operator ("new", 3); }
+ {
+ /* Match the whitespacing of cplus_demangle_operators.
+ It would abort on unrecognized string otherwise. */
+ $$ = make_operator ("new", 3);
+ }
| OPERATOR DELETE
- { $$ = make_operator ("delete ", 1); }
+ {
+ /* Match the whitespacing of cplus_demangle_operators.
+ It would abort on unrecognized string otherwise. */
+ $$ = make_operator ("delete ", 1);
+ }
| OPERATOR NEW '[' ']'
- { $$ = make_operator ("new[]", 3); }
+ {
+ /* Match the whitespacing of cplus_demangle_operators.
+ It would abort on unrecognized string otherwise. */
+ $$ = make_operator ("new[]", 3);
+ }
| OPERATOR DELETE '[' ']'
- { $$ = make_operator ("delete[] ", 1); }
+ {
+ /* Match the whitespacing of cplus_demangle_operators.
+ It would abort on unrecognized string otherwise. */
+ $$ = make_operator ("delete[] ", 1);
+ }
| OPERATOR '+'
{ $$ = make_operator ("+", 2); }
| OPERATOR '-'
@@ -1183,7 +1199,11 @@ exp : FLOAT
;
exp : SIZEOF '(' type ')' %prec UNARY
- { $$ = d_unary ("sizeof", $3); }
+ {
+ /* Match the whitespacing of cplus_demangle_operators.
+ It would abort on unrecognized string otherwise. */
+ $$ = d_unary ("sizeof ", $3);
+ }
;
/* C++. */