From: Keith Seitz <keiths@redhat.com>
To: "gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Cc: asmwarrior@gmail.com
Subject: [RFA] Fix number lexing, again
Date: Mon, 30 Jul 2012 16:38:00 -0000 [thread overview]
Message-ID: <5016B87B.8070004@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 675 bytes --]
Hi,
As someone pointed out, I did not fix all the corner cases with
linespec_lexer_lex_number. [See
http://sourceware.org/ml/gdb/2012-07/msg00078.html - the issue affects
all platforms]
Since it is still quite common for MI-based UIs to quote the entire
linespec, we need to terminate numbers successfully on any quotation.
While the list of growing terminations for the string is getting
tediously long, I don't think inverting the test would be any
shorter/clearer. WDYT?
Keith
PS. Also recommending this for 7.5.
ChangeLog
2012-07-30 Keith Seitz <keiths@redhat.com>
* linespec.c (linespec_lex_number): A number followed
by quotes is a valid number, too.
[-- Attachment #2: lex_number-quotes.patch --]
[-- Type: text/x-patch, Size: 782 bytes --]
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 3d7f62f..51994c8 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -391,10 +391,11 @@ linespec_lexer_lex_number (linespec_parser *parser, linespec_token *tokenp)
}
/* If the next character in the input buffer is not a space, comma,
- or colon, this input does not represent a number. */
+ quote, or colon, this input does not represent a number. */
if (*PARSER_STREAM (parser) != '\0'
&& !isspace (*PARSER_STREAM (parser)) && *PARSER_STREAM (parser) != ','
- && *PARSER_STREAM (parser) != ':')
+ && *PARSER_STREAM (parser) != ':'
+ && !strchr (linespec_quote_characters, *PARSER_STREAM (parser)))
{
PARSER_STREAM (parser) = LS_TOKEN_STOKEN (*tokenp).ptr;
return 0;
next reply other threads:[~2012-07-30 16:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-30 16:38 Keith Seitz [this message]
2012-07-30 16:42 ` Keith Seitz
2012-07-30 17:13 ` Tom Tromey
2012-07-30 18:06 ` Keith Seitz
2012-07-30 22:45 ` asmwarrior
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=5016B87B.8070004@redhat.com \
--to=keiths@redhat.com \
--cc=asmwarrior@gmail.com \
--cc=gdb-patches@sourceware.org \
/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