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.
14 // === GDB TESTS ===================================================================================
17 // gdb-command:print b
18 // gdb-check:$1 = false
19 // gdb-command:print i
21 // gdb-command:print c
23 // gdbr-check:$3 = 97 'a'
24 // gdb-command:print/d i8
26 // gdb-command:print i16
28 // gdb-command:print i32
30 // gdb-command:print i64
32 // gdb-command:print u
34 // gdb-command:print/d u8
36 // gdb-command:print u16
38 // gdb-command:print u32
40 // gdb-command:print u64
42 // gdb-command:print f32
43 // gdb-check:$13 = 2.5
44 // gdb-command:print f64
45 // gdb-check:$14 = 3.5
46 // gdb-command:print s
47 // gdbg-check:$15 = {data_ptr = [...] "Hello, World!", length = 13}
48 // gdbr-check:$15 = "Hello, World!"
51 // === LLDB TESTS ==================================================================================
54 // lldb-command:print b
55 // lldbg-check:[...]$0 = false
56 // lldbr-check:(bool) b = false
57 // lldb-command:print i
58 // lldbg-check:[...]$1 = -1
59 // lldbr-check:(isize) i = -1
61 // NOTE: only rust-enabled lldb supports 32bit chars
62 // lldbr-command:print c
63 // lldbr-check:(char) c = 'a'
65 // lldb-command:print i8
66 // lldbg-check:[...]$2 = 'D'
67 // lldbr-check:(i8) i8 = 68
68 // lldb-command:print i16
69 // lldbg-check:[...]$3 = -16
70 // lldbr-check:(i16) i16 = -16
71 // lldb-command:print i32
72 // lldbg-check:[...]$4 = -32
73 // lldbr-check:(i32) i32 = -32
74 // lldb-command:print i64
75 // lldbg-check:[...]$5 = -64
76 // lldbr-check:(i64) i64 = -64
77 // lldb-command:print u
78 // lldbg-check:[...]$6 = 1
79 // lldbr-check:(usize) u = 1
80 // lldb-command:print u8
81 // lldbg-check:[...]$7 = 'd'
82 // lldbr-check:(u8) u8 = 100
83 // lldb-command:print u16
84 // lldbg-check:[...]$8 = 16
85 // lldbr-check:(u16) u16 = 16
86 // lldb-command:print u32
87 // lldbg-check:[...]$9 = 32
88 // lldbr-check:(u32) u32 = 32
89 // lldb-command:print u64
90 // lldbg-check:[...]$10 = 64
91 // lldbr-check:(u64) u64 = 64
92 // lldb-command:print f32
93 // lldbg-check:[...]$11 = 2.5
94 // lldbr-check:(f32) f32 = 2.5
95 // lldb-command:print f64
96 // lldbg-check:[...]$12 = 3.5
97 // lldbr-check:(f64) f64 = 3.5
100 // === CDB TESTS ===================================================================================
104 // cdb-check:b : false [Type: bool]
106 // cdb-check:i : -1 [Type: [...]]
108 // cdb-check:c : 0x61 'a' [Type: char32_t]
110 // cdb-check:i8 : 68 [Type: char]
111 // cdb-command:dx i16
112 // cdb-check:i16 : -16 [Type: short]
113 // cdb-command:dx i32
114 // cdb-check:i32 : -32 [Type: int]
115 // cdb-command:dx i64
116 // cdb-check:i64 : -64 [Type: __int64]
118 // cdb-check:u : 0x1 [Type: [...]]
120 // cdb-check:u8 : 0x64 [Type: unsigned char]
121 // cdb-command:dx u16
122 // cdb-check:u16 : 0x10 [Type: unsigned short]
123 // cdb-command:dx u32
124 // cdb-check:u32 : 0x20 [Type: unsigned int]
125 // cdb-command:dx u64
126 // cdb-check:u64 : 0x40 [Type: unsigned __int64]
127 // cdb-command:dx f32
128 // cdb-check:f32 : 2.500000 [Type: float]
129 // cdb-command:dx f64
130 // cdb-check:f64 : 3.500000 [Type: double]
131 // cdb-command:.enable_unicode 1
132 // FIXME(#88840): The latest version of the Windows SDK broke the visualizer for str.
134 // cdb-check:s : [...] [Type: str]
136 #![allow(unused_variables)]
137 #![feature(omit_gdb_pretty_printer_section)]
138 #![omit_gdb_pretty_printer_section]
155 let s: &str = "Hello, World!";