]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Fix gdb.ada/verylong.exp on 32-bit target
authorTom de Vries <tdevries@suse.de>
Tue, 2 Apr 2024 14:14:39 +0000 (16:14 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 2 Apr 2024 14:14:39 +0000 (16:14 +0200)
commitd16a53152cc2dfd6e92fdf9ae288ff19dac49dd1
treeae73b7e9dc7d38bacb699708d7863918e0cb791d
parent121a3f4b4f4aac216abe239f6f3bd491b63e5e34
[gdb/testsuite] Fix gdb.ada/verylong.exp on 32-bit target

In an aarch32-linux chroot on an aarch64-linux system, I run into:
...
(gdb) print x^M
$1 = 9223372036854775807^M
(gdb) FAIL: gdb.ada/verylong.exp: print x
...

A passing version on aarch64-linux looks like:
...
(gdb) print x^M
$1 = 170141183460469231731687303715884105727^M
(gdb) PASS: gdb.ada/verylong.exp: print x
...

The difference is caused by the size of the type Long_Long_Long_Integer, which
is:
- a 128-bit signed on 64-bit targets, and
- a 64-bit signed on 32-bit target.

Fix this by detecting the size of the Long_Long_Long_Integer type, and
handling it.

Tested on aarch64-linux and aarch32-linux.

Approved-By: Tom Tromey <tom@tromey.com>
PR testsuite/31574
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31574

[1] https://gcc.gnu.org/onlinedocs/gnat_rm/Implementation-Defined-Characteristics.html
gdb/testsuite/gdb.ada/verylong.exp