aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-01-11 17:58:16 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-01-11 17:58:16 +0000
commitb5cfddf53bc50bebe17c82cb8352b6fa08b27cdd (patch)
tree815f5c9092d8635e7fc054dca4d533b53bb1cd18 /gdb/c-exp.y
parente0ae4240662bc4d1f9ec5e121897878e1195aed2 (diff)
downloadgdb-b5cfddf53bc50bebe17c82cb8352b6fa08b27cdd.zip
gdb-b5cfddf53bc50bebe17c82cb8352b6fa08b27cdd.tar.gz
gdb-b5cfddf53bc50bebe17c82cb8352b6fa08b27cdd.tar.bz2
gdb/
Implement binary numbers parsing. * c-exp.y (parse_number): New case 'b' and 'B'. gdb/testsuite/ Implement binary numbers parsing. * gdb.base/printcmds.exp (test_integer_literals_accepted) (test_integer_literals_rejected): New binary tests.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index ba5fddc..2ea5c6f 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1411,6 +1411,16 @@ parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
}
break;
+ case 'b':
+ case 'B':
+ if (len >= 3)
+ {
+ p += 2;
+ base = 2;
+ len -= 2;
+ }
+ break;
+
case 't':
case 'T':
case 'd':