aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c8
1 files changed, 5 insertions, 3 deletions
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--;
}