aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/symtab.c33
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';