Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Fix number lexing, again
@ 2012-07-30 16:38 Keith Seitz
  2012-07-30 16:42 ` Keith Seitz
  2012-07-30 17:13 ` Tom Tromey
  0 siblings, 2 replies; 5+ messages in thread
From: Keith Seitz @ 2012-07-30 16:38 UTC (permalink / raw)
  To: gdb-patches@sourceware.org ml; +Cc: asmwarrior

[-- 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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-07-30 22:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-30 16:38 [RFA] Fix number lexing, again Keith Seitz
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox