Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit de2dd3c

Browse files
committedApr 10, 2020
WIP: Fix LLDB pretty-printers tests
1 parent 1ddc308 commit de2dd3c

17 files changed

+153
-109
lines changed
 

‎src/ci/azure-pipelines/pr.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,25 @@ variables:
2121
- group: public-credentials
2222

2323
jobs:
24-
- job: Linux
24+
- job: macOS
2525
timeoutInMinutes: 600
2626
pool:
27-
vmImage: ubuntu-16.04
27+
vmImage: macos-10.15
2828
steps:
2929
- template: steps/run.yml
3030
strategy:
3131
matrix:
32-
x86_64-gnu-llvm-7: {}
33-
mingw-check: {}
34-
x86_64-gnu-tools:
35-
CI_ONLY_WHEN_SUBMODULES_CHANGED: 1
32+
# OSX builders running tests, these run the full test suite.
33+
# NO_DEBUG_ASSERTIONS=1 to make them go faster, but also do have some
34+
# runners that run `//ignore-debug` tests.
35+
#
36+
# Note that the compiler is compiled to target 10.8 here because the Xcode
37+
# version that we're using, 8.2, cannot compile LLVM for OSX 10.7.
38+
x86_64-apple:
39+
SCRIPT: ./x.py test
40+
INITIAL_RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
41+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
42+
MACOSX_DEPLOYMENT_TARGET: 10.8
43+
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
44+
NO_LLVM_ASSERTIONS: 1
45+
NO_DEBUG_ASSERTIONS: 1

‎src/etc/lldb_commands

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
command script import \"$RUSTC_SYSROOT/lib/rustlib/etc/lldb_lookup.py\"
2+
type synthetic add -l lldb_lookup.synthetic_lookup -x \".*\" --category Rust
3+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(alloc::(\\w+::)+)String$\" --category Rust
4+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^&str$\" --category Rust
5+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(std::ffi::(\\w+::)+)OsString$\" --category Rust
6+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(alloc::(\\w+::)+)Vec<.+>$\" --category Rust
7+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(alloc::(\\w+::)+)VecDeque<.+>$\" --category Rust
8+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(alloc::(\\w+::)+)BTreeSet<.+>$\" --category Rust
9+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(alloc::(\\w+::)+)BTreeMap<.+>$\" --category Rust
10+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(std::collections::(\\w+::)+)HashMap<.+>$\" --category Rust
11+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(std::collections::(\\w+::)+)HashSet<.+>$\" --category Rust
12+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(alloc::(\\w+::)+)Rc<.+>$\" --category Rust
13+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(alloc::(\\w+::)+)Arc<.+>$\" --category Rust
14+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(core::(\\w+::)+)Cell<.+>$\" --category Rust
15+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(core::(\\w+::)+)Ref<.+>$\" --category Rust
16+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(core::(\\w+::)+)RefMut<.+>$\" --category Rust
17+
type summary add -F lldb_lookup.summary_lookup -e -x -h \"^(core::(\\w+::)+)RefCell<.+>$\" --category Rust
18+
type category enable Rust

‎src/etc/rust-lldb

+1-7
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,5 @@ EOF
3030
fi
3131
fi
3232

33-
# Prepare commands that will be loaded before any file on the command line has been loaded
34-
script_import="command script import \"$RUSTC_SYSROOT/lib/rustlib/etc/lldb_lookup.py\""
35-
synthetic_definition="type synthetic add -l lldb_lookup.synthetic_lookup -x \".*\" --category Rust"
36-
summary_definition="type summary add -F lldb_lookup.summary_lookup -e -x -h \".*\" --category Rust"
37-
category_enable="type category enable Rust"
38-
3933
# Call LLDB with the commands added to the argument list
40-
exec "$lldb" -O "$script_import" -O "$synthetic_definition" -O "$summary_definition" -O "$category_enable" "$@"
34+
exec "$lldb" --source-before-file ./lldb_commands "$@"

‎src/test/debuginfo/borrowed-struct.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
// lldb-command:run
3636

3737
// lldb-command:print *stack_val_ref
38-
// lldbg-check:[...]$0 = SomeStruct { x: 10, y: 23.5 }
39-
// lldbr-check:(borrowed_struct::SomeStruct) *stack_val_ref = SomeStruct { x: 10, y: 23.5 }
38+
// lldbg-check:[...]$0 = { x = 10 y = 23.5 }
39+
// lldbr-check:(borrowed_struct::SomeStruct) *stack_val_ref = (x = 10, y = 23.5)
4040

