diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-05-10 00:29:23 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-05-10 00:29:23 +0000 |
commit | 8120c9d5cc29f4321197b2b2d0ad9f3eca410dfc (patch) | |
tree | 512fefe555179039a9c2d3d7eecd709751e4382a | |
parent | d0965404a4d44c53ba5b741ac0562d34103b98fa (diff) | |
download | gdb-8120c9d5cc29f4321197b2b2d0ad9f3eca410dfc.zip gdb-8120c9d5cc29f4321197b2b2d0ad9f3eca410dfc.tar.gz gdb-8120c9d5cc29f4321197b2b2d0ad9f3eca410dfc.tar.bz2 |
2002-05-09 Elena Zannoni <ezannoni@redhat.com>
From Daniel Berlin <dan@cgsoftware.com>
* linespec.c (find_toplevel_char): '<' and '>' also increase and
decrease the depth we are at, in the case of templates.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/linespec.c | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6f9e14d..57c8afc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-05-09 Elena Zannoni <ezannoni@redhat.com> + + From Daniel Berlin <dan@cgsoftware.com> + * linespec.c (find_toplevel_char): '<' and '>' also increase and + decrease the depth we are at, in the case of templates. + 2002-05-09 Daniel Jacobowitz <drow@mvista.com> * mips-tdep.c (mips_float_register_type): New function. diff --git a/gdb/linespec.c b/gdb/linespec.c index cbfafcf..b9a772c 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -298,7 +298,9 @@ build_canonical_line_spec (struct symtab_and_line *sal, char *symname, /* Find an instance of the character C in the string S that is outside of all parenthesis pairs, single-quoted strings, and double-quoted - strings. */ + strings. Also, ignore the char within a template name, like a ',' + within foo<int, int>. */ + static char * find_toplevel_char (char *s, char c) { @@ -321,9 +323,9 @@ find_toplevel_char (char *s, char c) return scan; else if (*scan == '"' || *scan == '\'') quoted = *scan; - else if (*scan == '(') + else if (*scan == '(' || *scan == '<') depth++; - else if (*scan == ')' && depth > 0) + else if ((*scan == ')' || *scan == '>') && depth > 0) depth--; } |