From bf56217dd4982c69478460c1bec643a5d333b158 Mon Sep 17 00:00:00 2001 From: Walnut <39544927+Walnut356@users.noreply.github.com> Date: Sat, 1 Aug 2026 03:55:13 -0500 Subject: [PATCH 1/2] Fix msvc type resolution for strs and slices --- src/etc/lldb_batchmode/from_lldb.py | 5 ++++ src/etc/lldb_providers.py | 38 ++++++++++++++++++++++++----- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/etc/lldb_batchmode/from_lldb.py b/src/etc/lldb_batchmode/from_lldb.py index 987617b683de6..6271b67f35b8a 100644 --- a/src/etc/lldb_batchmode/from_lldb.py +++ b/src/etc/lldb_batchmode/from_lldb.py @@ -28,6 +28,11 @@ HAS_FLOAT128: bool = getattr(lldb, "eBasicTypeFloat128", None) is not None + +class FromLLDB(Exception): + pass + + # We use the following lists to dynamically create the enums at run-time (they're used to print # more meaningful error messages when basic_type and type_class don't match). # It takes a few hundred microseconds at runtime to generate these lists, but it means we never have diff --git a/src/etc/lldb_providers.py b/src/etc/lldb_providers.py index fed6aad24caaf..571630859d150 100644 --- a/src/etc/lldb_providers.py +++ b/src/etc/lldb_providers.py @@ -196,11 +196,23 @@ def has_children(self) -> bool: return False +MSVC_STR_NAMES: List[str] = [ + "ref$", + "ref_mut$", + "ptr_const$", + "ptr_mut$", +] + + def get_template_args(type_name: str) -> Generator[str, None, None]: """ Takes a type name `T, D>` and returns a list of its generic args `["A", "tuple$", "D"]`. + Always returns an empty generator for `&str`, `&mut str`, `*const str`, and `*mut str` + + Strips off `enum2$<>` wrapper from enum types before checking for template args + String-based replacement for LLDB's `SBType.template_args`, as LLDB is currently unable to populate this field for targets with PDB debug info. Also useful for manually altering the type name of generics (e.g. `Vec >` -> `Vec<&str>`). @@ -208,6 +220,13 @@ def get_template_args(type_name: str) -> Generator[str, None, None]: Each element of the returned list can be looked up for its `SBType` value via `SBTarget.FindFirstType()` """ + if type_name in MSVC_STR_NAMES: + return + + if type_name.startswith(("enum2$<", "slice2$<")): + # remove the prefix and the trailing ">" + type_name = type_name.split("<", 1)[0][:-1].strip() + level = 0 start = 0 for i, c in enumerate(type_name): @@ -224,7 +243,7 @@ def get_template_args(type_name: str) -> Generator[str, None, None]: start = i + 1 -MSVC_PTR_PREFIX: List[str] = ["ref$<", "ref_mut$<", "ptr_const$<", "ptr_mut$<"] +MSVC_PTR_PREFIX = ("ref$<", "ref_mut$<", "ptr_const$<", "ptr_mut$<") PRIMITIVE_TYPES: Dict[str, int] = { "u8": eBasicTypeUnsignedChar, @@ -258,6 +277,14 @@ def resolve_msvc_template_arg(arg_name: str, target: SBTarget) -> SBType: `base_type.GetArrayType()`, which bypass the PDB file and ask clang directly for the type node. """ + result = target.FindFirstType(arg_name) + + if result.IsValid(): + return result + + if arg_name in MSVC_STR_NAMES: + return target.FindFirstType(arg_name) + # As of LLDB 22, finding primitives based on `FindFirstType` with their rust name no longer # works. Instead, we can look them up by their `eBasicType` equivalent. For usize and isize, # we convert them to their bit-sized counterpart before the lookup @@ -273,11 +300,6 @@ def resolve_msvc_template_arg(arg_name: str, target: SBTarget) -> SBType: return target.GetBasicType(eBasicTypeFloat128) - result = target.FindFirstType(arg_name) - - if result.IsValid(): - return result - for prefix in MSVC_PTR_PREFIX: if arg_name.startswith(prefix): arg_name = arg_name[len(prefix) : -1].strip() @@ -285,6 +307,10 @@ def resolve_msvc_template_arg(arg_name: str, target: SBTarget) -> SBType: result = resolve_msvc_template_arg(arg_name, target) return result.GetPointerType() + if arg_name.startswith("slice2$<"): + arg_name = arg_name[len("slice2$<") : -1].strip() + return resolve_msvc_template_arg(arg_name, target) + if arg_name.startswith("array$<"): template_args = get_template_args(arg_name) From e103797bfd03c2bd67c1e1c48cce692d75c687e4 Mon Sep 17 00:00:00 2001 From: Walnut <39544927+Walnut356@users.noreply.github.com> Date: Sat, 1 Aug 2026 03:56:47 -0500 Subject: [PATCH 2/2] convert `pretty-std` to `lldb-repr` --- src/etc/lldb_batchmode/from_lldb.py | 10 +- .../pretty-std/lldb_input/non_windows.json | 946 +++++++++++++++++ .../pretty-std/lldb_input/windows_gnu.json | 984 ++++++++++++++++++ .../pretty-std/lldb_input/windows_msvc.json | 911 ++++++++++++++++ .../{pretty-std.rs => pretty-std/main.rs} | 47 +- 5 files changed, 2868 insertions(+), 30 deletions(-) create mode 100644 tests/debuginfo/pretty-std/lldb_input/non_windows.json create mode 100644 tests/debuginfo/pretty-std/lldb_input/windows_gnu.json create mode 100644 tests/debuginfo/pretty-std/lldb_input/windows_msvc.json rename tests/debuginfo/{pretty-std.rs => pretty-std/main.rs} (83%) diff --git a/src/etc/lldb_batchmode/from_lldb.py b/src/etc/lldb_batchmode/from_lldb.py index 6271b67f35b8a..e86ef3bb52a0c 100644 --- a/src/etc/lldb_batchmode/from_lldb.py +++ b/src/etc/lldb_batchmode/from_lldb.py @@ -183,7 +183,7 @@ def get_summary_or_value(valobj: lldb.SBValue) -> Optional[str]: def field_from_lldb(field: lldb.SBTypeMember) -> Field: if BLESS and not field.IsValid(): - raise Exception("Cannot bless invalid SBTypeMember object") + raise FromLLDB("Cannot bless invalid SBTypeMember object") return Field(field.GetName(), field.GetType().GetName(), field.GetOffsetInBytes()) @@ -227,7 +227,7 @@ def get_generics(ty: lldb.SBType, sbtarget: lldb.SBTarget) -> list[lldb.SBType]: def type_from_lldb(ty: lldb.SBType, sbtarget: lldb.SBTarget) -> Type: if BLESS and not ty.IsValid(): - raise Exception("Cannot bless invalid SBType object") + raise FromLLDB("Cannot bless invalid SBType object") generic_types = get_generics(ty, sbtarget) generics = [g.GetName() for g in generic_types] @@ -243,7 +243,7 @@ def type_from_lldb(ty: lldb.SBType, sbtarget: lldb.SBTarget) -> Type: def child_from_lldb(child: lldb.SBValue) -> Child: if BLESS and not child.IsValid(): - raise Exception("Cannot bless invalid child") + raise FromLLDB("Cannot bless invalid child") sbtype: lldb.SBType = child.GetType() @@ -261,7 +261,7 @@ def child_from_lldb(child: lldb.SBValue) -> Child: def variable_from_lldb(var: lldb.SBValue) -> Variable: if BLESS and not var.IsValid(): - raise Exception("Cannot bless invalid SBValue object") + raise FromLLDB("Cannot bless invalid SBValue object") sbtype = var.GetType() type_name = sbtype.GetName() @@ -328,7 +328,7 @@ def bless_variable( valobj = frame.FindVariable(var_name) if not valobj.IsValid(): # FIXME (todo) error handling - raise Exception(f"") + raise FromLLDB(f"") # HACK it's obviously not ideal to output empty breakpoints, but it will be somewhat rare for it # to happen (you would need a breakpoint with repr -> breakpoint without repr -> breakpoint diff --git a/tests/debuginfo/pretty-std/lldb_input/non_windows.json b/tests/debuginfo/pretty-std/lldb_input/non_windows.json new file mode 100644 index 0000000000000..7c0604ade2116 --- /dev/null +++ b/tests/debuginfo/pretty-std/lldb_input/non_windows.json @@ -0,0 +1,946 @@ +{ + "bless_metadata": { + "python_version": "3.14.5 (main, May 11 2026, 00:00:00) [GCC 16.1.1 20260501 (Red Hat 16.1.1-1)]", + "debugger_version": "lldb version 22.1.8", + "feature_flags": "LLDBFeature.StaticFields|TypeRecognizers|Float128" + }, + "types": { + "&[i32]": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "data_ptr", + "type": "int *", + "offset": 0 + }, + { + "name": "length", + "type": "unsigned long", + "offset": 8 + } + ], + "generic_params": [] + }, + "int *": { + "size": 8, + "basic_type": 0, + "type_class": 4096, + "fields": [], + "generic_params": [] + }, + "unsigned long": { + "size": 8, + "basic_type": 16, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "int": { + "size": 4, + "basic_type": 13, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "alloc::vec::Vec": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long", + "offset": 16 + } + ], + "generic_params": [ + "unsigned long", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "unsigned long", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVecInner": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "ptr", + "type": "core::ptr::unique::Unique", + "offset": 8 + }, + { + "name": "cap", + "type": "core::num::niche_types::UsizeNoHighBit", + "offset": 0 + }, + { + "name": "alloc", + "type": "alloc::alloc::Global", + "offset": 16 + } + ], + "generic_params": [ + "alloc::alloc::Global" + ] + }, + "core::ptr::unique::Unique": { + "size": 8, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "pointer", + "type": "core::ptr::non_null::NonNull", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 8 + } + ], + "generic_params": [ + "unsigned char" + ] + }, + "core::ptr::non_null::NonNull": { + "size": 8, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "pointer", + "type": "unsigned char *", + "offset": 0 + } + ], + "generic_params": [ + "unsigned char" + ] + }, + "unsigned char *": { + "size": 8, + "basic_type": 0, + "type_class": 4096, + "fields": [], + "generic_params": [] + }, + "unsigned char": { + "size": 1, + "basic_type": 4, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "core::marker::PhantomData": { + "size": 0, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [ + "unsigned char" + ] + }, + "core::num::niche_types::UsizeNoHighBit": { + "size": 8, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "unsigned long", + "offset": 0 + } + ], + "generic_params": [] + }, + "alloc::alloc::Global": { + "size": 0, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [] + }, + "core::marker::PhantomData": { + "size": 0, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [ + "unsigned long" + ] + }, + "&str": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "data_ptr", + "type": "unsigned char *", + "offset": 0 + }, + { + "name": "length", + "type": "unsigned long", + "offset": 8 + } + ], + "generic_params": [] + }, + "alloc::string::String": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "vec", + "type": "alloc::vec::Vec", + "offset": 0 + } + ], + "generic_params": [] + }, + "alloc::vec::Vec": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long", + "offset": 16 + } + ], + "generic_params": [ + "unsigned char", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "unsigned char", + "alloc::alloc::Global" + ] + }, + "core::option::Option": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$variants$", + "type": "core::option::Option::core::option::Option$Inner", + "offset": 0 + } + ], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner": { + "size": 4, + "basic_type": 0, + "type_class": 65536, + "fields": [ + { + "name": "$variant$0", + "type": "core::option::Option::core::option::Option$Inner::None$Variant", + "offset": 0 + }, + { + "name": "$variant$1", + "type": "core::option::Option::core::option::Option$Inner::Some$Variant", + "offset": 0 + } + ], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner::None$Variant": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned short", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option::None", + "offset": 2 + } + ], + "generic_params": [] + }, + "unsigned short": { + "size": 2, + "basic_type": 12, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "core::option::Option::None": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [ + "short" + ] + }, + "short": { + "size": 2, + "basic_type": 11, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner::Some$Variant": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned short", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option::Some", + "offset": 2 + } + ], + "generic_params": [] + }, + "core::option::Option::Some": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "short", + "offset": 2 + } + ], + "generic_params": [ + "short" + ] + }, + "core::option::Option": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$variants$", + "type": "core::option::Option::core::option::Option$Inner", + "offset": 0 + } + ], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner": { + "size": 16, + "basic_type": 0, + "type_class": 65536, + "fields": [ + { + "name": "$variant$0", + "type": "core::option::Option::core::option::Option$Inner::None$Variant", + "offset": 0 + }, + { + "name": "$variant$1", + "type": "core::option::Option::core::option::Option$Inner::Some$Variant", + "offset": 0 + } + ], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner::None$Variant": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned long", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option::None", + "offset": 8 + } + ], + "generic_params": [] + }, + "core::option::Option::None": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [ + "long" + ] + }, + "long": { + "size": 8, + "basic_type": 15, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner::Some$Variant": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned long", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option::Some", + "offset": 8 + } + ], + "generic_params": [] + }, + "core::option::Option::Some": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "long", + "offset": 8 + } + ], + "generic_params": [ + "long" + ] + }, + "std::ffi::os_str::OsString": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "std::sys::os_str::bytes::Buf", + "offset": 0 + } + ], + "generic_params": [] + }, + "std::sys::os_str::bytes::Buf": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::vec::Vec", + "offset": 0 + } + ], + "generic_params": [] + } + }, + "breakpoints": [ + { + "slice": { + "type": "&[i32]", + "pretty_type_name": null, + "pretty_print": "size=4", + "value": null, + "synthetic": "lldb_lookup.StdSliceSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "int", + "value": 0, + "children": [] + }, + { + "name": "[1]", + "type": "int", + "value": 1, + "children": [] + }, + { + "name": "[2]", + "type": "int", + "value": 2, + "children": [] + }, + { + "name": "[3]", + "type": "int", + "value": 3, + "children": [] + } + ] + }, + "vec": { + "type": "alloc::vec::Vec", + "pretty_type_name": null, + "pretty_print": "size=4", + "value": null, + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "unsigned long", + "value": 4, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned long", + "value": 5, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned long", + "value": 6, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned long", + "value": 7, + "children": [] + } + ] + }, + "str_slice": { + "type": "&str", + "pretty_type_name": null, + "pretty_print": "\"IAMA string slice!\"", + "value": null, + "synthetic": "lldb_lookup.StdSliceSyntheticProvider", + "summary": "lldb_lookup.StdStrSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "unsigned char", + "value": 73, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned char", + "value": 77, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[4]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[5]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[6]", + "type": "unsigned char", + "value": 116, + "children": [] + }, + { + "name": "[7]", + "type": "unsigned char", + "value": 114, + "children": [] + }, + { + "name": "[8]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[9]", + "type": "unsigned char", + "value": 110, + "children": [] + }, + { + "name": "[10]", + "type": "unsigned char", + "value": 103, + "children": [] + }, + { + "name": "[11]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[12]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[13]", + "type": "unsigned char", + "value": 108, + "children": [] + }, + { + "name": "[14]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[15]", + "type": "unsigned char", + "value": 99, + "children": [] + }, + { + "name": "[16]", + "type": "unsigned char", + "value": 101, + "children": [] + }, + { + "name": "[17]", + "type": "unsigned char", + "value": 33, + "children": [] + } + ] + }, + "string": { + "type": "alloc::string::String", + "pretty_type_name": null, + "pretty_print": "\"IAMA string!\"", + "value": null, + "synthetic": "lldb_lookup.StdStringSyntheticProvider", + "summary": "lldb_lookup.StdStringSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "unsigned char", + "value": 73, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned char", + "value": 77, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[4]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[5]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[6]", + "type": "unsigned char", + "value": 116, + "children": [] + }, + { + "name": "[7]", + "type": "unsigned char", + "value": 114, + "children": [] + }, + { + "name": "[8]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[9]", + "type": "unsigned char", + "value": 110, + "children": [] + }, + { + "name": "[10]", + "type": "unsigned char", + "value": 103, + "children": [] + }, + { + "name": "[11]", + "type": "unsigned char", + "value": 33, + "children": [] + } + ] + }, + "some": { + "type": "core::option::Option", + "pretty_type_name": null, + "pretty_print": "Some(8)", + "value": null, + "synthetic": "lldb_lookup.synthetic_lookup", + "summary": "lldb_lookup.ClangEncodedEnumSummaryProvider", + "format": null, + "children": [ + { + "name": "0", + "type": "short", + "value": 8, + "children": [] + } + ] + }, + "none": { + "type": "core::option::Option", + "pretty_type_name": null, + "pretty_print": "None", + "value": null, + "synthetic": "lldb_lookup.synthetic_lookup", + "summary": "lldb_lookup.ClangEncodedEnumSummaryProvider", + "format": null, + "children": [] + }, + "os_string": { + "type": "std::ffi::os_str::OsString", + "pretty_type_name": null, + "pretty_print": "\"IAMA OS string \ud83d\ude03\"", + "value": null, + "synthetic": "lldb_lookup.synthetic_lookup", + "summary": "lldb_lookup.StdOsStringSummaryProvider", + "format": null, + "children": [ + { + "name": "inner", + "type": "std::sys::os_str::bytes::Buf", + "value": null, + "children": [ + { + "name": "inner", + "type": "alloc::vec::Vec", + "value": null, + "children": [ + { + "name": "[0]", + "type": "unsigned char", + "value": 73, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned char", + "value": 77, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[4]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[5]", + "type": "unsigned char", + "value": 79, + "children": [] + }, + { + "name": "[6]", + "type": "unsigned char", + "value": 83, + "children": [] + }, + { + "name": "[7]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[8]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[9]", + "type": "unsigned char", + "value": 116, + "children": [] + }, + { + "name": "[10]", + "type": "unsigned char", + "value": 114, + "children": [] + }, + { + "name": "[11]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[12]", + "type": "unsigned char", + "value": 110, + "children": [] + }, + { + "name": "[13]", + "type": "unsigned char", + "value": 103, + "children": [] + }, + { + "name": "[14]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[15]", + "type": "unsigned char", + "value": -16, + "children": [] + }, + { + "name": "[16]", + "type": "unsigned char", + "value": -97, + "children": [] + }, + { + "name": "[17]", + "type": "unsigned char", + "value": -104, + "children": [] + }, + { + "name": "[18]", + "type": "unsigned char", + "value": -125, + "children": [] + } + ] + } + ] + } + ] + } + } + ] +} diff --git a/tests/debuginfo/pretty-std/lldb_input/windows_gnu.json b/tests/debuginfo/pretty-std/lldb_input/windows_gnu.json new file mode 100644 index 0000000000000..1f2636fc40ca6 --- /dev/null +++ b/tests/debuginfo/pretty-std/lldb_input/windows_gnu.json @@ -0,0 +1,984 @@ +{ + "bless_metadata": { + "python_version": "3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]", + "debugger_version": "lldb version 22.1.2 (https://github.com/llvm/llvm-project revision 1ab49a973e210e97d61e5db6557180dcb92c3e98)\n clang revision 1ab49a973e210e97d61e5db6557180dcb92c3e98\n llvm revision 1ab49a973e210e97d61e5db6557180dcb92c3e98", + "feature_flags": "LLDBFeature.StaticFields|TypeRecognizers|Float128" + }, + "types": { + "&[i32]": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "data_ptr", + "type": "int *", + "offset": 0 + }, + { + "name": "length", + "type": "unsigned long long", + "offset": 8 + } + ], + "generic_params": [] + }, + "int *": { + "size": 8, + "basic_type": 0, + "type_class": 4096, + "fields": [], + "generic_params": [] + }, + "unsigned long long": { + "size": 8, + "basic_type": 18, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "int": { + "size": 4, + "basic_type": 13, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "alloc::vec::Vec": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "unsigned long long", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "unsigned long long", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVecInner": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "ptr", + "type": "core::ptr::unique::Unique", + "offset": 8 + }, + { + "name": "cap", + "type": "core::num::niche_types::UsizeNoHighBit", + "offset": 0 + }, + { + "name": "alloc", + "type": "alloc::alloc::Global", + "offset": 16 + } + ], + "generic_params": [ + "alloc::alloc::Global" + ] + }, + "core::ptr::unique::Unique": { + "size": 8, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "pointer", + "type": "core::ptr::non_null::NonNull", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 8 + } + ], + "generic_params": [ + "unsigned char" + ] + }, + "core::ptr::non_null::NonNull": { + "size": 8, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "pointer", + "type": "unsigned char *", + "offset": 0 + } + ], + "generic_params": [ + "unsigned char" + ] + }, + "unsigned char *": { + "size": 8, + "basic_type": 0, + "type_class": 4096, + "fields": [], + "generic_params": [] + }, + "unsigned char": { + "size": 1, + "basic_type": 4, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "core::marker::PhantomData": { + "size": 0, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [ + "unsigned char" + ] + }, + "core::num::niche_types::UsizeNoHighBit": { + "size": 8, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "unsigned long long", + "offset": 0 + } + ], + "generic_params": [] + }, + "alloc::alloc::Global": { + "size": 0, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [] + }, + "core::marker::PhantomData": { + "size": 0, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [ + "unsigned long long" + ] + }, + "&str": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "data_ptr", + "type": "unsigned char *", + "offset": 0 + }, + { + "name": "length", + "type": "unsigned long long", + "offset": 8 + } + ], + "generic_params": [] + }, + "alloc::string::String": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "vec", + "type": "alloc::vec::Vec", + "offset": 0 + } + ], + "generic_params": [] + }, + "alloc::vec::Vec": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "unsigned char", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "unsigned char", + "alloc::alloc::Global" + ] + }, + "core::option::Option": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$variants$", + "type": "core::option::Option::core::option::Option$Inner", + "offset": 0 + } + ], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner": { + "size": 6, + "basic_type": 0, + "type_class": 65536, + "fields": [ + { + "name": "$variant$0", + "type": "core::option::Option::core::option::Option$Inner::None$Variant", + "offset": 0 + }, + { + "name": "$variant$1", + "type": "core::option::Option::core::option::Option$Inner::Some$Variant", + "offset": 0 + } + ], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner::None$Variant": { + "size": 6, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned short", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option::None", + "offset": 2 + } + ], + "generic_params": [] + }, + "unsigned short": { + "size": 2, + "basic_type": 12, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "core::option::Option::None": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [ + "short" + ] + }, + "short": { + "size": 2, + "basic_type": 11, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner::Some$Variant": { + "size": 6, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned short", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option::Some", + "offset": 2 + } + ], + "generic_params": [] + }, + "core::option::Option::Some": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "short", + "offset": 2 + } + ], + "generic_params": [ + "short" + ] + }, + "core::option::Option": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$variants$", + "type": "core::option::Option::core::option::Option$Inner", + "offset": 0 + } + ], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner": { + "size": 24, + "basic_type": 0, + "type_class": 65536, + "fields": [ + { + "name": "$variant$0", + "type": "core::option::Option::core::option::Option$Inner::None$Variant", + "offset": 0 + }, + { + "name": "$variant$1", + "type": "core::option::Option::core::option::Option$Inner::Some$Variant", + "offset": 0 + } + ], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner::None$Variant": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned long long", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option::None", + "offset": 8 + } + ], + "generic_params": [] + }, + "core::option::Option::None": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [ + "long long" + ] + }, + "long long": { + "size": 8, + "basic_type": 17, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "core::option::Option::core::option::Option$Inner::Some$Variant": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned long long", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option::Some", + "offset": 8 + } + ], + "generic_params": [] + }, + "core::option::Option::Some": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "long long", + "offset": 8 + } + ], + "generic_params": [ + "long long" + ] + }, + "std::ffi::os_str::OsString": { + "size": 32, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "std::sys::os_str::wtf8::Buf", + "offset": 0 + } + ], + "generic_params": [] + }, + "std::sys::os_str::wtf8::Buf": { + "size": 32, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::wtf8::Wtf8Buf", + "offset": 0 + } + ], + "generic_params": [] + }, + "alloc::wtf8::Wtf8Buf": { + "size": 32, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "bytes", + "type": "alloc::vec::Vec", + "offset": 0 + }, + { + "name": "is_known_utf8", + "type": "bool", + "offset": 24 + } + ], + "generic_params": [] + }, + "bool": { + "size": 1, + "basic_type": 21, + "type_class": 4, + "fields": [], + "generic_params": [] + } + }, + "breakpoints": [ + { + "slice": { + "type": "&[i32]", + "pretty_type_name": null, + "pretty_print": "size=4", + "value": null, + "synthetic": "lldb_lookup.StdSliceSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "int", + "value": 0, + "children": [] + }, + { + "name": "[1]", + "type": "int", + "value": 1, + "children": [] + }, + { + "name": "[2]", + "type": "int", + "value": 2, + "children": [] + }, + { + "name": "[3]", + "type": "int", + "value": 3, + "children": [] + } + ] + }, + "vec": { + "type": "alloc::vec::Vec", + "pretty_type_name": null, + "pretty_print": "size=4", + "value": null, + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "unsigned long long", + "value": 4, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned long long", + "value": 5, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned long long", + "value": 6, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned long long", + "value": 7, + "children": [] + } + ] + }, + "str_slice": { + "type": "&str", + "pretty_type_name": null, + "pretty_print": "\"IAMA string slice!\"", + "value": null, + "synthetic": "lldb_lookup.StdSliceSyntheticProvider", + "summary": "lldb_lookup.StdStrSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "unsigned char", + "value": 73, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned char", + "value": 77, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[4]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[5]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[6]", + "type": "unsigned char", + "value": 116, + "children": [] + }, + { + "name": "[7]", + "type": "unsigned char", + "value": 114, + "children": [] + }, + { + "name": "[8]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[9]", + "type": "unsigned char", + "value": 110, + "children": [] + }, + { + "name": "[10]", + "type": "unsigned char", + "value": 103, + "children": [] + }, + { + "name": "[11]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[12]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[13]", + "type": "unsigned char", + "value": 108, + "children": [] + }, + { + "name": "[14]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[15]", + "type": "unsigned char", + "value": 99, + "children": [] + }, + { + "name": "[16]", + "type": "unsigned char", + "value": 101, + "children": [] + }, + { + "name": "[17]", + "type": "unsigned char", + "value": 33, + "children": [] + } + ] + }, + "string": { + "type": "alloc::string::String", + "pretty_type_name": null, + "pretty_print": "\"IAMA string!\"", + "value": null, + "synthetic": "lldb_lookup.StdStringSyntheticProvider", + "summary": "lldb_lookup.StdStringSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "unsigned char", + "value": 73, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned char", + "value": 77, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[4]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[5]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[6]", + "type": "unsigned char", + "value": 116, + "children": [] + }, + { + "name": "[7]", + "type": "unsigned char", + "value": 114, + "children": [] + }, + { + "name": "[8]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[9]", + "type": "unsigned char", + "value": 110, + "children": [] + }, + { + "name": "[10]", + "type": "unsigned char", + "value": 103, + "children": [] + }, + { + "name": "[11]", + "type": "unsigned char", + "value": 33, + "children": [] + } + ] + }, + "some": { + "type": "core::option::Option", + "pretty_type_name": null, + "pretty_print": "Some(8)", + "value": null, + "synthetic": "lldb_lookup.synthetic_lookup", + "summary": "lldb_lookup.ClangEncodedEnumSummaryProvider", + "format": null, + "children": [ + { + "name": "0", + "type": "short", + "value": 8, + "children": [] + } + ] + }, + "none": { + "type": "core::option::Option", + "pretty_type_name": null, + "pretty_print": "None", + "value": null, + "synthetic": "lldb_lookup.synthetic_lookup", + "summary": "lldb_lookup.ClangEncodedEnumSummaryProvider", + "format": null, + "children": [] + }, + "os_string": { + "type": "std::ffi::os_str::OsString", + "pretty_type_name": null, + "pretty_print": "\"IAMA OS string \ud83d\ude03\"", + "value": null, + "synthetic": "lldb_lookup.synthetic_lookup", + "summary": "lldb_lookup.StdOsStringSummaryProvider", + "format": null, + "children": [ + { + "name": "inner", + "type": "std::sys::os_str::wtf8::Buf", + "value": null, + "children": [ + { + "name": "inner", + "type": "alloc::wtf8::Wtf8Buf", + "value": null, + "children": [ + { + "name": "bytes", + "type": "alloc::vec::Vec", + "value": null, + "children": [ + { + "name": "[0]", + "type": "unsigned char", + "value": 73, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned char", + "value": 77, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[4]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[5]", + "type": "unsigned char", + "value": 79, + "children": [] + }, + { + "name": "[6]", + "type": "unsigned char", + "value": 83, + "children": [] + }, + { + "name": "[7]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[8]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[9]", + "type": "unsigned char", + "value": 116, + "children": [] + }, + { + "name": "[10]", + "type": "unsigned char", + "value": 114, + "children": [] + }, + { + "name": "[11]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[12]", + "type": "unsigned char", + "value": 110, + "children": [] + }, + { + "name": "[13]", + "type": "unsigned char", + "value": 103, + "children": [] + }, + { + "name": "[14]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[15]", + "type": "unsigned char", + "value": -16, + "children": [] + }, + { + "name": "[16]", + "type": "unsigned char", + "value": -97, + "children": [] + }, + { + "name": "[17]", + "type": "unsigned char", + "value": -104, + "children": [] + }, + { + "name": "[18]", + "type": "unsigned char", + "value": -125, + "children": [] + } + ] + }, + { + "name": "is_known_utf8", + "type": "bool", + "value": false, + "children": [] + } + ] + } + ] + } + ] + } + } + ] +} diff --git a/tests/debuginfo/pretty-std/lldb_input/windows_msvc.json b/tests/debuginfo/pretty-std/lldb_input/windows_msvc.json new file mode 100644 index 0000000000000..4787f88d337ed --- /dev/null +++ b/tests/debuginfo/pretty-std/lldb_input/windows_msvc.json @@ -0,0 +1,911 @@ +{ + "bless_metadata": { + "python_version": "3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]", + "debugger_version": "lldb version 22.1.2 (https://github.com/llvm/llvm-project revision 1ab49a973e210e97d61e5db6557180dcb92c3e98)\n clang revision 1ab49a973e210e97d61e5db6557180dcb92c3e98\n llvm revision 1ab49a973e210e97d61e5db6557180dcb92c3e98", + "feature_flags": "LLDBFeature.StaticFields|TypeRecognizers|Float128" + }, + "types": { + "ref$ >": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "data_ptr", + "type": "int *", + "offset": 0 + }, + { + "name": "length", + "type": "unsigned long long", + "offset": 8 + } + ], + "generic_params": [ + "long" + ] + }, + "int *": { + "size": 8, + "basic_type": 0, + "type_class": 4096, + "fields": [], + "generic_params": [] + }, + "unsigned long long": { + "size": 8, + "basic_type": 18, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "long": { + "size": 4, + "basic_type": 15, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "int": { + "size": 4, + "basic_type": 13, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "alloc::vec::Vec": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "unsigned long long", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + } + ], + "generic_params": [ + "unsigned long long", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVecInner": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "cap", + "type": "core::num::niche_types::UsizeNoHighBit", + "offset": 0 + }, + { + "name": "ptr", + "type": "core::ptr::unique::Unique", + "offset": 8 + } + ], + "generic_params": [ + "alloc::alloc::Global" + ] + }, + "core::num::niche_types::UsizeNoHighBit": { + "size": 8, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "unsigned long long", + "offset": 0 + } + ], + "generic_params": [] + }, + "core::ptr::unique::Unique": { + "size": 8, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "pointer", + "type": "core::ptr::non_null::NonNull", + "offset": 0 + } + ], + "generic_params": [ + "unsigned char" + ] + }, + "core::ptr::non_null::NonNull": { + "size": 8, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "pointer", + "type": "unsigned char *", + "offset": 0 + } + ], + "generic_params": [ + "unsigned char" + ] + }, + "unsigned char *": { + "size": 8, + "basic_type": 0, + "type_class": 4096, + "fields": [], + "generic_params": [] + }, + "unsigned char": { + "size": 1, + "basic_type": 4, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "alloc::alloc::Global": { + "size": 0, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [] + }, + "ref$": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "data_ptr", + "type": "unsigned char *", + "offset": 0 + }, + { + "name": "length", + "type": "unsigned long long", + "offset": 8 + } + ], + "generic_params": [] + }, + "alloc::string::String": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "vec", + "type": "alloc::vec::Vec", + "offset": 0 + } + ], + "generic_params": [] + }, + "alloc::vec::Vec": { + "size": 24, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "unsigned char", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + } + ], + "generic_params": [ + "unsigned char", + "alloc::alloc::Global" + ] + }, + "enum2$ >": { + "size": 4, + "basic_type": 0, + "type_class": 65536, + "fields": [ + { + "name": "variant0", + "type": "enum2$ >::Variant0", + "offset": 0 + }, + { + "name": "variant1", + "type": "enum2$ >::Variant1", + "offset": 0 + }, + { + "name": "tag", + "type": "unsigned short", + "offset": 0 + } + ], + "generic_params": [] + }, + "enum2$ >::Variant0": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "value", + "type": "enum2$ >::None", + "offset": 0 + } + ], + "generic_params": [] + }, + "enum2$ >::None": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [] + }, + "enum2$ >::Variant1": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "value", + "type": "enum2$ >::Some", + "offset": 0 + } + ], + "generic_params": [] + }, + "enum2$ >::Some": { + "size": 4, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "short", + "offset": 2 + } + ], + "generic_params": [] + }, + "short": { + "size": 2, + "basic_type": 11, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "unsigned short": { + "size": 2, + "basic_type": 12, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "enum2$ >": { + "size": 16, + "basic_type": 0, + "type_class": 65536, + "fields": [ + { + "name": "variant0", + "type": "enum2$ >::Variant0", + "offset": 0 + }, + { + "name": "variant1", + "type": "enum2$ >::Variant1", + "offset": 0 + }, + { + "name": "tag", + "type": "unsigned long long", + "offset": 0 + } + ], + "generic_params": [] + }, + "enum2$ >::Variant0": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "value", + "type": "enum2$ >::None", + "offset": 0 + } + ], + "generic_params": [] + }, + "enum2$ >::None": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [], + "generic_params": [] + }, + "enum2$ >::Variant1": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "value", + "type": "enum2$ >::Some", + "offset": 0 + } + ], + "generic_params": [] + }, + "enum2$ >::Some": { + "size": 16, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "long long", + "offset": 8 + } + ], + "generic_params": [] + }, + "long long": { + "size": 8, + "basic_type": 17, + "type_class": 4, + "fields": [], + "generic_params": [] + }, + "std::ffi::os_str::OsString": { + "size": 32, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "std::sys::os_str::wtf8::Buf", + "offset": 0 + } + ], + "generic_params": [] + }, + "std::sys::os_str::wtf8::Buf": { + "size": 32, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::wtf8::Wtf8Buf", + "offset": 0 + } + ], + "generic_params": [] + }, + "alloc::wtf8::Wtf8Buf": { + "size": 32, + "basic_type": 0, + "type_class": 16384, + "fields": [ + { + "name": "bytes", + "type": "alloc::vec::Vec", + "offset": 0 + }, + { + "name": "is_known_utf8", + "type": "bool", + "offset": 24 + } + ], + "generic_params": [] + }, + "bool": { + "size": 1, + "basic_type": 21, + "type_class": 4, + "fields": [], + "generic_params": [] + } + }, + "breakpoints": [ + { + "slice": { + "type": "ref$ >", + "pretty_type_name": "&[i32]", + "pretty_print": "[0, 1, 2, 3]", + "value": null, + "synthetic": "lldb_lookup.MSVCStdSliceSyntheticProvider", + "summary": "lldb_lookup.StdSliceSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "int", + "value": 0, + "children": [] + }, + { + "name": "[1]", + "type": "int", + "value": 1, + "children": [] + }, + { + "name": "[2]", + "type": "int", + "value": 2, + "children": [] + }, + { + "name": "[3]", + "type": "int", + "value": 3, + "children": [] + } + ] + }, + "vec": { + "type": "alloc::vec::Vec", + "pretty_type_name": null, + "pretty_print": "size=4", + "value": null, + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "unsigned long long", + "value": 4, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned long long", + "value": 5, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned long long", + "value": 6, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned long long", + "value": 7, + "children": [] + } + ] + }, + "str_slice": { + "type": "ref$", + "pretty_type_name": "&str", + "pretty_print": "\"IAMA string slice!\"", + "value": null, + "synthetic": "lldb_lookup.MSVCStrSyntheticProvider", + "summary": "lldb_lookup.StdStrSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "unsigned char", + "value": 73, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned char", + "value": 77, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[4]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[5]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[6]", + "type": "unsigned char", + "value": 116, + "children": [] + }, + { + "name": "[7]", + "type": "unsigned char", + "value": 114, + "children": [] + }, + { + "name": "[8]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[9]", + "type": "unsigned char", + "value": 110, + "children": [] + }, + { + "name": "[10]", + "type": "unsigned char", + "value": 103, + "children": [] + }, + { + "name": "[11]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[12]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[13]", + "type": "unsigned char", + "value": 108, + "children": [] + }, + { + "name": "[14]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[15]", + "type": "unsigned char", + "value": 99, + "children": [] + }, + { + "name": "[16]", + "type": "unsigned char", + "value": 101, + "children": [] + }, + { + "name": "[17]", + "type": "unsigned char", + "value": 33, + "children": [] + } + ] + }, + "string": { + "type": "alloc::string::String", + "pretty_type_name": null, + "pretty_print": "\"IAMA string!\"", + "value": null, + "synthetic": "lldb_lookup.StdStringSyntheticProvider", + "summary": "lldb_lookup.StdStringSummaryProvider", + "format": null, + "children": [ + { + "name": "[0]", + "type": "unsigned char", + "value": 73, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned char", + "value": 77, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[4]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[5]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[6]", + "type": "unsigned char", + "value": 116, + "children": [] + }, + { + "name": "[7]", + "type": "unsigned char", + "value": 114, + "children": [] + }, + { + "name": "[8]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[9]", + "type": "unsigned char", + "value": 110, + "children": [] + }, + { + "name": "[10]", + "type": "unsigned char", + "value": 103, + "children": [] + }, + { + "name": "[11]", + "type": "unsigned char", + "value": 33, + "children": [] + } + ] + }, + "some": { + "type": "enum2$ >", + "pretty_type_name": "core::option::Option", + "pretty_print": "Some(8)", + "value": null, + "synthetic": "lldb_lookup.MSVCEnumSyntheticProvider", + "summary": "lldb_lookup.MSVCEnumSummaryProvider", + "format": null, + "children": [ + { + "name": "0", + "type": "short", + "value": 8, + "children": [] + } + ] + }, + "none": { + "type": "enum2$ >", + "pretty_type_name": "core::option::Option", + "pretty_print": "None", + "value": null, + "synthetic": "lldb_lookup.MSVCEnumSyntheticProvider", + "summary": "lldb_lookup.MSVCEnumSummaryProvider", + "format": null, + "children": [] + }, + "os_string": { + "type": "std::ffi::os_str::OsString", + "pretty_type_name": null, + "pretty_print": "\"IAMA OS string \ud83d\ude03\"", + "value": null, + "synthetic": "lldb_lookup.synthetic_lookup", + "summary": "lldb_lookup.StdOsStringSummaryProvider", + "format": null, + "children": [ + { + "name": "inner", + "type": "std::sys::os_str::wtf8::Buf", + "value": null, + "children": [ + { + "name": "inner", + "type": "alloc::wtf8::Wtf8Buf", + "value": null, + "children": [ + { + "name": "bytes", + "type": "alloc::vec::Vec", + "value": null, + "children": [ + { + "name": "[0]", + "type": "unsigned char", + "value": 73, + "children": [] + }, + { + "name": "[1]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[2]", + "type": "unsigned char", + "value": 77, + "children": [] + }, + { + "name": "[3]", + "type": "unsigned char", + "value": 65, + "children": [] + }, + { + "name": "[4]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[5]", + "type": "unsigned char", + "value": 79, + "children": [] + }, + { + "name": "[6]", + "type": "unsigned char", + "value": 83, + "children": [] + }, + { + "name": "[7]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[8]", + "type": "unsigned char", + "value": 115, + "children": [] + }, + { + "name": "[9]", + "type": "unsigned char", + "value": 116, + "children": [] + }, + { + "name": "[10]", + "type": "unsigned char", + "value": 114, + "children": [] + }, + { + "name": "[11]", + "type": "unsigned char", + "value": 105, + "children": [] + }, + { + "name": "[12]", + "type": "unsigned char", + "value": 110, + "children": [] + }, + { + "name": "[13]", + "type": "unsigned char", + "value": 103, + "children": [] + }, + { + "name": "[14]", + "type": "unsigned char", + "value": 32, + "children": [] + }, + { + "name": "[15]", + "type": "unsigned char", + "value": -16, + "children": [] + }, + { + "name": "[16]", + "type": "unsigned char", + "value": -97, + "children": [] + }, + { + "name": "[17]", + "type": "unsigned char", + "value": -104, + "children": [] + }, + { + "name": "[18]", + "type": "unsigned char", + "value": -125, + "children": [] + } + ] + }, + { + "name": "is_known_utf8", + "type": "bool", + "value": false, + "children": [] + } + ] + } + ] + } + ] + } + } + ] +} diff --git a/tests/debuginfo/pretty-std.rs b/tests/debuginfo/pretty-std/main.rs similarity index 83% rename from tests/debuginfo/pretty-std.rs rename to tests/debuginfo/pretty-std/main.rs index 3ecaf02ab7d26..c3ed79045aa58 100644 --- a/tests/debuginfo/pretty-std.rs +++ b/tests/debuginfo/pretty-std/main.rs @@ -1,9 +1,20 @@ +// Tests the visualizers for the following types: +// * &[i32] +// * Vec +// * &str +// * String +// * OsString +// * Option (Some and None) +// * Option (Some, non-empty) +// CDB only: +// * LinkedList +// * VecDeque + // ignore-tidy-linelength -//@ ignore-windows-gnu: #128981 //@ ignore-android: FIXME(#10381) //@ compile-flags:-g -// LLDB 1800+ tests were not tested in CI, broke, and now are disabled -//@ ignore-lldb +//@ min-llvm-lldb-version: 22.1.0 +//@ min-apple-lldb-version: 1703.0.236.21 //@ min-cdb-version: 10.0.18317.1001 //@ ignore-backends: gcc @@ -30,7 +41,7 @@ //@ gdb-check:$6 = core::option::Option::None //@ gdb-command: print os_string -//@ gdb-check:$7 = "IAMA OS string 😃" +//@ gdb-check:$7 = "IAMA OS string [...]" //@ gdb-command: print some_string //@ gdb-check:$8 = core::option::Option::Some("IAMA optional string!") @@ -43,27 +54,13 @@ //@ lldb-command:run -//@ lldb-command:v slice -//@ lldb-check:[...] slice = size=4 { [0] = 0 [1] = 1 [2] = 2 [3] = 3 } - -//@ lldb-command:v vec -//@ lldb-check:[...] vec = size=4 { [0] = 4 [1] = 5 [2] = 6 [3] = 7 } - -//@ lldb-command:v str_slice -//@ lldb-check:[...] str_slice = "IAMA string slice!" { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 's' [6] = 't' [7] = 'r' [8] = 'i' [9] = 'n' [10] = 'g' [11] = ' ' [12] = 's' [13] = 'l' [14] = 'i' [15] = 'c' [16] = 'e' [17] = '!' } - -//@ lldb-command:v string -//@ lldb-check:[...] string = "IAMA string!" { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 's' [6] = 't' [7] = 'r' [8] = 'i' [9] = 'n' [10] = 'g' [11] = '!' } - - -//@ lldb-command:v some -//@ lldb-check:[...] some = Some(8) - -//@ lldb-command:v none -//@ lldb-check:[...] none = None - -//@ lldb-command:v os_string -//@ lldb-check:[...] os_string = "IAMA OS string 😃" { inner = { inner = size=19 { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 'O' [6] = 'S' [7] = ' ' [8] = 's' [9] = 't' [10] = 'r' [11] = 'i' [12] = 'n' [13] = 'g' [14] = ' ' [15] = '\xf0' [16] = '\x9f' [17] = '\x98' [18] = '\x83' } } } +//@ lldb-repr:slice +//@ lldb-repr:vec +//@ lldb-repr:str_slice +//@ lldb-repr:string +//@ lldb-repr:some +//@ lldb-repr:none +//@ lldb-repr:os_string // === CDB TESTS ==================================================================================