4141
// lldb-command:print *stack_val_interior_ref_1
4242
// lldbg-check:[...]$1 = 10
@@ -47,12 +47,12 @@
4747
// lldbr-check:(f64) *stack_val_interior_ref_2 = 23.5
4848

4949
// lldb-command:print *ref_to_unnamed
50-
// lldbg-check:[...]$3 = SomeStruct { x: 11, y: 24.5 }
51-
// lldbr-check:(borrowed_struct::SomeStruct) *ref_to_unnamed = SomeStruct { x: 11, y: 24.5 }
50+
// lldbg-check:[...]$3 = { x = 11 y = 24.5 }
51+
// lldbr-check:(borrowed_struct::SomeStruct) *ref_to_unnamed = (x = 11, y = 24.5)
5252

5353
// lldb-command:print *unique_val_ref
54-
// lldbg-check:[...]$4 = SomeStruct { x: 13, y: 26.5 }
55-
// lldbr-check:(borrowed_struct::SomeStruct) *unique_val_ref = SomeStruct { x: 13, y: 26.5 }
54+
// lldbg-check:[...]$4 = { x = 13 y = 26.5 }
55+
// lldbr-check:(borrowed_struct::SomeStruct) *unique_val_ref = (x = 13, y = 26.5)
5656

5757
// lldb-command:print *unique_val_interior_ref_1
5858
// lldbg-check:[...]$5 = 13

‎src/test/debuginfo/borrowed-tuple.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
// lldb-command:run
2525

2626
// lldb-command:print *stack_val_ref
27-
// lldbg-check:[...]$0 = (-14, -19)
28-
// lldbr-check:((i16, f32)) *stack_val_ref = { = -14 = -19 }
27+
// lldbg-check:[...]$0 = { 0 = -14 1 = -19 }
28+
// lldbr-check:((i16, f32)) *stack_val_ref = { 0 = -14 1 = -19 }
2929

3030
// lldb-command:print *ref_to_unnamed
31-
// lldbg-check:[...]$1 = (-15, -20)
32-
// lldbr-check:((i16, f32)) *ref_to_unnamed = { = -15 = -20 }
31+
// lldbg-check:[...]$1 = { 0 = -15 1 = -20 }
32+
// lldbr-check:((i16, f32)) *ref_to_unnamed = { 0 = -15 1 = -20 }
3333

3434
// lldb-command:print *unique_val_ref
35-
// lldbg-check:[...]$2 = (-17, -22)
36-
// lldbr-check:((i16, f32)) *unique_val_ref = { = -17 = -22 }
35+
// lldbg-check:[...]$2 = { 0 = -17 1 = -22 }
36+
// lldbr-check:((i16, f32)) *unique_val_ref = { 0 = -17 1 = -22 }
3737

3838

3939
#![allow(unused_variables)]

‎src/test/debuginfo/box.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
// lldbg-check:[...]$0 = 1
2121
// lldbr-check:(i32) *a = 1
2222
// lldb-command:print *b
23-
// lldbg-check:[...]$1 = (2, 3.5)
24-
// lldbr-check:((i32, f64)) *b = { = 2 = 3.5 }
23+
// lldbg-check:[...]$1 = { 0 = 2 1 = 3.5 }
24+
// lldbr-check:((i32, f64)) *b = { 0 = 2 1 = 3.5 }
2525

2626
#![allow(unused_variables)]
2727
#![feature(box_syntax)]

‎src/test/debuginfo/boxed-struct.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
// lldb-command:run
2323

2424
// lldb-command:print *boxed_with_padding
25-
// lldbg-check:[...]$0 = StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 }
26-
// lldbr-check:(boxed_struct::StructWithSomePadding) *boxed_with_padding = StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 }
25+
// lldbg-check:[...]$0 = { x = 99 y = 999 z = 9999 w = 99999 }
26+
// lldbr-check:(boxed_struct::StructWithSomePadding) *boxed_with_padding = { x = 99 y = 999 z = 9999 w = 99999 }
2727

2828
// lldb-command:print *boxed_with_dtor
29-
// lldbg-check:[...]$1 = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 }
30-
// lldbr-check:(boxed_struct::StructWithDestructor) *boxed_with_dtor = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 }
29+
// lldbg-check:[...]$1 = { x = 77 y = 777 z = 7777 w = 77777 }
30+
// lldbr-check:(boxed_struct::StructWithDestructor) *boxed_with_dtor = { x = 77 y = 777 z = 7777 w = 77777 }
3131

