Skip to content

Commit e8e5a88

Browse files
committed
Fix failed tests related to pointer printing when using GDB 10
As mentioned in rust-lang#79009, there are four failed debuginfo test cases when using GDB 10. This commit fixes two of them, which fail because GDB 10 won't print pointers as string anymore. We can use `printf` as a workaround. It should work regardless of the version of GDB. Refer this [comment] for more details. [comment]: rust-lang#79009 (comment)
1 parent dc8cb63 commit e8e5a88

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/test/debuginfo/extern-c-fn.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
// === GDB TESTS ===================================================================================
66
// gdb-command:run
77

8-
// gdb-command:print s
9-
// gdbg-check:$1 = [...]"abcd"
10-
// gdbr-check:$1 = [...]"abcd\000"
8+
// gdb-command:printf "s = \"%s\"\n", s
9+
// gdb-check:s = "abcd"
1110
// gdb-command:print len
12-
// gdb-check:$2 = 20
11+
// gdb-check:$1 = 20
1312
// gdb-command:print local0
14-
// gdb-check:$3 = 19
13+
// gdb-check:$2 = 19
1514
// gdb-command:print local1
16-
// gdb-check:$4 = true
15+
// gdb-check:$3 = true
1716
// gdb-command:print local2
18-
// gdb-check:$5 = 20.5
17+
// gdb-check:$4 = 20.5
1918

2019
// gdb-command:continue
2120

src/test/debuginfo/pretty-huge-vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// gdb-check:$1 = Vec(size=1000000000) = {[...]...}
1414

1515
// gdb-command: print slice
16-
// gdb-check:$2 = &[u8] {data_ptr: [...]"\000", length: 1000000000}
16+
// gdb-check:$2 = &[u8] {data_ptr: [...], length: 1000000000}
1717

1818
#![allow(unused_variables)]
1919

0 commit comments

Comments
 (0)