diff options
| author | bors <bors@rust-lang.org> | 2022-03-20 04:31:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-03-20 04:31:23 +0000 |
| commit | 499d4a56840e3760905fbda95550553281828dc6 (patch) | |
| tree | 36f8cd7583bd2d446d63a60bbd0aab4a65f39108 /src/test/debuginfo | |
| parent | 183090f775b058c3f1006b92eb4186c8af101aa7 (diff) | |
| parent | 789eb08147d0f89b8cf6fbe04dbea1a4c81d7c42 (diff) | |
| download | rust-499d4a56840e3760905fbda95550553281828dc6.tar.gz rust-499d4a56840e3760905fbda95550553281828dc6.zip | |
Auto merge of #95063 - tromey:fix-94458-gdb-char, r=Mark-Simulacrum
Fix debuginfo tests with GDB 11.2 GDB 11.2 added support for DW_ATE_UTF, which caused some test failures. This fixes these tests by changing the format that is used, and adds a new test to verify that characters are emitted as something that GDB can print in a char-like way. Fixes #94458
Diffstat (limited to 'src/test/debuginfo')
| -rw-r--r-- | src/test/debuginfo/borrowed-basic.rs | 5 | ||||
| -rw-r--r-- | src/test/debuginfo/borrowed-unique-basic.rs | 5 | ||||
| -rw-r--r-- | src/test/debuginfo/gdb-char.rs | 23 |
3 files changed, 25 insertions, 8 deletions
diff --git a/src/test/debuginfo/borrowed-basic.rs b/src/test/debuginfo/borrowed-basic.rs index b4bb7c146d9..45f5df228e3 100644 --- a/src/test/debuginfo/borrowed-basic.rs +++ b/src/test/debuginfo/borrowed-basic.rs @@ -1,6 +1,3 @@ -// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only -// its numerical value. - // compile-flags:-g // min-lldb-version: 310 @@ -13,7 +10,7 @@ // gdb-command:print *int_ref // gdb-check:$2 = -1 -// gdb-command:print *char_ref +// gdb-command:print/d *char_ref // gdb-check:$3 = 97 // gdb-command:print *i8_ref diff --git a/src/test/debuginfo/borrowed-unique-basic.rs b/src/test/debuginfo/borrowed-unique-basic.rs index f38cbc10dd3..94229bf27f3 100644 --- a/src/test/debuginfo/borrowed-unique-basic.rs +++ b/src/test/debuginfo/borrowed-unique-basic.rs @@ -1,8 +1,5 @@ // min-lldb-version: 310 -// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only -// its numerical value. - // compile-flags:-g // === GDB TESTS =================================================================================== @@ -15,7 +12,7 @@ // gdb-command:print *int_ref // gdb-check:$2 = -1 -// gdb-command:print *char_ref +// gdb-command:print/d *char_ref // gdb-check:$3 = 97 // gdb-command:print/d *i8_ref diff --git a/src/test/debuginfo/gdb-char.rs b/src/test/debuginfo/gdb-char.rs new file mode 100644 index 00000000000..1863405bf1e --- /dev/null +++ b/src/test/debuginfo/gdb-char.rs @@ -0,0 +1,23 @@ +// GDB got support for DW_ATE_UTF in 11.2, see +// https://sourceware.org/bugzilla/show_bug.cgi?id=28637. + +// min-gdb-version: 11.2 +// compile-flags: -g + +// === GDB TESTS =================================================================================== + +// gdb-command:run +// gdb-command:print ch +// gdb-check:$1 = 97 'a' + +#![allow(unused_variables)] +#![feature(omit_gdb_pretty_printer_section)] +#![omit_gdb_pretty_printer_section] + +fn main() { + let ch: char = 'a'; + + zzz(); // #break +} + +fn zzz() {()} |