3232
#![allow(unused_variables)]
3333
#![feature(box_syntax)]

‎src/test/debuginfo/by-value-self-argument-in-trait-impl.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
// lldb-command:continue
3232

3333
// lldb-command:print self
34-
// lldbg-check:[...]$1 = Struct { x: 2222, y: 3333 }
35-
// lldbr-check:(by_value_self_argument_in_trait_impl::Struct) self = Struct { x: 2222, y: 3333 }
34+
// lldbg-check:[...]$1 = { x = 2222 y = 3333 }
35+
// lldbr-check:(by_value_self_argument_in_trait_impl::Struct) self = { x = 2222 y = 3333 }
3636
// lldb-command:continue
3737

3838
// lldb-command:print self
39-
// lldbg-check:[...]$2 = (4444.5, 5555, 6666, 7777.5)
40-
// lldbr-check:((f64, isize, isize, f64)) self = { = 4444.5 = 5555 = 6666 = 7777.5 }
39+
// lldbg-check:[...] $2 = { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 }
40+
// lldbr-check:((f64, isize, isize, f64)) self = { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 }
4141
// lldb-command:continue
4242

4343
#![feature(omit_gdb_pretty_printer_section)]

‎src/test/debuginfo/c-style-enum-in-composite.rs

+15-14
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,32 @@
4040
// lldb-command:run
4141

4242
// lldb-command:print tuple_interior_padding
43-
// lldbg-check:[...]$0 = (0, OneHundred)
44-
// lldbr-check:((i16, c_style_enum_in_composite::AnEnum)) tuple_interior_padding = { = 0 = c_style_enum_in_composite::AnEnum::OneHundred }
43+
// lldbg-check:[...]$0 = { 0 = 0 1 = OneHundred }
44+
// lldbr-check:((i16, c_style_enum_in_composite::AnEnum)) tuple_interior_padding = { 0 = 0 1 = OneHundred }
4545

4646
// lldb-command:print tuple_padding_at_end
47-
// lldbg-check:[...]$1 = ((1, OneThousand), 2)
48-
// lldbr-check:(((u64, c_style_enum_in_composite::AnEnum), u64)) tuple_padding_at_end = { = { = 1 = c_style_enum_in_composite::AnEnum::OneThousand } = 2 }
47+
// lldbg-check:[...]$1 = { 0 = { 0 = 1 1 = OneThousand } 1 = 2 }
48+
// lldbr-check:(((u64, c_style_enum_in_composite::AnEnum), u64)) tuple_padding_at_end = { 0 = { 0 = 1 1 = OneThousand } 1 = 2 }
49+
4950
// lldb-command:print tuple_different_enums
50-
// lldbg-check:[...]$2 = (OneThousand, MountainView, OneMillion, Vienna)
51-
// lldbr-check:((c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum, c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum)) tuple_different_enums = { = c_style_enum_in_composite::AnEnum::OneThousand = c_style_enum_in_composite::AnotherEnum::MountainView = c_style_enum_in_composite::AnEnum::OneMillion = c_style_enum_in_composite::AnotherEnum::Vienna }
51+
// lldbg-check:[...]$2 = { 0 = OneThousand 1 = MountainView 2 = OneMillion 3 = Vienna }
52+
// lldbr-check:((c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum, c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum)) tuple_different_enums = { 0 = c_style_enum_in_composite::AnEnum::OneThousand 1 = c_style_enum_in_composite::AnotherEnum::MountainView 2 = c_style_enum_in_composite::AnEnum::OneMillion 3 = c_style_enum_in_composite::AnotherEnum::Vienna }
5253

5354
// lldb-command:print padded_struct
54-
// lldbg-check:[...]$3 = PaddedStruct { a: 3, b: OneMillion, c: 4, d: Toronto, e: 5 }
55-
// lldbr-check:(c_style_enum_in_composite::PaddedStruct) padded_struct = PaddedStruct { a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5 }
55+
// lldbg-check:[...]$3 = { a = 3 b = OneMillion c = 4 d = Toronto e = 5 }
56+
// lldbr-check:(c_style_enum_in_composite::PaddedStruct) padded_struct = { a = 3 b = c_style_enum_in_composite::AnEnum::OneMillion c = 4 d = Toronto e = 5 }
5657

