aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-lang.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-05-08 19:38:13 +0200
committerTom de Vries <tdevries@suse.de>2022-05-08 19:38:13 +0200
commita1aaf801d5f0989ea0857dfd896830570603b523 (patch)
tree290de1857872d4e963d9d8ad91b38b0ec833a9f5 /gdb/rust-lang.c
parent603df41b467152a226419a8dd5949f98a746a86e (diff)
downloadgdb-a1aaf801d5f0989ea0857dfd896830570603b523.zip
gdb-a1aaf801d5f0989ea0857dfd896830570603b523.tar.gz
gdb-a1aaf801d5f0989ea0857dfd896830570603b523.tar.bz2
[gdb/testsuite] Fix gdb.cp/casts.exp with -m32
When running test-case gdb.cp/casts.exp with target board unix/-m32, I run into: ... (gdb) print (unsigned long long) &gd == gd_value^M $31 = false^M (gdb) FAIL: gdb.cp/casts.exp: print (unsigned long long) &gd == gd_value ... With some additional printing, we can see in more detail why the comparison fails: ... (gdb) print /x &gd^M $31 = 0xffffc5c8^M (gdb) PASS: gdb.cp/casts.exp: print /x &gd print /x (unsigned long long)&gd^M $32 = 0xffffc5c8^M (gdb) PASS: gdb.cp/casts.exp: print /x (unsigned long long)&gd print /x gd_value^M $33 = 0xffffffffffffc5c8^M (gdb) PASS: gdb.cp/casts.exp: print /x gd_value print (unsigned long long) &gd == gd_value^M $34 = false^M (gdb) FAIL: gdb.cp/casts.exp: print (unsigned long long) &gd == gd_value ... The gd_value is set by this assignment: ... unsigned long long gd_value = (unsigned long long) &gd; ... The problem here is directly casting from a pointer to a non-pointer-sized integer. Fix this by adding an intermediate cast to std::uintptr_t. Tested on x86_64-linux with native and target board unix/-m32.
Diffstat (limited to 'gdb/rust-lang.c')
0 files changed, 0 insertions, 0 deletions