diff options
author | Kung Hsu <kung@cygnus> | 1993-11-19 19:13:41 +0000 |
---|---|---|
committer | Kung Hsu <kung@cygnus> | 1993-11-19 19:13:41 +0000 |
commit | 7e6deb7a27c2939d7390a9fc71d52b1982454e69 (patch) | |
tree | 700199a67c4e78efa9b79d33dd3f71e094e42afe /gdb | |
parent | 1562fc8325ea01c6395b38c248365db548e5033b (diff) | |
download | gdb-7e6deb7a27c2939d7390a9fc71d52b1982454e69.zip gdb-7e6deb7a27c2939d7390a9fc71d52b1982454e69.tar.gz gdb-7e6deb7a27c2939d7390a9fc71d52b1982454e69.tar.bz2 |
Modified Files:
ChangeLog symtab.c
* symtab.c(decode_line_1): fix the inconsistency of setting
breakpoint with '' or without them. The '' is needed when you
want name completion.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/symtab.c | 33 |
2 files changed, 32 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 45c8b84..af3ace2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Fri Nov 19 11:00:33 1993 Kung Hsu (kung@cirdan.cygnus.com) + + * symtab.c(decode_line_1): fix the inconsistency of setting + breakpoint with '' or without them. The '' is needed when you + want name completion. + Thu Nov 18 08:25:50 1993 Fred Fish (fnf@cygnus.com) * valprint.c (val_print_string): When looking for a null diff --git a/gdb/symtab.c b/gdb/symtab.c index 2d74466..3279149 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1684,7 +1684,7 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical) struct symtab_and_line val; #endif register char *p, *p1; - char *q, *q1; + char *q, *q1, *pp; register struct symtab *s; register struct symbol *sym; @@ -1696,7 +1696,7 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical) char *copy; struct symbol *sym_class; int i1; - int is_quoted; + int is_quoted, has_parens; struct symbol **sym_arr; struct type *t; char *saved_arg = *argptr; @@ -1731,19 +1731,31 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical) /* Maybe arg is FILE : LINENUM or FILE : FUNCTION */ s = NULL; - is_quoted = (strchr (gdb_completer_quote_characters, **argptr) != NULL); + is_quoted = (strchr(gdb_completer_quote_characters, **argptr) != NULL); + has_parens = (( pp = strchr(*argptr, '(')) != NULL && + (pp = strchr(pp, ')')) != NULL); for (p = *argptr; *p; p++) { + if (p[0] == '<') + { + while(!++p && *p != '>'); + if (!p) + { + warning("non-matching '<' and '>' in command"); + return_to_top_level (RETURN_ERROR); + } + } if (p[0] == ':' || p[0] == ' ' || p[0] == '\t') break; } while (p[0] == ' ' || p[0] == '\t') p++; - if ((p[0] == ':') && !is_quoted) + if ((p[0] == ':') && !has_parens) { /* C++ */ + if (is_quoted) *argptr = *argptr+1; if (p[1] ==':') { /* Extract the class name. */ @@ -1985,9 +1997,16 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical) /* Arg token is not digits => try it as a variable name Find the next token (everything up to end or next whitespace). */ - p = skip_quoted (*argptr); - if (is_quoted && p[-1] != '\'') - error ("Unmatched single quote."); + if (is_quoted) + { + p = skip_quoted (*argptr); + if (p[-1] != '\'') + error ("Unmatched single quote."); + } + else if (has_parens) + { + p = pp+1; + } copy = (char *) alloca (p - *argptr + 1); memcpy (copy, *argptr, p - *argptr); copy[p - *argptr] = '\0'; |