5758
// lldb-command:print packed_struct
58-
// lldbg-check:[...]$4 = PackedStruct { a: 6, b: OneHundred, c: 7, d: Vienna, e: 8 }
59-
// lldbr-check:(c_style_enum_in_composite::PackedStruct) packed_struct = PackedStruct { a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8 }
59+
// lldbg-check:[...]$4 = { a = 6 b = OneHundred c = 7 d = Vienna e = 8 }
60+
// lldbr-check:(c_style_enum_in_composite::PackedStruct) packed_struct = { a = 6 b = c_style_enum_in_composite::AnEnum::OneHundred c = 7 d = Vienna e = 8 }
6061

6162
// lldb-command:print non_padded_struct
62-
// lldbg-check:[...]$5 = NonPaddedStruct { a: OneMillion, b: MountainView, c: OneThousand, d: Toronto }
63-
// lldbr-check:(c_style_enum_in_composite::NonPaddedStruct) non_padded_struct = NonPaddedStruct { a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto }
63+
// lldbg-check:[...]$5 = { a = OneMillion b = MountainView c = OneThousand d = Toronto }
64+
// lldbr-check:(c_style_enum_in_composite::NonPaddedStruct) non_padded_struct = { a = c_style_enum_in_composite::AnEnum::OneMillion, b = c_style_enum_in_composite::AnotherEnum::MountainView, c = c_style_enum_in_composite::AnEnum::OneThousand, d = c_style_enum_in_composite::AnotherEnum::Toronto }
6465

6566
// lldb-command:print struct_with_drop
66-
// lldbg-check:[...]$6 = (StructWithDrop { a: OneHundred, b: Vienna }, 9)
67-
// lldbr-check:((c_style_enum_in_composite::StructWithDrop, i64)) struct_with_drop = { = StructWithDrop { a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna } = 9 }
67+
// lldbg-check:[...]$6 = { 0 = { a = OneHundred b = Vienna } 1 = 9 }
68+
// lldbr-check:((c_style_enum_in_composite::StructWithDrop, i64)) struct_with_drop = { 0 = { a = c_style_enum_in_composite::AnEnum::OneHundred b = c_style_enum_in_composite::AnotherEnum::Vienna } 1 = 9 }
6869

6970
#![allow(unused_variables)]
7071
#![feature(omit_gdb_pretty_printer_section)]

‎src/test/debuginfo/cross-crate-spans.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ extern crate cross_crate_spans;
4444
// lldb-command:run
4545

4646
// lldb-command:print result
47-
// lldbg-check:[...]$0 = (17, 17)
48-
// lldbr-check:((u32, u32)) result = { = 17 = 17 }
47+
// lldbg-check:[...]$0 = { 0 = 17 1 = 17 }
48+
// lldbr-check:((u32, u32)) result = { 0 = 17 1 = 17 }
4949
// lldb-command:print a_variable
5050
// lldbg-check:[...]$1 = 123456789
5151
// lldbr-check:(u32) a_variable = 123456789
@@ -55,8 +55,8 @@ extern crate cross_crate_spans;
5555
// lldb-command:continue
5656

5757
// lldb-command:print result
58-
// lldbg-check:[...]$3 = (1212, 1212)
59-
// lldbr-check:((i16, i16)) result = { = 1212 = 1212 }
58+
// lldbg-check:[...]$3 = { 0 = 1212 1 = 1212 }
59+
// lldbr-check:((i16, i16)) result = { 0 = 1212 1 = 1212 }
6060
// lldb-command:print a_variable
6161
// lldbg-check:[...]$4 = 123456789
6262
// lldbr-check:(u32) a_variable = 123456789

‎src/test/debuginfo/destructured-fn-argument.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,16 @@
186186
// lldbg-check:[...]$5 = 5
187187
// lldbr-check:(isize) a = 5
188188
// lldb-command:print b
189-
// lldbg-check:[...]$6 = (6, 7)
190-
// lldbr-check:((u32, u32)) b = { = 6 = 7 }
189+
// lldbg-check:[...]$6 = { 0 = 6 1 = 7 }
190+
// lldbr-check:((u32, u32)) b = { 0 = 6 1 = 7 }
191191
// lldb-command:continue
192192

