On aarch64, I run into: ... (gdb) print 16#ffffffffffffffff#^M $7 = 18446744073709551615^M (gdb) FAIL: gdb.ada/literals.exp: print 16#ffffffffffffffff# ... On x86_64 instead, I get: ... (gdb) print 16#ffffffffffffffff#^M $7 = -1^M (gdb) PASS: gdb.ada/literals.exp: print 16#ffffffffffffffff# ... I can reproduce this on x86_64-linux using: ... $ gdb -q -batch -ex "set lang ada" -ex "set arch i386" -ex "print 16#ffffffffffffffff#" The target architecture is set to "i386". $1 = -1 $ gdb -q -batch -ex "set lang ada" -ex "set arch aarch64" -ex "print 16#ffffffffffffffff#" The target architecture is set to "aarch64". $1 = 18446744073709551615 ...
With i386, we have: ... (gdb) p int_bits $3 = 32 (gdb) p long_bits $4 = 32 (gdb) p long_long_bits $5 = 64 ... so in processInt we hit the fits-in-unsigned-long-long case where we use as type long long, so we have: ... /* Note: Interprets ULLONG_MAX as -1. */ yylval.typed_val.type = type_long_long (par_state); ... With aarch64, we have: ... (gdb) p int_bits $1 = 32 (gdb) p long_bits $2 = 64 (gdb) p long_long_bits $3 = 64 ... so in processInt we hit the fits-in-unsigned-long case and we use type unsigned long: ... yylval.typed_val.type = builtin_type (par_state->gdbarch ())->builtin_unsigned_long; ... This explains the difference between the two results.
https://sourceware.org/pipermail/gdb-patches/2022-July/191107.html
Status: waiting for Joel / adacore to come back to say how they want it fixed ( https://sourceware.org/pipermail/gdb-patches/2022-July/191129.html ).
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=61b9faef51ddd40f9e6de0e41b66c41cd943d868