1 // Caveats - gdb prints any 8-bit value (meaning rust i8 and u8 values)
2 // as its numerical value along with its associated ASCII char, there
3 // doesn't seem to be any way around this. Also, gdb doesn't know
4 // about UTF-32 character encoding and will print a rust char as only
5 // its numerical value.
7 // min-lldb-version: 310
9 // This fails on lldb 6.0.1 on x86-64 Fedora 28; so ignore Linux for now.
12 // This started failing in windows too. See https://github.com/rust-lang/rust/issues/88796
13 // FIXME: fix and unignore this on windows
18 // === GDB TESTS ===================================================================================
21 // gdb-command:print b
22 // gdb-check:$1 = false
23 // gdb-command:print i
25 // gdb-command:print c
27 // gdbr-check:$3 = 97 'a'
28 // gdb-command:print/d i8
30 // gdb-command:print i16
32 // gdb-command:print i32
34 // gdb-command:print i64
36 // gdb-command:print u
38 // gdb-command:print/d u8
40 // gdb-command:print u16
42 // gdb-command:print u32
44 // gdb-command:print u64
46 // gdb-command:print f32
47 // gdb-check:$13 = 2.5
48 // gdb-command:print f64
49 // gdb-check:$14 = 3.5
50 // gdb-command:print s
51 // gdbg-check:$15 = {data_ptr = [...] "Hello, World!", length = 13}
52 // gdbr-check:$15 = "Hello, World!"
55 // === LLDB TESTS ==================================================================================
58 // lldb-command:print b
59 // lldbg-check:[...]$0 = false
60 // lldbr-check:(bool) b = false
61 // lldb-command:print i
62 // lldbg-check:[...]$1 = -1
63 // lldbr-check:(isize) i = -1
65 // NOTE: only rust-enabled lldb supports 32bit chars
66 // lldbr-command:print c
67 // lldbr-check:(char) c = 'a'
69 // lldb-command:print i8
70 // lldbg-check:[...]$2 = 'D'
71 // lldbr-check:(i8) i8 = 68
72 // lldb-command:print i16
73 // lldbg-check:[...]$3 = -16
74 // lldbr-check:(i16) i16 = -16
75 // lldb-command:print i32
76 // lldbg-check:[...]$4 = -32
77 // lldbr-check:(i32) i32 = -32
78 // lldb-command:print i64
79 // lldbg-check:[...]$5 = -64
80 // lldbr-check:(i64) i64 = -64
81 // lldb-command:print u
82 // lldbg-check:[...]$6 = 1
83 // lldbr-check:(usize) u = 1
84 // lldb-command:print u8
85 // lldbg-check:[...]$7 = 'd'
86 // lldbr-check:(u8) u8 = 100
87 // lldb-command:print u16
88 // lldbg-check:[...]$8 = 16
89 // lldbr-check:(u16) u16 = 16
90 // lldb-command:print u32
91 // lldbg-check:[...]$9 = 32
92 // lldbr-check:(u32) u32 = 32
93 // lldb-command:print u64
94 // lldbg-check:[...]$10 = 64
95 // lldbr-check:(u64) u64 = 64
96 // lldb-command:print f32
97 // lldbg-check:[...]$11 = 2.5
98 // lldbr-check:(f32) f32 = 2.5
99 // lldb-command:print f64
100 // lldbg-check:[...]$12 = 3.5
101 // lldbr-check:(f64) f64 = 3.5
104 // === CDB TESTS ===================================================================================
108 // cdb-check:b : false [Type: bool]
110 // cdb-check:i : -1 [Type: [...]]
111 // The variable 'c' doesn't appear for some reason...
113 // cdb-check:i8 : 68 [Type: char]
114 // cdb-command:dx i16
115 // cdb-check:i16 : -16 [Type: short]
116 // cdb-command:dx i32
117 // cdb-check:i32 : -32 [Type: int]
118 // cdb-command:dx i64
119 // cdb-check:i64 : -64 [Type: __int64]
121 // cdb-check:u : 0x1 [Type: [...]]
123 // cdb-check:u8 : 0x64 [Type: unsigned char]
124 // cdb-command:dx u16
125 // cdb-check:u16 : 0x10 [Type: unsigned short]
126 // cdb-command:dx u32
127 // cdb-check:u32 : 0x20 [Type: unsigned int]
128 // cdb-command:dx u64
129 // cdb-check:u64 : 0x40 [Type: unsigned __int64]
130 // cdb-command:dx f32
131 // cdb-check:f32 : 2.500000 [Type: float]
132 // cdb-command:dx f64
133 // cdb-check:f64 : 3.500000 [Type: double]
134 // cdb-command:.enable_unicode 1
136 // cdb-check:s : "Hello, World!" [Type: str]
138 #![allow(unused_variables)]
139 #![feature(omit_gdb_pretty_printer_section)]
140 #![omit_gdb_pretty_printer_section]
157 let s: &str = "Hello, World!";