193193
// lldb-command:print h
194194
// lldbg-check:[...]$7 = 8
195195
// lldbr-check:(i16) h = 8
196196
// lldb-command:print i
197-
// lldbg-check:[...]$8 = Struct { a: 9, b: 10 }
198-
// lldbr-check:(destructured_fn_argument::Struct) i = Struct { a: 9, b: 10 }
197+
// lldbg-check:[...]$8 = { 0 = 6 1 = 7 }
198+
// lldbr-check:(destructured_fn_argument::Struct) i = { a = 9 b = 10 }
199199
// lldb-command:print j
200200
// lldbg-check:[...]$9 = 11
201201
// lldbr-check:(i16) j = 11
@@ -229,8 +229,8 @@
229229
// lldbg-check:[...]$16 = 20
230230
// lldbr-check:(i32) q = 20
231231
// lldb-command:print r
232-
// lldbg-check:[...]$17 = Struct { a: 21, b: 22 }
233-
// lldbr-check:(destructured_fn_argument::Struct) r = Struct { a: 21, b: 22 }
232+
// lldbg-check:[...]$17 = { a = 21 b = 22 }
233+
// lldbr-check:(destructured_fn_argument::Struct) r = { a = 21, b = 22 }
234234
// lldb-command:continue
235235

236236
// lldb-command:print s
@@ -271,13 +271,13 @@
271271
// lldb-command:continue
272272

273273
// lldb-command:print aa
274-
// lldbg-check:[...]$29 = (34, 35)
275-
// lldbr-check:((isize, isize)) aa = { = 34 = 35 }
274+
// lldbg-check:[...]$29 = { 0 = 34 1 = 35 }
275+
// lldbr-check:((isize, isize)) aa = { 0 = 34 1 = 35 }
276276
// lldb-command:continue
277277

278278
// lldb-command:print bb
279-
// lldbg-check:[...]$30 = (36, 37)
280-
// lldbr-check:((isize, isize)) bb = { = 36 = 37 }
279+
// lldbg-check:[...]$30 = { 0 = 36 1 = 37 }
280+
// lldbr-check:((isize, isize)) bb = { 0 = 36 1 = 37 }
281281
// lldb-command:continue
282282

283283
// lldb-command:print cc
@@ -286,21 +286,21 @@
286286
// lldb-command:continue
287287

288288
// lldb-command:print dd
289-
// lldbg-check:[...]$32 = (40, 41, 42)
290-
// lldbr-check:((isize, isize, isize)) dd = { = 40 = 41 = 42 }
289+
// lldbg-check:[...]$32 = { 0 = 40 1 = 41 2 = 42 }
290+
// lldbr-check:((isize, isize, isize)) dd = { 0 = 40 1 = 41 2 = 42 }
291291
// lldb-command:continue
292292

293293
// lldb-command:print *ee
294-
// lldbg-check:[...]$33 = (43, 44, 45)
295-
// lldbr-check:((isize, isize, isize)) *ee = { = 43 = 44 = 45 }
294+
// lldbg-check:[...]$33 = { 0 = 43 1 = 44 2 = 45 }
295+
// lldbr-check:((isize, isize, isize)) *ee = { 0 = 43 1 = 44 2 = 45 }
296296
// lldb-command:continue
297297

298298
// lldb-command:print *ff
299299
// lldbg-check:[...]$34 = 46
300300
// lldbr-check:(isize) *ff = 46
301301
// lldb-command:print gg
302-
// lldbg-check:[...]$35 = (47, 48)
303-
// lldbr-check:((isize, isize)) gg = { = 47 = 48 }
302+
// lldbg-check:[...]$35 = { 0 = 47 1 = 48 }
303+
// lldbr-check:((isize, isize)) gg = { 0 = 47 1 = 48 }
304304
// lldb-command:continue
305305

306306
// lldb-command:print *hh

‎src/test/debuginfo/destructured-for-loop-variable.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@
164164
// lldb-command:continue
165165

166166
// lldb-command:print simple_struct_ident
167-
// lldbg-check:[...]$22 = Struct { x: 3537, y: 35437.5, z: true }
168-
// lldbr-check:(destructured_for_loop_variable::Struct) simple_struct_ident = Struct { x: 3537, y: 35437.5, z: true }
167+
// lldbg-check:[...]$22 = { x = 3537 y = 35437.5 z = true }
168+
// lldbr-check:(destructured_for_loop_variable::Struct) simple_struct_ident = { x = 3537 y = 35437.5 z = true }
169169
// lldb-command:continue
170170

