From 7e6deb7a27c2939d7390a9fc71d52b1982454e69 Mon Sep 17 00:00:00 2001 From: Kung Hsu Date: Fri, 19 Nov 1993 19:13:41 +0000 Subject: [PATCH] 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. --- gdb/ChangeLog | 6 ++++++ gdb/symtab.c | 33 ++++++++++++++++++++++++++------- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 45c8b8402a6..af3ace2c95c 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 2d74466b340..32791492e2f 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'; -- 2.30.2