Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH Bug breakpoints/14381] Fix linespec to parse file name that begin with decimal numbers
@ 2012-07-22  6:30 Hui Zhu
  2012-07-22  7:11 ` Jan Kratochvil
  2012-07-22 14:12 ` Keith Seitz
  0 siblings, 2 replies; 17+ messages in thread
From: Hui Zhu @ 2012-07-22  6:30 UTC (permalink / raw)
  To: gdb-patches ml; +Cc: Joel Brobecker

Hi,

This issue is because function linespec_lexer_lex_one handle the
string that begin with decimal numbers decimal numbers directly and
use linespec_lexer_lex_number handle it directly.
So when there are a file name that begin with decimal numbers, will a
lot of error around it.

I post a patch make linespec_lexer_lex_number if number followed by
non-space string, use linespec_lexer_lex_string handle linespec as a
string.

Joel, this issue affect 7.5.  Does this patch can add to 7.5 branch?

Thanks,
Hui

2012-07-22  Hui Zhu  <hui_zhu@mentor.com>

	* linespec.c (linespec_lexer_lex_number): Call
	linespec_lexer_lex_string if the number is followed by
	non-space string.

---
 linespec.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/linespec.c
+++ b/linespec.c
@@ -368,6 +368,8 @@ static const char *const linespec_quote_
 /* Lex a number from the input in PARSER.  This only supports
    decimal numbers.  */

+static linespec_token linespec_lexer_lex_string (linespec_parser *parser);
+
 static linespec_token
 linespec_lexer_lex_number (linespec_parser *parser)
 {
@@ -390,6 +392,12 @@ linespec_lexer_lex_number (linespec_pars
       ++(PARSER_STREAM (parser));
     }

+  if (*PARSER_STREAM (parser) != '\0' && !isspace(*PARSER_STREAM (parser)))
+    {
+      PARSER_STREAM (parser) = LS_TOKEN_STOKEN (token).ptr;
+      return linespec_lexer_lex_string (parser);
+    }
+
   return token;
 }


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

end of thread, other threads:[~2012-07-26 18:21 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-22  6:30 [PATCH Bug breakpoints/14381] Fix linespec to parse file name that begin with decimal numbers Hui Zhu
2012-07-22  7:11 ` Jan Kratochvil
2012-07-22  8:55   ` Hui Zhu
2012-07-22 10:11     ` Hui Zhu
2012-07-22 10:52       ` Jan Kratochvil
2012-07-23 14:26       ` Tom Tromey
2012-07-23 18:04         ` Keith Seitz
2012-07-22 14:12 ` Keith Seitz
2012-07-22 14:48   ` Hui Zhu
2012-07-23 14:28     ` Tom Tromey
2012-07-23 17:17       ` Keith Seitz
2012-07-24  3:48       ` Hui Zhu
2012-07-24 19:36         ` Tom Tromey
2012-07-25 12:57           ` Hui Zhu
2012-07-25 21:21             ` Keith Seitz
2012-07-26 13:52               ` Tom Tromey
2012-07-26 18:21                 ` Keith Seitz

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