171171
// lldb-command:print simple_tuple_ident
172-
// lldbg-check:[...]$23 = (34903493, 232323)
173-
// lldbr-check:((u32, i64)) simple_tuple_ident = { = 34903493 = 232323 }
172+
// lldbg-check:[...]$23 = { 0 = 34903493 1 = 232323 }
173+
// lldbr-check:((u32, i64)) simple_tuple_ident = { 0 = 34903493 1 = 232323 }
174174
// lldb-command:continue
175175

176176
#![allow(unused_variables)]

‎src/test/debuginfo/destructured-local.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@
150150
// lldbg-check:[...]$5 = 5
151151
// lldbr-check:(isize) f = 5
152152
// lldb-command:print g
153-
// lldbg-check:[...]$6 = (6, 7)
154-
// lldbr-check:((u32, u32)) g = { = 6 = 7 }
153+
// lldbg-check:[...]$6 = { 0 = 6 1 = 7 }
154+
// lldbr-check:((u32, u32)) g = { 0 = 6 1 = 7 }
155155

156156
// lldb-command:print h
157157
// lldbg-check:[...]$7 = 8
158158
// lldbr-check:(i16) h = 8
159159
// lldb-command:print i
160-
// lldbg-check:[...]$8 = Struct { a: 9, b: 10 }
161-
// lldbr-check:(destructured_local::Struct) i = Struct { a: 9, b: 10 }
160+
// lldbg-check:[...]$8 = { a = 9 b = 10 }
161+
// lldbr-check:(destructured_local::Struct) i = { a = 9 b = 10 }
162162
// lldb-command:print j
163163
// lldbg-check:[...]$9 = 11
164164
// lldbr-check:(i16) j = 11
@@ -188,8 +188,8 @@
188188
// lldbg-check:[...]$16 = 20
189189
// lldbr-check:(i32) q = 20
190190
// lldb-command:print r
191-
// lldbg-check:[...]$17 = Struct { a: 21, b: 22 }
192-
// lldbr-check:(destructured_local::Struct) r = Struct { a: 21, b: 22 }
191+
// lldbg-check:[...]$17 = { a = 21 b = 22 }
192+
// lldbr-check:(destructured_local::Struct) r = { a = 21 b = 22 }
193193

194194
// lldb-command:print s
195195
// lldbg-check:[...]$18 = 24
@@ -227,32 +227,32 @@
227227
// lldbr-check:(i32) ue = 33
228228

229229
// lldb-command:print aa
230-
// lldbg-check:[...]$29 = (34, 35)
231-
// lldbr-check:((i32, i32)) aa = { = 34 = 35 }
230+
// lldbg-check:[...]$29 = { 0 = 34 1 = 35 }
231+
// lldbr-check:((i32, i32)) aa = { 0 = 34 1 = 35 }
232232

233233
// lldb-command:print bb
234-
// lldbg-check:[...]$30 = (36, 37)
235-
// lldbr-check:((i32, i32)) bb = { = 36 = 37 }
234+
// lldbg-check:[...]$30 = { 0 = 36 1 = 37 }
235+
// lldbr-check:((i32, i32)) bb = { 0 = 36 1 = 37 }
236236

237237
// lldb-command:print cc
238238
// lldbg-check:[...]$31 = 38
239239
// lldbr-check:(i32) cc = 38
240240

241241
// lldb-command:print dd
242-
// lldbg-check:[...]$32 = (40, 41, 42)
243-
// lldbr-check:((i32, i32, i32)) dd = { = 40 = 41 = 42 }
242+
// lldbg-check:[...]$32 = { 0 = 40 1 = 41 2 = 42 }
243+
// lldbr-check:((i32, i32, i32)) dd = { 0 = 40 1 = 41 2 = 42}
244244

245245
// lldb-command:print *ee
246-
// lldbg-check:[...]$33 = (43, 44, 45)
247-
// lldbr-check:((i32, i32, i32)) *ee = { = 43 = 44 = 45 }
246+
// lldbg-check:[...]$33 = { 0 = 43 1 = 44 2 = 45 }
247+
// lldbr-check:((i32, i32, i32)) *ee = { 0 = 43 1 = 44 2 = 45}
248248

249249
// lldb-command:print *ff
250250
// lldbg-check:[...]$34 = 46
251251
// lldbr-check:(i32) *ff = 46
252252

