From: Keith Seitz Date: Mon, 30 Jul 2012 18:03:58 +0000 (+0000) Subject: * linespec.c (linespec_lex_number): A number followed X-Git-Tag: gdb_7_5-2012-08-17-release~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c31c3339ff6446c8259939a4824d263b0075c0d;p=thirdparty%2Fbinutils-gdb.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d48c8afd9d1..fdb66eb96b7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-07-30 Keith Seitz + + * linespec.c (linespec_lexer_lex_number): A number followed + by quotes is a valid number, too. + 2012-07-26 Keith Seitz * linespec.c (linespec_lexer_lex_number): The input diff --git a/gdb/linespec.c b/gdb/linespec.c index 861d8ddaaea..c9b7ecc0093 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, the input does not represent a number. */ + quote, or colon, the 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/ChangeLog b/gdb/testsuite/ChangeLog index dcad2008f85..534d5e99bec 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-07-30 Keith Seitz + + * gdb.linespec/ls-errs.exp: Check some quote-enclosed + linespecs. + 2012-07-30 Doug Evans * gdb.dwarf2/fission-reread.S: Use .data instead of .bss. 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.