From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Berlin To: gdb-patches@sources.redhat.com Subject: [RFA] linespec.c change to stop "malformed template specification" error Date: Tue, 22 May 2001 14:06:00 -0000 Message-id: <87ofsldrgr.fsf@dynamic-addr-83-177.resnet.rochester.edu> X-SW-Source: 2001-05/msg00417.html This error is cause by find_toplevel_char not knowing that '<' and '>' increase and decrease the depth we are at. The result is that if you say "break _Rb_tree", when it goes to look for a comma at the top level, it thinks it found one right after the "int", and temporarily truncates the string to '_Rb_tree * 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/src/src/gdb/linespec.c,v retrieving revision 1.11 diff -c -3 -p -r1.11 linespec.c *** linespec.c 2001/04/27 00:19:09 1.11 --- linespec.c 2001/05/22 20:58:12 *************** find_toplevel_char (char *s, char c) *** 274,282 **** return scan; else if (*scan == '"' || *scan == '\'') quoted = *scan; ! else if (*scan == '(') depth++; ! else if (*scan == ')' && depth > 0) depth--; } --- 274,282 ---- return scan; else if (*scan == '"' || *scan == '\'') quoted = *scan; ! else if (*scan == '(' || *scan == '<') depth++; ! else if ((*scan == ')' || *scan == '>') && depth > 0) depth--; } -- "In my house on the ceilings I have paintings of the rooms above... So I never have to go upstairs. "-Steven Wright