253253
// lldb-command:print gg
254-
// lldbg-check:[...]$35 = (47, 48)
255-
// lldbr-check:((i32, i32)) gg = { = 47 = 48 }
254+
// lldbg-check:[...]$35 = { 0 = 47 1 = 48 }
255+
// lldbr-check:((i32, i32)) gg = { 0 = 47 1 = 48 }
256256

257257
// lldb-command:print *hh
258258
// lldbg-check:[...]$36 = 50

‎src/test/debuginfo/empty-string.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
// lldb-command: run
2121

2222
// lldb-command: fr v empty_string
23-
// lldb-check:[...]empty_string = ""
23+
// lldb-check:[...]empty_string = "" { vec = size=0 }
2424

2525
// lldb-command: fr v empty_str
26-
// lldb-check:[...]empty_str = ""
26+
// lldb-check:[...]empty_str = "" { data_ptr = [...] length = 0 }
2727

2828
fn main() {
2929
let empty_string = String::new();

‎src/test/debuginfo/evec-in-struct.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@
3333
// lldb-command:run
3434

3535
// lldb-command:print no_padding1
36-
// lldbg-check:[...]$0 = NoPadding1 { x: [0, 1, 2], y: -3, z: [4.5, 5.5] }
37-
// lldbr-check:(evec_in_struct::NoPadding1) no_padding1 = NoPadding1 { x: [0, 1, 2], y: -3, z: [4.5, 5.5] }
36+
// lldbg-check:[...]$0 = { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } }
37+
// lldbr-check:(evec_in_struct::NoPadding1) no_padding1 = { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } }
3838
// lldb-command:print no_padding2
39-
// lldbg-check:[...]$1 = NoPadding2 { x: [6, 7, 8], y: [[9, 10], [11, 12]] }
40-
// lldbr-check:(evec_in_struct::NoPadding2) no_padding2 = NoPadding2 { x: [6, 7, 8], y: [[9, 10], [11, 12]] }
39+
// lldbg-check:[...]$1 = { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } }
40+
// lldbr-check:(evec_in_struct::NoPadding2) no_padding2 = { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } }
4141

4242
// lldb-command:print struct_internal_padding
43-
// lldbg-check:[...]$2 = StructInternalPadding { x: [13, 14], y: [15, 16] }
44-
// lldbr-check:(evec_in_struct::StructInternalPadding) struct_internal_padding = StructInternalPadding { x: [13, 14], y: [15, 16] }
43+
// lldbg-check:[...]$2 = { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } }
44+
// lldbr-check:(evec_in_struct::StructInternalPadding) struct_internal_padding = { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } }
4545

4646
// lldb-command:print single_vec
47-
// lldbg-check:[...]$3 = SingleVec { x: [17, 18, 19, 20, 21] }
48-
// lldbr-check:(evec_in_struct::SingleVec) single_vec = SingleVec { x: [17, 18, 19, 20, 21] }
47+
// lldbg-check:[...]$3 = { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } }
48+
// lldbr-check:(evec_in_struct::SingleVec) single_vec = { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } }
4949

5050
// lldb-command:print struct_padded_at_end
51-
// lldbg-check:[...]$4 = StructPaddedAtEnd { x: [22, 23], y: [24, 25] }
52-
// lldbr-check:(evec_in_struct::StructPaddedAtEnd) struct_padded_at_end = StructPaddedAtEnd { x: [22, 23], y: [24, 25] }
51+
// lldbg-check:[...]$4 = { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } }
52+
// lldbr-check:(evec_in_struct::StructPaddedAtEnd) struct_padded_at_end = { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } }
5353

5454
#![allow(unused_variables)]
5555
#![feature(omit_gdb_pretty_printer_section)]

‎src/test/debuginfo/generic-function.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// lldbg-check:[...]$1 = 2.5
4949
// lldbr-check:(f64) *t1 = 2.5
5050
// lldb-command:print ret
51-
// lldbg-check:[...]$2 = ((1, 2.5), (2.5, 1))
51+
// lldbg-check:[...]$2 = { 0 = { 0 = 1 1 = 2.5 } 1 = { 0 = 2.5 1 = 1 } }
5252
// lldbr-check:(((i32, f64), (f64, i32))) ret = { = { = 1 = 2.5 } = { = 2.5 = 1 } }
5353
// lldb-command:continue
5454

@@ -59,19 +59,19 @@
5959
// lldbg-check:[...]$4 = 4
6060
// lldbr-check:(u16) *t1 = 4
6161
// lldb-command:print ret
62-
// lldbg-check:[...]$5 = ((3.5, 4), (4, 3.5))
62+
// lldbg-check:[...]$5 = { = { = 3.5 = 4 } = { = 4 = 3.5 } }
6363
// lldbr-check:(((f64, u16), (u16, f64))) ret = { = { = 3.5 = 4 } = { = 4 = 3.5 } }
6464
// lldb-command:continue
6565

6666
// lldb-command:print *t0
6767
// lldbg-check:[...]$6 = 5
6868
// lldbr-check:(i32) *t0 = 5
6969
// lldb-command:print *t1
70-
// lldbg-check:[...]$7 = Struct { a: 6, b: 7.5 }
71-
// lldbr-check:(generic_function::Struct) *t1 = Struct { a: 6, b: 7.5 }
70+
// lldbg-check:[...]$7 = { a = 6 b = 7.5 }
71+
// lldbr-check:(generic_function::Struct) *t1 = { a = 6 b = 7.5 }
7272
// lldb-command:print ret
73-
// lldbg-check:[...]$8 = ((5, Struct { a: 6, b: 7.5 }), (Struct { a: 6, b: 7.5 }, 5))
74-
// lldbr-check:(((i32, generic_function::Struct), (generic_function::Struct, i32))) ret = { = { = 5 = Struct { a: 6, b: 7.5 } } = { = Struct { a: 6, b: 7.5 } = 5 } }
73+
// lldbg-check:[...]$8 = { 0 = { 0 = 5 1 = { a = 6 b = 7.5 } } 1 = { 0 = { a = 6 b = 7.5 } 1 = 5 } }
74+
// lldbr-check:(((i32, generic_function::Struct), (generic_function::Struct, i32))) ret = { 0 = { 0 = 5 1 = { a = 6 b = 7.5 } } 1 = { 0 = { a = 6 b = 7.5 } 1 = 5 } }
7575
// lldb-command:continue
7676

7777
#![feature(omit_gdb_pretty_printer_section)]

‎src/tools/compiletest/src/runtest.rs

+23-2
Original file line numberDiff line numberDiff line change
@@ -1082,12 +1082,33 @@ impl<'test> TestCx<'test> {
10821082
let rust_pp_module_abs_path =
10831083
rust_src_root.join(rust_pp_module_rel_path).to_str().unwrap().to_owned();
10841084

1085+
let rust_type_regexes = vec![
1086+
"^(alloc::(\\w+::)+)String$",
1087+
"^&str$",
1088+
"^(std::ffi::(\\w+::)+)OsString$",
1089+
"^(alloc::(\\w+::)+)Vec<.+>$",
1090+
"^(alloc::(\\w+::)+)VecDeque<.+>$",
1091+
"^(alloc::(\\w+::)+)BTreeSet<.+>$",
1092+
"^(alloc::(\\w+::)+)BTreeMap<.+>$",
1093+
"^(std::collections::(\\w+::)+)HashMap<.+>$",
1094+
"^(std::collections::(\\w+::)+)HashSet<.+>$",
1095+
"^(alloc::(\\w+::)+)Rc<.+>$",
1096+
"^(alloc::(\\w+::)+)Arc<.+>$",
1097+
"^(core::(\\w+::)+)Cell<.+>$",
1098+
"^(core::(\\w+::)+)Ref<.+>$",
1099+
"^(core::(\\w+::)+)RefMut<.+>$",
1100+
"^(core::(\\w+::)+)RefCell<.+>$",
1101+
];
1102+
10851103
script_str
10861104
.push_str(&format!("command script import {}\n", &rust_pp_module_abs_path[..])[..]);
10871105
script_str.push_str("type synthetic add -l lldb_lookup.synthetic_lookup -x '.*' ");
10881106
script_str.push_str("--category Rust\n");
1089-
script_str.push_str("type summary add -l lldb_lookup.summary_lookup -x '.*' ");
1090-
script_str.push_str("--category Rust\n");
1107+
for type_regex in rust_type_regexes {
1108+
script_str.push_str("type summary add -F lldb_lookup.summary_lookup -e -x -h ");
1109+
script_str.push_str(&format!("'{}' ", type_regex));
1110+
script_str.push_str("--category Rust\n");
1111+
}
10911112
script_str.push_str("type category enable Rust\n");
10921113

10931114
// Set breakpoints on every line that contains the string "#break"

0 commit comments

Comments
 (0)
Please sign in to comment.