* 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.
This commit is contained in:
Keith Seitz 2012-07-30 17:45:37 +00:00
parent 728400d769
commit eff9c3e636
3 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-07-30 Keith Seitz <keiths@redhat.com>
* linespec.c (linespec_lex_number): A number followed
by quotes is a valid number, too.
2012-07-30 Tom Tromey <tromey@redhat.com>
* remote-sim.c (gdb_os_poll_quit): Don't check immediate_quit.

View File

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

View File

@ -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.