diff options
author | Fred Fish <fnf@specifix.com> | 1992-06-09 06:09:33 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1992-06-09 06:09:33 +0000 |
commit | d630b6150e32d305c88eadb18f27785e5a7ee14d (patch) | |
tree | 20e2c7e78117137644d98b62e184b2d9c23501a0 /gdb/c-exp.y | |
parent | d9915ebc4745f7f9f003db4602377e1b946e5a57 (diff) | |
download | gdb-d630b6150e32d305c88eadb18f27785e5a7ee14d.zip gdb-d630b6150e32d305c88eadb18f27785e5a7ee14d.tar.gz gdb-d630b6150e32d305c88eadb18f27785e5a7ee14d.tar.bz2 |
* c-exp.y (yylex): Recognize single-quoted strings that specify
tokens with embedded whitespace, such as C++ demangled names.
* defs.h (demangle_and_match, strcmp_iw, skip_quoted): Prototypes.
* main.c (gdb_completer_quote_characters): Add global variable.
* main.c (symbol_completion_function): Total rewrite for C++
demangled name handling.
* main.c (skip_quoted): New function.
* main.c (main): Set rl_completer_quote_characters.
* symmisc.c (dump_symtab): Print source language for symtab.
* symtab.c (expensive_mangler): Add prototype and function.
* symtab.c (completion_list_add_symbol): Total rewrite for new
C++ demangled name handling.
* symtab.c (lookup_symbol): Check for demangled C++ symbol first,
other changes for demangled C++ symbol handling.
* symtab.c (lookup_demangled_block_symbol): Use demangle_and_match.
* symtab.c (lookup_demangled_partial_symbol): Use demangle_and_match.
* symtab.c (decode_line_1): Recognize C++ demangled names on input.
* symtab.c (completion_list_add_symbol): Total rewrite for new
C++ demangled name handling.
* symtab.c (expensive_mangler): New function.
* utils.c (strcmp_iw, demangle_and_match): New functions.
* xcoffread.c (aixcoff_symfile_read): Fix prototype.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 1ef8764..e16f409 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1112,6 +1112,9 @@ yylex () goto retry; case '\'': + /* We either have a character constant ('0' or '\177' for example) + or we have a quoted symbol reference ('foo(int,int)' in C++ + for example). */ lexptr++; c = *lexptr++; if (c == '\\') @@ -1119,7 +1122,17 @@ yylex () yylval.lval = c; c = *lexptr++; if (c != '\'') - error ("Invalid character constant."); + { + namelen = skip_quoted (tokstart) - tokstart; + if (namelen > 2) + { + lexptr = tokstart + namelen; + namelen -= 2; + tokstart++; + goto tryname; + } + error ("Invalid character constant."); + } return CHAR; case '(': @@ -1272,6 +1285,7 @@ yylex () and $$digits (equivalent to $<-digits> if you could type that). Make token type LAST, and put the number (the digits) in yylval. */ + tryname: if (*tokstart == '$') { register int negate = 0; |