From f16363e05368b6ba25cc8b5486413cc94b76a49a Mon Sep 17 00:00:00 2001 From: Walnut <39544927+Walnut356@users.noreply.github.com> Date: Wed, 15 Oct 2025 20:23:11 -0500 Subject: [PATCH 1/2] align gnu enum output with msvc enum output --- src/etc/lldb_commands | 3 +- src/etc/lldb_lookup.py | 23 ++++++- src/etc/lldb_providers.py | 124 +++++++++++++++++++++++--------------- 3 files changed, 96 insertions(+), 54 deletions(-) diff --git a/src/etc/lldb_commands b/src/etc/lldb_commands index 508296c3a5aec..eff065d545657 100644 --- a/src/etc/lldb_commands +++ b/src/etc/lldb_commands @@ -1,6 +1,5 @@ # Forces test-compliant formatting to all other types type synthetic add -l lldb_lookup.synthetic_lookup -x ".*" --category Rust -type summary add -F _ -e -x -h "^.*$" --category Rust # Std String type synthetic add -l lldb_lookup.StdStringSyntheticProvider -x "^(alloc::([a-z_]+::)+)String$" --category Rust type summary add -F lldb_lookup.StdStringSummaryProvider -e -x -h "^(alloc::([a-z_]+::)+)String$" --category Rust @@ -66,6 +65,7 @@ type summary add -F lldb_lookup.summary_lookup -e -x -h "^(std::([a-z_]+::)+)Pa type synthetic add -l lldb_lookup.synthetic_lookup -x "^&(mut )?(std::([a-z_]+::)+)Path$" --category Rust type summary add -F lldb_lookup.summary_lookup -e -x -h "^&(mut )?(std::([a-z_]+::)+)Path$" --category Rust # Enum +# type summary add -F lldb_lookup.ClangEncodedEnumSummaryProvider -e -h "lldb_lookup.is_sum_type_enum" --recognizer-function --category Rust ## MSVC type synthetic add -l lldb_lookup.MSVCEnumSyntheticProvider -x "^enum2\$<.+>$" --category Rust type summary add -F lldb_lookup.MSVCEnumSummaryProvider -e -x -h "^enum2\$<.+>$" --category Rust @@ -74,6 +74,7 @@ type synthetic add -l lldb_lookup.synthetic_lookup -x "^enum2\$<.+>::.*$" --cate type summary add -F lldb_lookup.summary_lookup -e -x -h "^enum2\$<.+>::.*$" --category Rust # Tuple type synthetic add -l lldb_lookup.synthetic_lookup -x "^\(.*\)$" --category Rust +type summary add -F lldb_lookup.TupleSummaryProvider -e -x -h "^\(.*\)$" --category Rust ## MSVC type synthetic add -l lldb_lookup.MSVCTupleSyntheticProvider -x "^tuple\$<.+>$" --category Rust type summary add -F lldb_lookup.TupleSummaryProvider -e -x -h "^tuple\$<.+>$" --category Rust diff --git a/src/etc/lldb_lookup.py b/src/etc/lldb_lookup.py index f43d2c6a7252e..2b90d4022f7fb 100644 --- a/src/etc/lldb_lookup.py +++ b/src/etc/lldb_lookup.py @@ -10,9 +10,6 @@ def is_hashbrown_hashmap(hash_map: lldb.SBValue) -> bool: def classify_rust_type(type: lldb.SBType) -> str: - if type.IsPointerType(): - type = type.GetPointeeType() - type_class = type.GetTypeClass() if type_class == lldb.eTypeClassStruct: return classify_struct(type.name, type.fields) @@ -88,6 +85,26 @@ def synthetic_lookup(valobj: lldb.SBValue, _dict: LLDBOpaque) -> object: if rust_type == RustType.SINGLETON_ENUM: return synthetic_lookup(valobj.GetChildAtIndex(0), _dict) if rust_type == RustType.ENUM: + # this little trick lets us treat `synthetic_lookup` as a "recognizer function" for the enum + # summary providers, reducing the number of lookups we have to do. This is a huge time save + # because there's no way (via type name) to recognize sum-type enums on `*-gnu` targets. The + # alternative would be to shove every single type through `summary_lookup`, which is + # incredibly wasteful. Once these scripts are updated for LLDB 19.0 and we can use + # `--recognizer-function`, this hack will only be needed for backwards compatibility. + summary: lldb.SBTypeSummary = valobj.GetTypeSummary() + if ( + summary.summary_data is None + or summary.summary_data.strip() + != "lldb_lookup.ClangEncodedEnumSummaryProvider(valobj,internal_dict)" + ): + rust_category: lldb.SBTypeCategory = lldb.debugger.GetCategory("Rust") + rust_category.AddTypeSummary( + lldb.SBTypeNameSpecifier(valobj.GetTypeName()), + lldb.SBTypeSummary().CreateWithFunctionName( + "lldb_lookup.ClangEncodedEnumSummaryProvider" + ), + ) + return ClangEncodedEnumProvider(valobj, _dict) if rust_type == RustType.STD_VEC: return StdVecSyntheticProvider(valobj, _dict) diff --git a/src/etc/lldb_providers.py b/src/etc/lldb_providers.py index 5aad54fbfee26..4c10e8c135a75 100644 --- a/src/etc/lldb_providers.py +++ b/src/etc/lldb_providers.py @@ -1,7 +1,6 @@ from __future__ import annotations -import re import sys -from typing import List, TYPE_CHECKING +from typing import Generator, List, TYPE_CHECKING from lldb import ( SBData, @@ -12,6 +11,8 @@ eFormatChar, ) +from rust_types import is_tuple_fields + if TYPE_CHECKING: from lldb import SBValue, SBType, SBTypeStaticField @@ -133,7 +134,7 @@ def has_children(self) -> bool: return False -def get_template_args(type_name: str) -> list[str]: +def get_template_args(type_name: str) -> List[str]: """ Takes a type name `T, D>` and returns a list of its generic args `["A", "tuple$", "D"]`. @@ -163,6 +164,34 @@ def get_template_args(type_name: str) -> list[str]: return params +def StructSummaryProvider(valobj: SBValue, _dict: LLDBOpaque) -> str: + # structs need the field name before the field value + output = ( + f"{valobj.GetChildAtIndex(i).GetName()}:{child}" + for i, child in enumerate(aggregate_field_summary(valobj, _dict)) + ) + + return "{" + ", ".join(output) + "}" + + +def TupleSummaryProvider(valobj: SBValue, _dict: LLDBOpaque): + return "(" + ", ".join(aggregate_field_summary(valobj, _dict)) + ")" + + +def aggregate_field_summary(valobj: SBValue, _dict) -> Generator[str, None, None]: + for i in range(0, valobj.GetNumChildren()): + child: SBValue = valobj.GetChildAtIndex(i) + summary = child.summary + if summary is None: + summary = child.value + if summary is None: + if is_tuple_fields(child): + summary = TupleSummaryProvider(child, _dict) + else: + summary = StructSummaryProvider(child, _dict) + yield summary + + def SizeSummaryProvider(valobj: SBValue, _dict: LLDBOpaque) -> str: return "size=" + str(valobj.GetNumChildren()) @@ -411,49 +440,55 @@ def get_type_name(self): return "&str" -def _getVariantName(variant) -> str: +def _getVariantName(variant: SBValue) -> str: """ Since the enum variant's type name is in the form `TheEnumName::TheVariantName$Variant`, we can extract `TheVariantName` from it for display purpose. """ s = variant.GetType().GetName() - match = re.search(r"::([^:]+)\$Variant$", s) - return match.group(1) if match else "" + if not s.endswith("$Variant"): + return "" + + # trim off path and "$Variant" + # len("$Variant") == 8 + return s.rsplit("::", 1)[1][:-8] class ClangEncodedEnumProvider: """Pretty-printer for 'clang-encoded' enums support implemented in LLDB""" + valobj: SBValue + variant: SBValue + value: SBValue + DISCRIMINANT_MEMBER_NAME = "$discr$" VALUE_MEMBER_NAME = "value" + __slots__ = ("valobj", "variant", "value") + def __init__(self, valobj: SBValue, _dict: LLDBOpaque): self.valobj = valobj self.update() def has_children(self) -> bool: - return True + return self.value.MightHaveChildren() def num_children(self) -> int: - return 1 + return self.value.GetNumChildren() - def get_child_index(self, _name: str) -> int: - return -1 + def get_child_index(self, name: str) -> int: + return self.value.GetIndexOfChildWithName(name) def get_child_at_index(self, index: int) -> SBValue: - if index == 0: - value = self.variant.GetChildMemberWithName( - ClangEncodedEnumProvider.VALUE_MEMBER_NAME - ) - return value.CreateChildAtOffset( - _getVariantName(self.variant), 0, value.GetType() - ) - return None + return self.value.GetChildAtIndex(index) def update(self): all_variants = self.valobj.GetChildAtIndex(0) index = self._getCurrentVariantIndex(all_variants) self.variant = all_variants.GetChildAtIndex(index) + self.value = self.variant.GetChildMemberWithName( + ClangEncodedEnumProvider.VALUE_MEMBER_NAME + ).GetSyntheticValue() def _getCurrentVariantIndex(self, all_variants: SBValue) -> int: default_index = 0 @@ -471,6 +506,23 @@ def _getCurrentVariantIndex(self, all_variants: SBValue) -> int: return default_index +def ClangEncodedEnumSummaryProvider(valobj: SBValue, _dict: LLDBOpaque) -> str: + enum_synth = ClangEncodedEnumProvider(valobj.GetNonSyntheticValue(), _dict) + variant = enum_synth.variant + name = _getVariantName(variant) + + if valobj.GetNumChildren() == 0: + return name + + child_name: str = valobj.GetChildAtIndex(0).name + if child_name == "0" or child_name == "__0": + # enum variant is a tuple struct + return name + TupleSummaryProvider(valobj, _dict) + else: + # enum variant is a regular struct + return name + StructSummaryProvider(valobj, _dict) + + class MSVCEnumSyntheticProvider: """ Synthetic provider for sum-type enums on MSVC. For a detailed explanation of the internals, @@ -479,12 +531,14 @@ class MSVCEnumSyntheticProvider: https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs """ + valobj: SBValue + variant: SBValue + value: SBValue + __slots__ = ["valobj", "variant", "value"] def __init__(self, valobj: SBValue, _dict: LLDBOpaque): self.valobj = valobj - self.variant: SBValue - self.value: SBValue self.update() def update(self): @@ -652,21 +706,6 @@ def get_type_name(self) -> str: return name -def StructSummaryProvider(valobj: SBValue, _dict: LLDBOpaque) -> str: - output = [] - for i in range(valobj.GetNumChildren()): - child: SBValue = valobj.GetChildAtIndex(i) - summary = child.summary - if summary is None: - summary = child.value - if summary is None: - summary = StructSummaryProvider(child, _dict) - summary = child.GetName() + ":" + summary - output.append(summary) - - return "{" + ", ".join(output) + "}" - - def MSVCEnumSummaryProvider(valobj: SBValue, _dict: LLDBOpaque) -> str: enum_synth = MSVCEnumSyntheticProvider(valobj.GetNonSyntheticValue(), _dict) variant_names: SBType = valobj.target.FindFirstType( @@ -783,21 +822,6 @@ def get_type_name(self) -> str: return "(" + name + ")" -def TupleSummaryProvider(valobj: SBValue, _dict: LLDBOpaque): - output: List[str] = [] - - for i in range(0, valobj.GetNumChildren()): - child: SBValue = valobj.GetChildAtIndex(i) - summary = child.summary - if summary is None: - summary = child.value - if summary is None: - summary = "{...}" - output.append(summary) - - return "(" + ", ".join(output) + ")" - - class StdVecSyntheticProvider: """Pretty-printer for alloc::vec::Vec From d8b5ad97fba80cde7e9d83073e4b8cc2f3752122 Mon Sep 17 00:00:00 2001 From: Walnut <39544927+Walnut356@users.noreply.github.com> Date: Wed, 15 Oct 2025 20:23:42 -0500 Subject: [PATCH 2/2] update tests --- tests/debuginfo/basic-types-globals.rs | 2 +- tests/debuginfo/borrowed-enum.rs | 6 +++--- tests/debuginfo/c-style-enum-in-composite.rs | 2 +- tests/debuginfo/coroutine-objects.rs | 2 +- tests/debuginfo/enum-thinlto.rs | 2 +- .../debuginfo/generic-method-on-generic-struct.rs | 4 ++-- tests/debuginfo/issue-57822.rs | 2 +- tests/debuginfo/method-on-generic-struct.rs | 4 ++-- tests/debuginfo/msvc-pretty-enums.rs | 1 + tests/debuginfo/option-like-enum.rs | 10 +++++----- tests/debuginfo/strings-and-strs.rs | 5 ++--- tests/debuginfo/struct-in-enum.rs | 7 ++++--- tests/debuginfo/struct-style-enum.rs | 8 ++++---- tests/debuginfo/tuple-in-tuple.rs | 14 +++++++------- tests/debuginfo/tuple-style-enum.rs | 8 ++++---- tests/debuginfo/union-smoke.rs | 4 ++-- tests/debuginfo/unique-enum.rs | 6 +++--- tests/debuginfo/vec-slices.rs | 2 +- 18 files changed, 45 insertions(+), 44 deletions(-) diff --git a/tests/debuginfo/basic-types-globals.rs b/tests/debuginfo/basic-types-globals.rs index d8997b3f75a9f..da46a73a8a7f3 100644 --- a/tests/debuginfo/basic-types-globals.rs +++ b/tests/debuginfo/basic-types-globals.rs @@ -13,7 +13,7 @@ // lldb-command:v I // lldb-check: ::I::[...] = -1 // lldb-command:v --format=d C -// lldb-check: ::C::[...] = 97 +// lldb-check: ::C::[...] = 97 U+0x00000061 U'a' // lldb-command:v --format=d I8 // lldb-check: ::I8::[...] = 68 // lldb-command:v I16 diff --git a/tests/debuginfo/borrowed-enum.rs b/tests/debuginfo/borrowed-enum.rs index 48dce139a2f31..f3769172558b3 100644 --- a/tests/debuginfo/borrowed-enum.rs +++ b/tests/debuginfo/borrowed-enum.rs @@ -23,11 +23,11 @@ // lldb-command:run // lldb-command:v *the_a_ref -// lldb-check:(borrowed_enum::ABC) *the_a_ref = { TheA = { x = 0 y = 8970181431921507452 } } +// lldb-check:(borrowed_enum::ABC) *the_a_ref = TheA{x:0, y:8970181431921507452} { x = 0 y = 8970181431921507452 } // lldb-command:v *the_b_ref -// lldb-check:(borrowed_enum::ABC) *the_b_ref = { TheB = { 0 = 0 1 = 286331153 2 = 286331153 } } +// lldb-check:(borrowed_enum::ABC) *the_b_ref = TheB(0, 286331153, 286331153) { 0 = 0 1 = 286331153 2 = 286331153 } // lldb-command:v *univariant_ref -// lldb-check:(borrowed_enum::Univariant) *univariant_ref = { TheOnlyCase = { 0 = 4820353753753434 } } +// lldb-check:(borrowed_enum::Univariant) *univariant_ref = TheOnlyCase(4820353753753434) { 0 = 4820353753753434 } #![allow(unused_variables)] diff --git a/tests/debuginfo/c-style-enum-in-composite.rs b/tests/debuginfo/c-style-enum-in-composite.rs index dd5e4f8b65d71..137cb2656fc57 100644 --- a/tests/debuginfo/c-style-enum-in-composite.rs +++ b/tests/debuginfo/c-style-enum-in-composite.rs @@ -35,7 +35,7 @@ // lldb-check:[...] { 0 = 0 1 = OneHundred } // lldb-command:v tuple_padding_at_end -// lldb-check:[...] { 0 = { 0 = 1 1 = OneThousand } 1 = 2 } +// lldb-check:[...] ((1, OneThousand), 2) { 0 = (1, OneThousand) { 0 = 1 1 = OneThousand } 1 = 2 } // lldb-command:v tuple_different_enums // lldb-check:[...] { 0 = OneThousand 1 = MountainView 2 = OneMillion 3 = Vienna } diff --git a/tests/debuginfo/coroutine-objects.rs b/tests/debuginfo/coroutine-objects.rs index f1165de4bfaaf..b9d015ef6d1b7 100644 --- a/tests/debuginfo/coroutine-objects.rs +++ b/tests/debuginfo/coroutine-objects.rs @@ -27,7 +27,7 @@ // lldb-command:run // lldb-command:v b -// lldb-check:(coroutine_objects::main::{coroutine_env#0}) b = { value = { _ref__a = 0x[...] } $discr$ = [...] } +// lldb-check:(coroutine_objects::main::{coroutine_env#0}) b = 0{_ref__a:0x[...]} { _ref__a = 0x[...] } // === CDB TESTS =================================================================================== diff --git a/tests/debuginfo/enum-thinlto.rs b/tests/debuginfo/enum-thinlto.rs index 789755438a6b9..9b77b1d9ba4a8 100644 --- a/tests/debuginfo/enum-thinlto.rs +++ b/tests/debuginfo/enum-thinlto.rs @@ -15,7 +15,7 @@ // lldb-command:run // lldb-command:v *abc -// lldb-check:(enum_thinlto::ABC) *abc = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 } +// lldb-check:(enum_thinlto::ABC) *abc = TheA{x:0, y:8970181431921507452} { x = 0 y = 8970181431921507452 } #![allow(unused_variables)] diff --git a/tests/debuginfo/generic-method-on-generic-struct.rs b/tests/debuginfo/generic-method-on-generic-struct.rs index c549a14153659..9c1d87ac8c876 100644 --- a/tests/debuginfo/generic-method-on-generic-struct.rs +++ b/tests/debuginfo/generic-method-on-generic-struct.rs @@ -58,7 +58,7 @@ // STACK BY REF // lldb-command:v *self -// lldb-check:[...] { x = { 0 = 8888 1 = -8888 } } +// lldb-check:[...] { x = (8888, -8888) { 0 = 8888 1 = -8888 } } // lldb-command:v arg1 // lldb-check:[...] -1 // lldb-command:v arg2 @@ -67,7 +67,7 @@ // STACK BY VAL // lldb-command:v self -// lldb-check:[...] { x = { 0 = 8888 1 = -8888 } } +// lldb-check:[...] { x = (8888, -8888) { 0 = 8888 1 = -8888 } } // lldb-command:v arg1 // lldb-check:[...] -3 // lldb-command:v arg2 diff --git a/tests/debuginfo/issue-57822.rs b/tests/debuginfo/issue-57822.rs index 59c0759737dd0..aa829dfb21adb 100644 --- a/tests/debuginfo/issue-57822.rs +++ b/tests/debuginfo/issue-57822.rs @@ -24,7 +24,7 @@ // lldb-check:(issue_57822::main::{closure_env#1}) g = { f = { x = 1 } } // lldb-command:v b -// lldb-check:(issue_57822::main::{coroutine_env#3}) b = { value = { a = { value = { y = 2 } $discr$ = '\x02' } } $discr$ = '\x02' } +// lldb-check:(issue_57822::main::{coroutine_env#3}) b = 2{a:2{y:2}} { a = 2{y:2} { y = 2 } } #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] diff --git a/tests/debuginfo/method-on-generic-struct.rs b/tests/debuginfo/method-on-generic-struct.rs index b9627f27b9123..01e7ffc749da1 100644 --- a/tests/debuginfo/method-on-generic-struct.rs +++ b/tests/debuginfo/method-on-generic-struct.rs @@ -58,7 +58,7 @@ // STACK BY REF // lldb-command:v *self -// lldb-check:[...]Struct<(u32, i32)>) *self = { x = { 0 = 8888 1 = -8888 } } +// lldb-check:[...]Struct<(u32, i32)>) *self = { x = (8888, -8888) { 0 = 8888 1 = -8888 } } // lldb-command:v arg1 // lldb-check:[...] -1 // lldb-command:v arg2 @@ -67,7 +67,7 @@ // STACK BY VAL // lldb-command:v self -// lldb-check:[...]Struct<(u32, i32)>) self = { x = { 0 = 8888 1 = -8888 } } +// lldb-check:[...]Struct<(u32, i32)>) self = { x = (8888, -8888) { 0 = 8888 1 = -8888 } } // lldb-command:v arg1 // lldb-check:[...] -3 // lldb-command:v arg2 diff --git a/tests/debuginfo/msvc-pretty-enums.rs b/tests/debuginfo/msvc-pretty-enums.rs index aa6629ef1e1be..7d9f867efcdd7 100644 --- a/tests/debuginfo/msvc-pretty-enums.rs +++ b/tests/debuginfo/msvc-pretty-enums.rs @@ -1,3 +1,4 @@ +//@ only-msvc //@ min-lldb-version: 1800 //@ ignore-gdb //@ compile-flags:-g diff --git a/tests/debuginfo/option-like-enum.rs b/tests/debuginfo/option-like-enum.rs index 5a55b143fbbd5..0e419978d62e4 100644 --- a/tests/debuginfo/option-like-enum.rs +++ b/tests/debuginfo/option-like-enum.rs @@ -40,31 +40,31 @@ // lldb-command:run // lldb-command:v some -// lldb-check:[...] Some(&0x[...]) +// lldb-check:[...] Some(0x[...]) { 0 = 0x[...] } // lldb-command:v none // lldb-check:[...] None // lldb-command:v full -// lldb-check:[...] Full(454545, &0x[...], 9988) +// lldb-check:[...] Full(454545, 0x[...], 9988) { 0 = 454545 1 = 0x[...] 2 = 9988 } // lldb-command:v empty // lldb-check:[...] Empty // lldb-command:v droid -// lldb-check:[...] Droid { id: 675675, range: 10000001, internals: &0x[...] } +// lldb-check:[...] Droid{id:675675, range:10000001, internals:0x[...]} { id = 675675 range = 10000001 internals = 0x[...] } // lldb-command:v void_droid // lldb-check:[...] Void // lldb-command:v some_str -// lldb-check:[...] Some("abc") +// lldb-check:[...] Some("abc") [...] // lldb-command:v none_str // lldb-check:[...] None // lldb-command:v nested_non_zero_yep -// lldb-check:[...] Yep(10.5, NestedNonZeroField { a: 10, b: 20, c: &[...] }) +// lldb-check:[...] Yep(10.5, {a:10, b:20, c:[...]}) { 0 = 10.5 1 = { a = 10 b = 20 c = [...] } } // lldb-command:v nested_non_zero_nope // lldb-check:[...] Nope diff --git a/tests/debuginfo/strings-and-strs.rs b/tests/debuginfo/strings-and-strs.rs index 392cf697e110b..baeebda26a902 100644 --- a/tests/debuginfo/strings-and-strs.rs +++ b/tests/debuginfo/strings-and-strs.rs @@ -31,15 +31,14 @@ // lldb-check:(&str) plain_str = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } // lldb-command:v str_in_struct -// lldb-check:((&str, &str)) str_in_tuple = { 0 = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } 1 = "World" { [0] = 'W' [1] = 'o' [2] = 'r' [3] = 'l' [4] = 'd' } } +// lldb-check:(strings_and_strs::Foo) str_in_struct = { inner = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } } // lldb-command:v str_in_tuple -// lldb-check:((&str, &str)) str_in_tuple = { 0 = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } 1 = "World" { [0] = 'W' [1] = 'o' [2] = 'r' [3] = 'l' [4] = 'd' } } +// lldb-check:((&str, &str)) str_in_tuple = ("Hello", "World") { 0 = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } 1 = "World" { [0] = 'W' [1] = 'o' [2] = 'r' [3] = 'l' [4] = 'd' } } // lldb-command:v str_in_rc // lldb-check:(alloc::rc::Rc<&str, alloc::alloc::Global>) str_in_rc = strong=1, weak=0 { value = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } } - #![allow(unused_variables)] pub struct Foo<'a> { diff --git a/tests/debuginfo/struct-in-enum.rs b/tests/debuginfo/struct-in-enum.rs index bd61e7cb14377..640066b8d0b13 100644 --- a/tests/debuginfo/struct-in-enum.rs +++ b/tests/debuginfo/struct-in-enum.rs @@ -24,12 +24,13 @@ // lldb-command:run // lldb-command:v case1 -// lldb-check:[...] Case1(0, Struct { x: 2088533116, y: 2088533116, z: 31868 }) +// lldb-check:[...] Case1(0, {x:2088533116, y:2088533116, z:31868}) { 0 = 0 1 = { x = 2088533116 y = 2088533116 z = 31868 } } + // lldb-command:v case2 -// lldb-check:[...] Case2(0, 1229782938247303441, 4369) +// lldb-check:[...] Case2(0, 1229782938247303441, 4369) { 0 = 0 1 = 1229782938247303441 2 = 4369 } // lldb-command:v univariant -// lldb-check:[...] TheOnlyCase(Struct { x: 123, y: 456, z: 789 }) +// lldb-check:[...] TheOnlyCase({x:123, y:456, z:789}) { 0 = { x = 123 y = 456 z = 789 } } #![allow(unused_variables)] diff --git a/tests/debuginfo/struct-style-enum.rs b/tests/debuginfo/struct-style-enum.rs index 48ef97896ac15..4bbd879257042 100644 --- a/tests/debuginfo/struct-style-enum.rs +++ b/tests/debuginfo/struct-style-enum.rs @@ -26,16 +26,16 @@ // lldb-command:run // lldb-command:v case1 -// lldb-check:(struct_style_enum::Regular) case1 = { value = { a = 0 b = 31868 c = 31868 d = 31868 e = 31868 } $discr$ = 0 } +// lldb-check:(struct_style_enum::Regular) case1 = Case1{a:0, b:31868, c:31868, d:31868, e:31868} { a = 0 b = 31868 c = 31868 d = 31868 e = 31868 } // lldb-command:v case2 -// lldb-check:(struct_style_enum::Regular) case2 = { value = { a = 0 b = 286331153 c = 286331153 } $discr$ = 1 } +// lldb-check:(struct_style_enum::Regular) case2 = Case2{a:0, b:286331153, c:286331153} { a = 0 b = 286331153 c = 286331153 } // lldb-command:v case3 -// lldb-check:(struct_style_enum::Regular) case3 = { value = { a = 0 b = 6438275382588823897 } $discr$ = 2 } +// lldb-check:(struct_style_enum::Regular) case3 = Case3{a:0, b:6438275382588823897} { a = 0 b = 6438275382588823897 } // lldb-command:v univariant -// lldb-check:(struct_style_enum::Univariant) univariant = { value = { a = -1 } } +// lldb-check:(struct_style_enum::Univariant) univariant = TheOnlyCase{a:-1} { a = -1 } #![allow(unused_variables)] diff --git a/tests/debuginfo/tuple-in-tuple.rs b/tests/debuginfo/tuple-in-tuple.rs index e906cbed67db7..40e88f1b20848 100644 --- a/tests/debuginfo/tuple-in-tuple.rs +++ b/tests/debuginfo/tuple-in-tuple.rs @@ -29,21 +29,21 @@ // lldb-command:run // lldb-command:v no_padding1 -// lldb-check:[...] { 0 = { 0 = 0 1 = 1 } 1 = 2 2 = 3 } +// lldb-check:[...] ((0, 1), 2, 3) { 0 = (0, 1) { 0 = 0 1 = 1 } 1 = 2 2 = 3 } // lldb-command:v no_padding2 -// lldb-check:[...] { 0 = 4 1 = { 0 = 5 1 = 6 } 2 = 7 } +// lldb-check:[...] (4, (5, 6), 7) { 0 = 4 1 = (5, 6) { 0 = 5 1 = 6 } 2 = 7 } // lldb-command:v no_padding3 -// lldb-check:[...] { 0 = 8 1 = 9 2 = { 0 = 10 1 = 11 } } +// lldb-check:[...] (8, 9, (10, 11)) { 0 = 8 1 = 9 2 = (10, 11) { 0 = 10 1 = 11 } } // lldb-command:v internal_padding1 -// lldb-check:[...] { 0 = 12 1 = { 0 = 13 1 = 14 } } +// lldb-check:[...] (12, (13, 14)) { 0 = 12 1 = (13, 14) { 0 = 13 1 = 14 } } // lldb-command:v internal_padding2 -// lldb-check:[...] { 0 = 15 1 = { 0 = 16 1 = 17 } } +// lldb-check:[...] (15, (16, 17)) { 0 = 15 1 = (16, 17) { 0 = 16 1 = 17 } } // lldb-command:v padding_at_end1 -// lldb-check:[...] { 0 = 18 1 = { 0 = 19 1 = 20 } } +// lldb-check:[...] (18, (19, 20)) { 0 = 18 1 = (19, 20) { 0 = 19 1 = 20 } } // lldb-command:v padding_at_end2 -// lldb-check:[...] { 0 = { 0 = 21 1 = 22 } 1 = 23 } +// lldb-check:[...] ((21, 22), 23) { 0 = (21, 22) { 0 = 21 1 = 22 } 1 = 23 } // === CDB TESTS ================================================================================== diff --git a/tests/debuginfo/tuple-style-enum.rs b/tests/debuginfo/tuple-style-enum.rs index a452c57b30423..6568a2f70ab31 100644 --- a/tests/debuginfo/tuple-style-enum.rs +++ b/tests/debuginfo/tuple-style-enum.rs @@ -27,16 +27,16 @@ // lldb-command:run // lldb-command:v case1 -// lldb-check:(tuple_style_enum::Regular) case1 = { value = { 0 = 0 1 = 31868 2 = 31868 3 = 31868 4 = 31868 } $discr$ = 0 } +// lldb-check:(tuple_style_enum::Regular) case1 = Case1(0, 31868, 31868, 31868, 31868) { 0 = 0 1 = 31868 2 = 31868 3 = 31868 4 = 31868 } // lldb-command:v case2 -// lldb-check:(tuple_style_enum::Regular) case2 = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 } +// lldb-check:(tuple_style_enum::Regular) case2 = Case2(0, 286331153, 286331153) { 0 = 0 1 = 286331153 2 = 286331153 } // lldb-command:v case3 -// lldb-check:(tuple_style_enum::Regular) case3 = { value = { 0 = 0 1 = 6438275382588823897 } $discr$ = 2 } +// lldb-check:(tuple_style_enum::Regular) case3 = Case3(0, 6438275382588823897) { 0 = 0 1 = 6438275382588823897 } // lldb-command:v univariant -// lldb-check:(tuple_style_enum::Univariant) univariant = { value = { 0 = -1 } } +// lldb-check:(tuple_style_enum::Univariant) univariant = TheOnlyCase(-1) { 0 = -1 } #![allow(unused_variables)] diff --git a/tests/debuginfo/union-smoke.rs b/tests/debuginfo/union-smoke.rs index beaf4c8fa8fe3..be6a9d578646f 100644 --- a/tests/debuginfo/union-smoke.rs +++ b/tests/debuginfo/union-smoke.rs @@ -14,10 +14,10 @@ // lldb-command:run // lldb-command:v u -// lldb-check:[...] { a = { 0 = '\x02' 1 = '\x02' } b = 514 } +// lldb-check:[...] { a = ('\x02', '\x02') { 0 = '\x02' 1 = '\x02' } b = 514 } // lldb-command:print union_smoke::SU -// lldb-check:[...] { a = { 0 = '\x01' 1 = '\x01' } b = 257 } +// lldb-check:[...] { a = ('\x01', '\x01') { 0 = '\x01' 1 = '\x01' } b = 257 } #![allow(unused)] diff --git a/tests/debuginfo/unique-enum.rs b/tests/debuginfo/unique-enum.rs index a9b928456e936..6a742f9378dfc 100644 --- a/tests/debuginfo/unique-enum.rs +++ b/tests/debuginfo/unique-enum.rs @@ -23,13 +23,13 @@ // lldb-command:run // lldb-command:v *the_a -// lldb-check:(unique_enum::ABC) *the_a = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 } +// lldb-check:(unique_enum::ABC) *the_a = TheA{x:0, y:8970181431921507452} { x = 0 y = 8970181431921507452 } // lldb-command:v *the_b -// lldb-check:(unique_enum::ABC) *the_b = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 } +// lldb-check:(unique_enum::ABC) *the_b = TheB(0, 286331153, 286331153) { 0 = 0 1 = 286331153 2 = 286331153 } // lldb-command:v *univariant -// lldb-check:(unique_enum::Univariant) *univariant = { value = { 0 = 123234 } } +// lldb-check:(unique_enum::Univariant) *univariant = TheOnlyCase(123234) { 0 = 123234 } #![allow(unused_variables)] diff --git a/tests/debuginfo/vec-slices.rs b/tests/debuginfo/vec-slices.rs index 7ed6b0cb66401..fdfc7019add69 100644 --- a/tests/debuginfo/vec-slices.rs +++ b/tests/debuginfo/vec-slices.rs @@ -67,7 +67,7 @@ // lldb-check:[...] size=2 { [0] = 3 [1] = 4 } // lldb-command:v padded_tuple -// lldb-check:[...] size=2 { [0] = { 0 = 6 1 = 7 } [1] = { 0 = 8 1 = 9 } } +// lldb-check:[...] size=2 { [0] = (6, 7) { 0 = 6 1 = 7 } [1] = (8, 9) { 0 = 8 1 = 9 } } // lldb-command:v padded_struct // lldb-check:[...] size=2 { [0] = { x = 10 y = 11 z = 12 } [1] = { x = 13 y = 14 z = 15 } }