3 // === GDB TESTS ===================================================================================
8 // gdbg-check:$1 = {data_ptr = [...], length = 4}
9 // gdbr-check:$1 = &unsized::Foo<[u8]> {data_ptr: [...], length: 4}
11 // gdb-command:print b
12 // gdbg-check:$2 = {data_ptr = [...], length = 4}
13 // gdbr-check:$2 = &unsized::Foo<unsized::Foo<[u8]>> {data_ptr: [...], length: 4}
15 // gdb-command:print c
16 // gdbg-check:$3 = {pointer = [...], vtable = [...]}
17 // gdbr-check:$3 = &unsized::Foo<dyn core::fmt::Debug> {pointer: [...], vtable: [...]}
19 // === CDB TESTS ===================================================================================
23 // cdb-check:a [Type: ref$<unsized::Foo<slice$<u8> > >]
24 // cdb-check: [+0x000] data_ptr : 0x[...] [Type: unsized::Foo<slice$<u8> > *]
25 // cdb-check: [...] length : 0x4 [Type: unsigned [...]int[...]
28 // cdb-check:b [Type: ref$<unsized::Foo<unsized::Foo<slice$<u8> > > >]
29 // cdb-check: [+0x000] data_ptr : 0x[...] [Type: unsized::Foo<unsized::Foo<slice$<u8> > > *]
30 // cdb-check: [...] length : 0x4 [Type: unsigned [...]int[...]
33 // cdb-check:c [Type: ref$<unsized::Foo<dyn$<core::fmt::Debug> > >]
34 // cdb-check: [+0x000] pointer : 0x[...] [Type: unsized::Foo<dyn$<core::fmt::Debug> > *]
35 // cdb-check: [...] vtable : 0x[...] [Type: unsigned [...]int[...] (*)[3]]
37 #![feature(omit_gdb_pretty_printer_section)]
38 #![omit_gdb_pretty_printer_section]
40 struct Foo<T: ?Sized> {
45 let foo: Foo<Foo<[u8; 4]>> = Foo { value: Foo { value: *b"abc\0" } };
47 // We expect `a`, `b`, and `c` to all be fat pointers.
48 // `a` and `b` should be slice-like and thus have a `data_ptr` and `length` field.
49 // `c` should be trait-object-like and thus have a `pointer` and `vtable` field.
50 let a: &Foo<[u8]> = &foo.value;
51 let b: &Foo<Foo<[u8]>> = &foo;
52 let c: &Foo<dyn std::fmt::Debug> = &Foo { value: 7i32 };