Skip to content

Commit 499d4a5

Browse files
committed
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
2 parents 183090f + 789eb08 commit 499d4a5

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

src/test/debuginfo/borrowed-basic.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
2-
// its numerical value.
3-
41
// compile-flags:-g
52
// min-lldb-version: 310
63

@@ -13,7 +10,7 @@
1310
// gdb-command:print *int_ref
1411
// gdb-check:$2 = -1
1512

16-
// gdb-command:print *char_ref
13+
// gdb-command:print/d *char_ref
1714
// gdb-check:$3 = 97
1815

1916
// gdb-command:print *i8_ref

src/test/debuginfo/borrowed-unique-basic.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// min-lldb-version: 310
22

3-
// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
4-
// its numerical value.
5-
63
// compile-flags:-g
74

85
// === GDB TESTS ===================================================================================
@@ -15,7 +12,7 @@
1512
// gdb-command:print *int_ref
1613
// gdb-check:$2 = -1
1714

18-
// gdb-command:print *char_ref
15+
// gdb-command:print/d *char_ref
1916
// gdb-check:$3 = 97
2017

2118
// gdb-command:print/d *i8_ref

src/test/debuginfo/gdb-char.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// GDB got support for DW_ATE_UTF in 11.2, see
2+
// https://sourceware.org/bugzilla/show_bug.cgi?id=28637.
3+
4+
// min-gdb-version: 11.2
5+
// compile-flags: -g
6+
7+
// === GDB TESTS ===================================================================================
8+
9+
// gdb-command:run
10+
// gdb-command:print ch
11+
// gdb-check:$1 = 97 'a'
12+
13+
#![allow(unused_variables)]
14+
#![feature(omit_gdb_pretty_printer_section)]
15+
#![omit_gdb_pretty_printer_section]
16+
17+
fn main() {
18+
let ch: char = 'a';
19+
20+
zzz(); // #break
21+
}
22+
23+
fn zzz() {()}

0 commit comments

Comments
 (0)