Skip to content

Commit 78c9639

Browse files
committed
Auto merge of #84618 - lrh2000:fix-gdb-10-str, r=Mark-Simulacrum
Fix failed tests related to pointer printing when using GDB 10 As mentioned in #79009, there are four failed debuginfo test cases when using GDB 10. This PR 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]: #79009 (comment)
2 parents d337cec + e8e5a88 commit 78c9639

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)