From eff9c3e636220ad8610d42d696a36a3a3f68dbfb Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Mon, 30 Jul 2012 17:45:37 +0000 Subject: [PATCH] * linespec.c (linespec_lex_number): A number followed by quotes is a valid number, too. * gdb.linespec/ls-errs.exp: Check some quote-enclosed linespecs. --- gdb/ChangeLog | 5 +++++ gdb/linespec.c | 5 +++-- gdb/testsuite/gdb.linespec/ls-errs.exp | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 00411df18cf..3bc3450157c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-07-30 Keith Seitz + + * linespec.c (linespec_lex_number): A number followed + by quotes is a valid number, too. + 2012-07-30 Tom Tromey * remote-sim.c (gdb_os_poll_quit): Don't check immediate_quit. diff --git a/gdb/linespec.c b/gdb/linespec.c index 3d7f62fd348..51994c8c6fe 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; diff --git a/gdb/testsuite/gdb.linespec/ls-errs.exp b/gdb/testsuite/gdb.linespec/ls-errs.exp index 7db8ae4f7b0..5668397a3b0 100644 --- a/gdb/testsuite/gdb.linespec/ls-errs.exp +++ b/gdb/testsuite/gdb.linespec/ls-errs.exp @@ -146,6 +146,8 @@ add the_tests "$srcfile:3 foo" unexpected_opt "string" "foo" foreach x $invalid_offsets { add the_tests "$srcfile:$x" invalid_offset_f $x $srcfile + add the_tests "\"$srcfile:$x\"" invalid_offset_f $x $srcfile + add the_tests "'$srcfile:$x'" invalid_offset_f $x $srcfile } # Test invalid filespecs starting with function. -- 2.30.2