]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* linespec.c (linespec_lex_number): A number followed
authorKeith Seitz <keiths@redhat.com>
Mon, 30 Jul 2012 18:03:58 +0000 (18:03 +0000)
committerKeith Seitz <keiths@redhat.com>
Mon, 30 Jul 2012 18:03:58 +0000 (18:03 +0000)
by quotes is a valid number, too.

* gdb.linespec/ls-errs.exp: Check some quote-enclosed
linespecs.

gdb/ChangeLog
gdb/linespec.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.linespec/ls-errs.exp

index d48c8afd9d18ea8345d9d4ce7a5ccf988242dd05..fdb66eb96b7ccac906c1a6274704e5e90fabfaa9 100644 (file)
@@ -1,3 +1,8 @@
+2012-07-30  Keith Seitz  <keiths@redhat.com>
+
+       * linespec.c (linespec_lexer_lex_number): A number followed
+       by quotes is a valid number, too.
+
 2012-07-26  Keith Seitz  <keiths@redhat.com>
 
        * linespec.c (linespec_lexer_lex_number): The input
index 861d8ddaaea719427c33ab37fdb73bf329ab44d4..c9b7ecc009376141d400052f015534cf6d4bb623 100644 (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, 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;
index dcad2008f8562bb011dd4977c0b5ee728d7f35cc..534d5e99bec4daab6dbd83d99588fd2fef496400 100644 (file)
@@ -1,3 +1,8 @@
+2012-07-30  Keith Seitz  <keiths@redhat.com>
+
+       * gdb.linespec/ls-errs.exp: Check some quote-enclosed
+       linespecs.
+
 2012-07-30  Doug Evans  <dje@google.com>
 
        * gdb.dwarf2/fission-reread.S: Use .data instead of .bss.
index 7db8ae4f7b0c0b8007938d161ac431d53fb74e42..5668397a3b054d12a9a31385513e2fb27e26a46b 100644 (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.