1 // min-lldb-version: 310
5 // === GDB TESTS ===================================================================================
9 // gdb-command:print packed
10 // gdbg-check:$1 = {x = 123, y = 234, z = 345}
11 // gdbr-check:$1 = packed_struct_with_destructor::Packed {x: 123, y: 234, z: 345}
13 // gdb-command:print packedInPacked
14 // gdbg-check:$2 = {a = 1111, b = {x = 2222, y = 3333, z = 4444}, c = 5555, d = {x = 6666, y = 7777, z = 8888}}
15 // gdbr-check:$2 = packed_struct_with_destructor::PackedInPacked {a: 1111, b: packed_struct_with_destructor::Packed {x: 2222, y: 3333, z: 4444}, c: 5555, d: packed_struct_with_destructor::Packed {x: 6666, y: 7777, z: 8888}}
17 // gdb-command:print packedInUnpacked
18 // gdbg-check:$3 = {a = -1111, b = {x = -2222, y = -3333, z = -4444}, c = -5555, d = {x = -6666, y = -7777, z = -8888}}
19 // gdbr-check:$3 = packed_struct_with_destructor::PackedInUnpacked {a: -1111, b: packed_struct_with_destructor::Packed {x: -2222, y: -3333, z: -4444}, c: -5555, d: packed_struct_with_destructor::Packed {x: -6666, y: -7777, z: -8888}}
21 // gdb-command:print unpackedInPacked
22 // gdbg-check:$4 = {a = 987, b = {x = 876, y = 765, z = 654}, c = {x = 543, y = 432, z = 321}, d = 210}
23 // gdbr-check:$4 = packed_struct_with_destructor::UnpackedInPacked {a: 987, b: packed_struct_with_destructor::Unpacked {x: 876, y: 765, z: 654}, c: packed_struct_with_destructor::Unpacked {x: 543, y: 432, z: 321}, d: 210}
26 // gdb-command:print packedInPackedWithDrop
27 // gdbg-check:$5 = {a = 11, b = {x = 22, y = 33, z = 44}, c = 55, d = {x = 66, y = 77, z = 88}}
28 // gdbr-check:$5 = packed_struct_with_destructor::PackedInPackedWithDrop {a: 11, b: packed_struct_with_destructor::Packed {x: 22, y: 33, z: 44}, c: 55, d: packed_struct_with_destructor::Packed {x: 66, y: 77, z: 88}}
30 // gdb-command:print packedInUnpackedWithDrop
31 // gdbg-check:$6 = {a = -11, b = {x = -22, y = -33, z = -44}, c = -55, d = {x = -66, y = -77, z = -88}}
32 // gdbr-check:$6 = packed_struct_with_destructor::PackedInUnpackedWithDrop {a: -11, b: packed_struct_with_destructor::Packed {x: -22, y: -33, z: -44}, c: -55, d: packed_struct_with_destructor::Packed {x: -66, y: -77, z: -88}}
34 // gdb-command:print unpackedInPackedWithDrop
35 // gdbg-check:$7 = {a = 98, b = {x = 87, y = 76, z = 65}, c = {x = 54, y = 43, z = 32}, d = 21}
36 // gdbr-check:$7 = packed_struct_with_destructor::UnpackedInPackedWithDrop {a: 98, b: packed_struct_with_destructor::Unpacked {x: 87, y: 76, z: 65}, c: packed_struct_with_destructor::Unpacked {x: 54, y: 43, z: 32}, d: 21}
38 // gdb-command:print deeplyNested
39 // gdbg-check:$8 = {a = {a = 1, b = {x = 2, y = 3, z = 4}, c = 5, d = {x = 6, y = 7, z = 8}}, b = {a = 9, b = {x = 10, y = 11, z = 12}, c = {x = 13, y = 14, z = 15}, d = 16}, c = {a = 17, b = {x = 18, y = 19, z = 20}, c = 21, d = {x = 22, y = 23, z = 24}}, d = {a = 25, b = {x = 26, y = 27, z = 28}, c = 29, d = {x = 30, y = 31, z = 32}}, e = {a = 33, b = {x = 34, y = 35, z = 36}, c = {x = 37, y = 38, z = 39}, d = 40}, f = {a = 41, b = {x = 42, y = 43, z = 44}, c = 45, d = {x = 46, y = 47, z = 48}}}
40 // gdbr-check:$8 = packed_struct_with_destructor::DeeplyNested {a: packed_struct_with_destructor::PackedInPacked {a: 1, b: packed_struct_with_destructor::Packed {x: 2, y: 3, z: 4}, c: 5, d: packed_struct_with_destructor::Packed {x: 6, y: 7, z: 8}}, b: packed_struct_with_destructor::UnpackedInPackedWithDrop {a: 9, b: packed_struct_with_destructor::Unpacked {x: 10, y: 11, z: 12}, c: packed_struct_with_destructor::Unpacked {x: 13, y: 14, z: 15}, d: 16}, c: packed_struct_with_destructor::PackedInUnpacked {a: 17, b: packed_struct_with_destructor::Packed {x: 18, y: 19, z: 20}, c: 21, d: packed_struct_with_destructor::Packed {x: 22, y: 23, z: 24}}, d: packed_struct_with_destructor::PackedInUnpackedWithDrop {a: 25, b: packed_struct_with_destructor::Packed {x: 26, y: 27, z: 28}, c: 29, d: packed_struct_with_destructor::Packed {x: 30, y: 31, z: 32}}, e: packed_struct_with_destructor::UnpackedInPacked {a: 33, b: packed_struct_with_destructor::Unpacked {x: 34, y: 35, z: 36}, c: packed_struct_with_destructor::Unpacked {x: 37, y: 38, z: 39}, d: 40}, f: packed_struct_with_destructor::PackedInPackedWithDrop {a: 41, b: packed_struct_with_destructor::Packed {x: 42, y: 43, z: 44}, c: 45, d: packed_struct_with_destructor::Packed {x: 46, y: 47, z: 48}}}
43 // === LLDB TESTS ==================================================================================
47 // lldb-command:print packed
48 // lldbg-check:[...]$0 = { x = 123 y = 234 z = 345 }
49 // lldbr-check:(packed_struct_with_destructor::Packed) packed = { x = 123 y = 234 z = 345 }
51 // lldb-command:print packedInPacked
52 // lldbg-check:[...]$1 = { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } }
53 // lldbr-check:(packed_struct_with_destructor::PackedInPacked) packedInPacked = { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } }
55 // lldb-command:print packedInUnpacked
56 // lldbg-check:[...]$2 = { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } }
57 // lldbr-check:(packed_struct_with_destructor::PackedInUnpacked) packedInUnpacked = { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } }
59 // lldb-command:print unpackedInPacked
60 // lldbg-check:[...]$3 = { a = 987 b = { x = 876 y = 765 z = 654 } c = { x = 543 y = 432 z = 321 } d = 210 }
61 // lldbr-check:(packed_struct_with_destructor::UnpackedInPacked) unpackedInPacked = { a = 987 b = { x = 876 y = 765 z = 654 } c = { x = 543 y = 432 z = 321 } d = 210 }
63 // lldb-command:print packedInPackedWithDrop
64 // lldbg-check:[...]$4 = { a = 11 b = { x = 22 y = 33 z = 44 } c = 55 d = { x = 66 y = 77 z = 88 } }
65 // lldbr-check:(packed_struct_with_destructor::PackedInPackedWithDrop) packedInPackedWithDrop = { a = 11 b = { x = 22 y = 33 z = 44 } c = 55 d = { x = 66 y = 77 z = 88 } }
67 // lldb-command:print packedInUnpackedWithDrop
68 // lldbg-check:[...]$5 = { a = -11 b = { x = -22 y = -33 z = -44 } c = -55 d = { x = -66 y = -77 z = -88 } }
69 // lldbr-check:(packed_struct_with_destructor::PackedInUnpackedWithDrop) packedInUnpackedWithDrop = { a = -11 b = { x = -22 y = -33 z = -44 } c = -55 d = { x = -66 y = -77 z = -88 } }
71 // lldb-command:print unpackedInPackedWithDrop
72 // lldbg-check:[...]$6 = { a = 98 b = { x = 87 y = 76 z = 65 } c = { x = 54 y = 43 z = 32 } d = 21 }
73 // lldbr-check:(packed_struct_with_destructor::UnpackedInPackedWithDrop) unpackedInPackedWithDrop = { a = 98 b = { x = 87 y = 76 z = 65 } c = { x = 54 y = 43 z = 32 } d = 21 }
75 // lldb-command:print deeplyNested
76 // lldbg-check:[...]$7 = { a = { a = 1 b = { x = 2 y = 3 z = 4 } c = 5 d = { x = 6 y = 7 z = 8 } } b = { a = 9 b = { x = 10 y = 11 z = 12 } c = { x = 13 y = 14 z = 15 } d = 16 } c = { a = 17 b = { x = 18 y = 19 z = 20 } c = 21 d = { x = 22 y = 23 z = 24 } } d = { a = 25 b = { x = 26 y = 27 z = 28 } c = 29 d = { x = 30 y = 31 z = 32 } } e = { a = 33 b = { x = 34 y = 35 z = 36 } c = { x = 37 y = 38 z = 39 } d = 40 } f = { a = 41 b = { x = 42 y = 43 z = 44 } c = 45 d = { x = 46 y = 47 z = 48 } } }
77 // lldbr-check:(packed_struct_with_destructor::DeeplyNested) deeplyNested = { a = { a = 1 b = { x = 2 y = 3 z = 4 } c = 5 d = { x = 6 y = 7 z = 8 } } b = { a = 9 b = { x = 10 y = 11 z = 12 } c = { x = 13 y = 14 z = 15 } d = 16 } c = { a = 17 b = { x = 18 y = 19 z = 20 } c = 21 d = { x = 22 y = 23 z = 24 } } d = { a = 25 b = { x = 26 y = 27 z = 28 } c = 29 d = { x = 30 y = 31 z = 32 } } e = { a = 33 b = { x = 34 y = 35 z = 36 } c = { x = 37 y = 38 z = 39 } d = 40 } f = { a = 41 b = { x = 42 y = 43 z = 44 } c = 45 d = { x = 46 y = 47 z = 48 } } }
80 #![allow(unused_variables)]
81 #![feature(omit_gdb_pretty_printer_section)]
82 #![omit_gdb_pretty_printer_section]
91 impl Drop for Packed {
96 struct PackedInPacked {
103 struct PackedInUnpacked {
116 impl Drop for Unpacked {
117 fn drop(&mut self) {}
121 struct UnpackedInPacked {
129 struct PackedInPackedWithDrop {
136 impl Drop for PackedInPackedWithDrop {
137 fn drop(&mut self) {}
140 struct PackedInUnpackedWithDrop {
147 impl Drop for PackedInUnpackedWithDrop {
148 fn drop(&mut self) {}
152 struct UnpackedInPackedWithDrop {
159 impl Drop for UnpackedInPackedWithDrop {
160 fn drop(&mut self) {}
163 struct DeeplyNested {
165 b: UnpackedInPackedWithDrop,
167 d: PackedInUnpackedWithDrop,
169 f: PackedInPackedWithDrop
173 let packed = Packed { x: 123, y: 234, z: 345 };
175 let packedInPacked = PackedInPacked {
177 b: Packed { x: 2222, y: 3333, z: 4444 },
179 d: Packed { x: 6666, y: 7777, z: 8888 }
182 let packedInUnpacked = PackedInUnpacked {
184 b: Packed { x: -2222, y: -3333, z: -4444 },
186 d: Packed { x: -6666, y: -7777, z: -8888 }
189 let unpackedInPacked = UnpackedInPacked {
191 b: Unpacked { x: 876, y: 765, z: 654 },
192 c: Unpacked { x: 543, y: 432, z: 321 },
196 let packedInPackedWithDrop = PackedInPackedWithDrop {
198 b: Packed { x: 22, y: 33, z: 44 },
200 d: Packed { x: 66, y: 77, z: 88 }
203 let packedInUnpackedWithDrop = PackedInUnpackedWithDrop {
205 b: Packed { x: -22, y: -33, z: -44 },
207 d: Packed { x: -66, y: -77, z: -88 }
210 let unpackedInPackedWithDrop = UnpackedInPackedWithDrop {
212 b: Unpacked { x: 87, y: 76, z: 65 },
213 c: Unpacked { x: 54, y: 43, z: 32 },
217 let deeplyNested = DeeplyNested {
220 b: Packed { x: 2, y: 3, z: 4 },
222 d: Packed { x: 6, y: 7, z: 8 }
224 b: UnpackedInPackedWithDrop {
226 b: Unpacked { x: 10, y: 11, z: 12 },
227 c: Unpacked { x: 13, y: 14, z: 15 },
230 c: PackedInUnpacked {
232 b: Packed { x: 18, y: 19, z: 20 },
234 d: Packed { x: 22, y: 23, z: 24 }
236 d: PackedInUnpackedWithDrop {
238 b: Packed { x: 26, y: 27, z: 28 },
240 d: Packed { x: 30, y: 31, z: 32 }
242 e: UnpackedInPacked {
244 b: Unpacked { x: 34, y: 35, z: 36 },
245 c: Unpacked { x: 37, y: 38, z: 39 },
248 f: PackedInPackedWithDrop {
250 b: Packed { x: 42, y: 43, z: 44 },
252 d: Packed { x: 46, y: 47, z: 48 }