diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-09-21 20:01:12 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-09-21 20:01:12 +0000 |
commit | 04e7407c59ad047ff7df4084a904d29fbeb62315 (patch) | |
tree | 56752cc3165ee9c89e88b64046237cdb41342115 /gdb/cp-name-parser.y | |
parent | 9bf4bce9847504467f8af7e3c7886cce1794dbad (diff) | |
download | gdb-04e7407c59ad047ff7df4084a904d29fbeb62315.zip gdb-04e7407c59ad047ff7df4084a904d29fbeb62315.tar.gz gdb-04e7407c59ad047ff7df4084a904d29fbeb62315.tar.bz2 |
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.y | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y index 6767fa5..c218244 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++. */ |