about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorlrh2000 <lrh2000@pku.edu.cn>2021-04-27 23:07:36 +0800
committerlrh2000 <lrh2000@pku.edu.cn>2021-04-27 23:07:36 +0800
commite8e5a884ad9d6d1f7f0091cde961d462e17765eb (patch)
treeeafccb7a13a115ffd5864aae2ccdeaa74912ab81 /src/test
parentdc8cb63078c1322cef0ac11c2f8b006f6e310a46 (diff)
downloadrust-e8e5a884ad9d6d1f7f0091cde961d462e17765eb.tar.gz
rust-e8e5a884ad9d6d1f7f0091cde961d462e17765eb.zip
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 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]: https://github.com/rust-lang/rust/issues/79009#issuecomment-826952708
Diffstat (limited to 'src/test')
-rw-r--r--src/test/debuginfo/extern-c-fn.rs13
-rw-r--r--src/test/debuginfo/pretty-huge-vec.rs2
2 files changed, 7 insertions, 8 deletions
diff --git a/src/test/debuginfo/extern-c-fn.rs b/src/test/debuginfo/extern-c-fn.rs
index 5043e7d9b8a..17a452ec634 100644
--- a/src/test/debuginfo/extern-c-fn.rs
+++ b/src/test/debuginfo/extern-c-fn.rs
@@ -5,17 +5,16 @@
 // === GDB TESTS ===================================================================================
 // gdb-command:run
 
-// gdb-command:print s
-// gdbg-check:$1 = [...]"abcd"
-// gdbr-check:$1 = [...]"abcd\000"
+// gdb-command:printf "s = \"%s\"\n", s
+// gdb-check:s = "abcd"
 // gdb-command:print len
-// gdb-check:$2 = 20
+// gdb-check:$1 = 20
 // gdb-command:print local0
-// gdb-check:$3 = 19
+// gdb-check:$2 = 19
 // gdb-command:print local1
-// gdb-check:$4 = true
+// gdb-check:$3 = true
 // gdb-command:print local2
-// gdb-check:$5 = 20.5
+// gdb-check:$4 = 20.5
 
 // gdb-command:continue
 
diff --git a/src/test/debuginfo/pretty-huge-vec.rs b/src/test/debuginfo/pretty-huge-vec.rs
index cbd2278f7e2..67155b4e9f0 100644
--- a/src/test/debuginfo/pretty-huge-vec.rs
+++ b/src/test/debuginfo/pretty-huge-vec.rs
@@ -13,7 +13,7 @@
 // gdb-check:$1 = Vec(size=1000000000) = {[...]...}
 
 // gdb-command: print slice
-// gdb-check:$2 = &[u8] {data_ptr: [...]"\000", length: 1000000000}
+// gdb-check:$2 = &[u8] {data_ptr: [...], length: 1000000000}
 
 #![allow(unused_variables)]