This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] linespec.c old patch
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: drow at mvista dot com
- Date: Thu, 9 May 2002 20:27:40 -0400
- Subject: [PATCH] linespec.c old patch
This patch was approved but never got applied.
I am committing it now. DanJ, OK with you?
http://sources.redhat.com/ml/gdb-patches/2001-05/msg00417.html
Elena
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.
Index: linespec.c
===================================================================
RCS file: /cvs/uberbaum/gdb/linespec.c,v
retrieving revision 1.18
diff -u -p -r1.18 linespec.c
--- linespec.c 5 Apr 2002 22:04:41 -0000 1.18
+++ linespec.c 10 May 2002 00:23:43 -0000
@@ -298,7 +298,9 @@ build_canonical_line_spec (struct symtab
/* 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--;
}