Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Berlin <dan@cgsoftware.com>
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	[thread overview]
Message-ID: <87ofsldrgr.fsf@dynamic-addr-83-177.resnet.rochester.edu> (raw)

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<int, int>", 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<int,'
When we then proceed to go through the string, we see the "<", and
then go to find the end of the template name, and can't, because we've
truncated the string in the wrong place, and issue an error.

Cute, no?

--Dan


 2001-05-22  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/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


             reply	other threads:[~2001-05-22 14:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-22 14:06 Daniel Berlin [this message]
2001-06-06 16:09 ` Elena Zannoni
2001-06-06 17:00   ` Fernando Nasser
2001-06-06 21:00   ` Jim Blandy
2001-06-06 22:09     ` Daniel Berlin
2001-06-07  8:40       ` Jim Blandy
2001-06-07  8:47       ` macro-expanding expressions in GDB Jim Blandy
2001-06-07  9:01         ` Daniel Berlin
2001-06-07 11:52           ` Jim Blandy
2001-06-07 12:04             ` Daniel Berlin
2001-06-07 11:16         ` Stan Shebs
2001-06-06 23:36     ` [RFA] linespec.c change to stop "malformed template specification" error Daniel Berlin
2001-06-07  6:00     ` Fernando Nasser
2001-06-07  9:09       ` Jim Blandy
2001-06-07  7:40     ` Elena Zannoni
     [not found]       ` <nppucg1eq5.fsf@zwingli.cygnus.com>
2001-06-07  9:13         ` Daniel Berlin
2001-06-07 11:18           ` Jim Blandy
2001-06-07 11:35             ` Daniel Berlin
2001-06-07 15:22               ` Jim Blandy
2001-06-07 16:40                 ` Daniel Berlin
2001-06-07 10:27         ` Elena Zannoni
2001-06-07 12:30           ` Fernando Nasser
2001-06-07 15:14           ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ofsldrgr.fsf@dynamic-addr-83-177.resnet.rochester.edu \
    --to=dan@cgsoftware.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox