On irc, Pedro pointed out that Ada couldn't properly handle
0xffffffffffffffff. This used to work, but is a regression due to
some patches I wrote in the Ada lexer. This patch fixes the bug.
return FLOAT;
}
- gdb_mpz maxval (ULONGEST_MAX / base);
+ gdb_mpz maxval (ULONGEST_MAX);
if (mpz_cmp (result.val, maxval.val) > 0)
error (_("Integer literal out of range"));
- LONGEST value = result.as_integer<LONGEST> ();
+ ULONGEST value = result.as_integer<ULONGEST> ();
if ((value >> (gdbarch_int_bit (par_state->gdbarch ())-1)) == 0)
yylval.typed_val.type = type_int (par_state);
else if ((value >> (gdbarch_long_bit (par_state->gdbarch ())-1)) == 0)
gdb_test "print 16#ffff#" " = 65535"
gdb_test "print 16#f#e1" " = 240"
gdb_test "print 16#1#e10" " = 1099511627776"
+
+gdb_test "print/x 16#7fffffffffffffff#" " = 0x7fffffffffffffff"
+gdb_test "print 16#ffffffffffffffff#" " = -1"
set val "0xffffffffffffffff"
if {$lang == "ada"} {
- gdb_test "p/x $val" "Integer literal out of range"
+ gdb_test "p/x $val" " = 0xffffffffffffffff"
+ gdb_test "ptype $val" " = <8-byte integer>"
} elseif {$lang == "fortran"} {
gdb_test "p/x $val" " = 0xffffffff"
gdb_test "ptype $val" " = unsigned int"