From bd31a67b02c6bd957c93a6eb4617af098dc2b698 Mon Sep 17 00:00:00 2001 From: Walnut <39544927+Walnut356@users.noreply.github.com> Date: Tue, 20 Oct 2026 03:34:36 -0500 Subject: [PATCH] add `vec_visualizer` lldb test --- .../lldb_input/non_windows.json | 895 ++++++++++++++++++ .../lldb_input/windows_gnu.json | 895 ++++++++++++++++++ .../lldb_input/windows_msvc.json | 812 ++++++++++++++++ tests/debuginfo/vec_visualizer/main.rs | 91 ++ 4 files changed, 2693 insertions(+) create mode 100644 tests/debuginfo/vec_visualizer/lldb_input/non_windows.json create mode 100644 tests/debuginfo/vec_visualizer/lldb_input/windows_gnu.json create mode 100644 tests/debuginfo/vec_visualizer/lldb_input/windows_msvc.json create mode 100644 tests/debuginfo/vec_visualizer/main.rs diff --git a/tests/debuginfo/vec_visualizer/lldb_input/non_windows.json b/tests/debuginfo/vec_visualizer/lldb_input/non_windows.json new file mode 100644 index 0000000000000..4131153e56a2c --- /dev/null +++ b/tests/debuginfo/vec_visualizer/lldb_input/non_windows.json @@ -0,0 +1,895 @@ +{ + "bless_metadata": { + "python_version": "3.14.8 (main, Oct 1 2026, 00:00:00) [GCC 16.2.1 20260819 (Red Hat 16.2.1-2)]", + "debugger_version": "lldb version 22.1.8", + "feature_flags": "LLDBFeature.StaticFields|TypeRecognizers|Float128" + }, + "breakpoints": [ + { + "vec_primitive": { + "type": "alloc::vec::Vec", + "pretty_print": "size=5", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "vec_ref": { + "type": "alloc::vec::Vec", + "pretty_print": "size=4", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "unsigned int *", + "vals": [ + { + "children": [ + { + "name": "*[0]", + "type": "unsigned int", + "value": 0 + } + ] + }, + { + "children": [ + { + "name": "*[1]", + "type": "unsigned int", + "value": 1 + } + ] + }, + { + "children": [ + { + "name": "*[2]", + "type": "unsigned int", + "value": 2 + } + ] + }, + { + "children": [ + { + "name": "*[3]", + "type": "unsigned int", + "value": 4294967295 + } + ] + } + ] + } + }, + "vec_endpad": { + "type": "alloc::vec::Vec", + "pretty_print": "size=3", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::EndPad", + "vals": [ + { + "children": [ + { + "name": "a", + "type": "unsigned int", + "value": 10 + }, + { + "name": "b", + "type": "unsigned char", + "value": 20 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned int", + "value": 30 + }, + { + "name": "b", + "type": "unsigned char", + "value": 40 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned int", + "value": 50 + }, + { + "name": "b", + "type": "unsigned char", + "value": 60 + } + ] + } + ] + } + }, + "vec_midpad": { + "type": "alloc::vec::Vec", + "pretty_print": "size=3", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::MidPad", + "vals": [ + { + "children": [ + { + "name": "a", + "type": "unsigned char", + "value": 10 + }, + { + "name": "b", + "type": "unsigned int", + "value": 20 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned char", + "value": 30 + }, + { + "name": "b", + "type": "unsigned int", + "value": 40 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned char", + "value": 50 + }, + { + "name": "b", + "type": "unsigned int", + "value": 60 + } + ] + } + ] + } + }, + "vec_generic_i32": { + "type": "alloc::vec::Vec, alloc::alloc::Global>", + "pretty_print": "size=2", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::Point", + "vals": [ + { + "children": [ + { + "name": "x", + "type": "double", + "value": 0.0 + }, + { + "name": "y", + "type": "double", + "value": 1.1 + } + ] + }, + { + "children": [ + { + "name": "x", + "type": "double", + "value": 2.2 + }, + { + "name": "y", + "type": "double", + "value": 3.3 + } + ] + } + ] + } + }, + "vec_generic_udt": { + "type": "alloc::vec::Vec >, alloc::alloc::Global>", + "pretty_print": "size=2", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::Point >", + "vals": [ + { + "children": [ + { + "name": "x", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + 0, + 0 + ] + } + }, + { + "name": "y", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + 1, + 1 + ] + } + } + ] + }, + { + "children": [ + { + "name": "x", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + 2, + 2 + ] + } + }, + { + "name": "y", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + 3, + 3 + ] + } + } + ] + } + ] + } + }, + "ref_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "ref_mut_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "ptr_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "ptr_mut_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "some_vec": { + "type": "core::option::Option>", + "pretty_print": "Some(size=5)", + "synthetic": "lldb_lookup.ClangEncodedEnumProvider", + "summary": "lldb_lookup.ClangEncodedEnumSummaryProvider", + "children": [ + { + "name": "0", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + } + ] + }, + "some_empty_vec": { + "type": "core::option::Option>", + "pretty_print": "Some(size=0)", + "synthetic": "lldb_lookup.ClangEncodedEnumProvider", + "summary": "lldb_lookup.ClangEncodedEnumSummaryProvider", + "children": [ + { + "name": "0", + "type": "alloc::vec::Vec" + } + ] + } + } + ], + "types": { + "alloc::alloc::Global": { + "size": 0, + "type_class": 16384 + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "int", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "main::EndPad", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "main::MidPad", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec >, alloc::alloc::Global>": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData > >", + "offset": 16 + } + ], + "generic_params": [ + "main::Point >", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec, alloc::alloc::Global>": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData >", + "offset": 16 + } + ], + "generic_params": [ + "main::Point", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "unsigned int *", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVecInner": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "ptr", + "type": "core::ptr::non_null::NonNull", + "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" + ] + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long", + "offset": 16 + } + ], + "generic_params": [ + "int", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec *": { + "size": 8, + "type_class": 4096 + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long", + "offset": 16 + } + ], + "generic_params": [ + "main::EndPad", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long", + "offset": 16 + } + ], + "generic_params": [ + "main::MidPad", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec >, alloc::alloc::Global>": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec >, alloc::alloc::Global>", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long", + "offset": 16 + } + ], + "generic_params": [ + "main::Point >", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec, alloc::alloc::Global>": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec, alloc::alloc::Global>", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long", + "offset": 16 + } + ], + "generic_params": [ + "main::Point", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long", + "offset": 16 + } + ], + "generic_params": [ + "unsigned int *", + "alloc::alloc::Global" + ] + }, + "core::marker::PhantomData": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "int" + ] + }, + "core::marker::PhantomData": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "main::EndPad" + ] + }, + "core::marker::PhantomData": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "main::MidPad" + ] + }, + "core::marker::PhantomData > >": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "main::Point >" + ] + }, + "core::marker::PhantomData >": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "main::Point" + ] + }, + "core::marker::PhantomData": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "unsigned int *" + ] + }, + "core::num::niche_types::UsizeNoHighBit": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "unsigned long", + "offset": 0 + } + ] + }, + "core::option::Option>": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "$variants$", + "type": "core::option::Option>::core::option::Option>$Inner", + "offset": 0 + } + ] + }, + "core::option::Option>::None >": { + "size": 24, + "type_class": 16384, + "generic_params": [ + "alloc::vec::Vec" + ] + }, + "core::option::Option>::Some >": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "alloc::vec::Vec", + "offset": 0 + } + ], + "generic_params": [ + "alloc::vec::Vec" + ] + }, + "core::option::Option>::core::option::Option>$Inner": { + "size": 24, + "type_class": 65536, + "fields": [ + { + "name": "$variant$4294967295", + "type": "core::option::Option>::core::option::Option>$Inner::None$Variant", + "offset": 0 + }, + { + "name": "$variant$", + "type": "core::option::Option>::core::option::Option>$Inner::Some$Variant", + "offset": 0 + } + ] + }, + "core::option::Option>::core::option::Option>$Inner::None$Variant": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned long", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option>::None >", + "offset": 8 + } + ] + }, + "core::option::Option>::core::option::Option>$Inner::Some$Variant": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "value", + "type": "core::option::Option>::Some >", + "offset": 0 + } + ] + }, + "core::ptr::non_null::NonNull": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "pointer", + "type": "unsigned char *", + "offset": 0 + } + ], + "generic_params": [ + "unsigned char" + ] + }, + "double": { + "size": 8, + "type_class": 4, + "basic_type": 24 + }, + "int": { + "size": 4, + "type_class": 4, + "basic_type": 13 + }, + "main::EndPad": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "a", + "type": "unsigned int", + "offset": 0 + }, + { + "name": "b", + "type": "unsigned char", + "offset": 4 + } + ] + }, + "main::MidPad": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "a", + "type": "unsigned char", + "offset": 0 + }, + { + "name": "b", + "type": "unsigned int", + "offset": 4 + } + ] + }, + "main::Point >": { + "size": 48, + "type_class": 16384, + "fields": [ + { + "name": "x", + "type": "alloc::vec::Vec", + "offset": 0 + }, + { + "name": "y", + "type": "alloc::vec::Vec", + "offset": 24 + } + ], + "generic_params": [ + "alloc::vec::Vec" + ] + }, + "main::Point": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "x", + "type": "double", + "offset": 0 + }, + { + "name": "y", + "type": "double", + "offset": 8 + } + ], + "generic_params": [ + "double" + ] + }, + "unsigned char": { + "size": 1, + "type_class": 4, + "basic_type": 4 + }, + "unsigned char *": { + "size": 8, + "type_class": 4096 + }, + "unsigned int": { + "size": 4, + "type_class": 4, + "basic_type": 14 + }, + "unsigned int *": { + "size": 8, + "type_class": 4096 + }, + "unsigned long": { + "size": 8, + "type_class": 4, + "basic_type": 16 + } + } +} diff --git a/tests/debuginfo/vec_visualizer/lldb_input/windows_gnu.json b/tests/debuginfo/vec_visualizer/lldb_input/windows_gnu.json new file mode 100644 index 0000000000000..2ed06a75e1574 --- /dev/null +++ b/tests/debuginfo/vec_visualizer/lldb_input/windows_gnu.json @@ -0,0 +1,895 @@ +{ + "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.8 (https://github.com/llvm/llvm-project revision ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)\n clang revision ca7933e47d3a3451d81e72ac174dcb5aa28b59d1\n llvm revision ca7933e47d3a3451d81e72ac174dcb5aa28b59d1", + "feature_flags": "LLDBFeature.StaticFields|TypeRecognizers|Float128" + }, + "breakpoints": [ + { + "vec_primitive": { + "type": "alloc::vec::Vec", + "pretty_print": "size=5", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "vec_ref": { + "type": "alloc::vec::Vec", + "pretty_print": "size=4", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "unsigned int *", + "vals": [ + { + "children": [ + { + "name": "*[0]", + "type": "unsigned int", + "value": 0 + } + ] + }, + { + "children": [ + { + "name": "*[1]", + "type": "unsigned int", + "value": 1 + } + ] + }, + { + "children": [ + { + "name": "*[2]", + "type": "unsigned int", + "value": 2 + } + ] + }, + { + "children": [ + { + "name": "*[3]", + "type": "unsigned int", + "value": 4294967295 + } + ] + } + ] + } + }, + "vec_endpad": { + "type": "alloc::vec::Vec", + "pretty_print": "size=3", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::EndPad", + "vals": [ + { + "children": [ + { + "name": "a", + "type": "unsigned int", + "value": 10 + }, + { + "name": "b", + "type": "unsigned char", + "value": 20 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned int", + "value": 30 + }, + { + "name": "b", + "type": "unsigned char", + "value": 40 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned int", + "value": 50 + }, + { + "name": "b", + "type": "unsigned char", + "value": 60 + } + ] + } + ] + } + }, + "vec_midpad": { + "type": "alloc::vec::Vec", + "pretty_print": "size=3", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::MidPad", + "vals": [ + { + "children": [ + { + "name": "a", + "type": "unsigned char", + "value": 10 + }, + { + "name": "b", + "type": "unsigned int", + "value": 20 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned char", + "value": 30 + }, + { + "name": "b", + "type": "unsigned int", + "value": 40 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned char", + "value": 50 + }, + { + "name": "b", + "type": "unsigned int", + "value": 60 + } + ] + } + ] + } + }, + "vec_generic_i32": { + "type": "alloc::vec::Vec, alloc::alloc::Global>", + "pretty_print": "size=2", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::Point", + "vals": [ + { + "children": [ + { + "name": "x", + "type": "double", + "value": 0.0 + }, + { + "name": "y", + "type": "double", + "value": 1.1 + } + ] + }, + { + "children": [ + { + "name": "x", + "type": "double", + "value": 2.2 + }, + { + "name": "y", + "type": "double", + "value": 3.3 + } + ] + } + ] + } + }, + "vec_generic_udt": { + "type": "alloc::vec::Vec >, alloc::alloc::Global>", + "pretty_print": "size=2", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::Point >", + "vals": [ + { + "children": [ + { + "name": "x", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + 0, + 0 + ] + } + }, + { + "name": "y", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + 1, + 1 + ] + } + } + ] + }, + { + "children": [ + { + "name": "x", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + 2, + 2 + ] + } + }, + { + "name": "y", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + 3, + 3 + ] + } + } + ] + } + ] + } + }, + "ref_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "ptr_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "ref_mut_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "ptr_mut_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "some_vec": { + "type": "core::option::Option>", + "pretty_print": "Some(size=5)", + "synthetic": "lldb_lookup.ClangEncodedEnumProvider", + "summary": "lldb_lookup.ClangEncodedEnumSummaryProvider", + "children": [ + { + "name": "0", + "type": "alloc::vec::Vec", + "children": { + "type": "int", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + } + ] + }, + "some_empty_vec": { + "type": "core::option::Option>", + "pretty_print": "Some(size=0)", + "synthetic": "lldb_lookup.ClangEncodedEnumProvider", + "summary": "lldb_lookup.ClangEncodedEnumSummaryProvider", + "children": [ + { + "name": "0", + "type": "alloc::vec::Vec" + } + ] + } + } + ], + "types": { + "alloc::alloc::Global": { + "size": 0, + "type_class": 16384 + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "int", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "main::EndPad", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "main::MidPad", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec >, alloc::alloc::Global>": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData > >", + "offset": 16 + } + ], + "generic_params": [ + "main::Point >", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec, alloc::alloc::Global>": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData >", + "offset": 16 + } + ], + "generic_params": [ + "main::Point", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + }, + { + "name": "_marker", + "type": "core::marker::PhantomData", + "offset": 16 + } + ], + "generic_params": [ + "unsigned int *", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVecInner": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "ptr", + "type": "core::ptr::non_null::NonNull", + "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" + ] + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "int", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec *": { + "size": 8, + "type_class": 4096 + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "main::EndPad", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "main::MidPad", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec >, alloc::alloc::Global>": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec >, alloc::alloc::Global>", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "main::Point >", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec, alloc::alloc::Global>": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec, alloc::alloc::Global>", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "main::Point", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "unsigned int *", + "alloc::alloc::Global" + ] + }, + "core::marker::PhantomData": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "int" + ] + }, + "core::marker::PhantomData": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "main::EndPad" + ] + }, + "core::marker::PhantomData": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "main::MidPad" + ] + }, + "core::marker::PhantomData > >": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "main::Point >" + ] + }, + "core::marker::PhantomData >": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "main::Point" + ] + }, + "core::marker::PhantomData": { + "size": 0, + "type_class": 16384, + "generic_params": [ + "unsigned int *" + ] + }, + "core::num::niche_types::UsizeNoHighBit": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "unsigned long long", + "offset": 0 + } + ] + }, + "core::option::Option>": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "$variants$", + "type": "core::option::Option>::core::option::Option>$Inner", + "offset": 0 + } + ] + }, + "core::option::Option>::None >": { + "size": 24, + "type_class": 16384, + "generic_params": [ + "alloc::vec::Vec" + ] + }, + "core::option::Option>::Some >": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "alloc::vec::Vec", + "offset": 0 + } + ], + "generic_params": [ + "alloc::vec::Vec" + ] + }, + "core::option::Option>::core::option::Option>$Inner": { + "size": 32, + "type_class": 65536, + "fields": [ + { + "name": "$variant$4294967295", + "type": "core::option::Option>::core::option::Option>$Inner::None$Variant", + "offset": 0 + }, + { + "name": "$variant$", + "type": "core::option::Option>::core::option::Option>$Inner::Some$Variant", + "offset": 0 + } + ] + }, + "core::option::Option>::core::option::Option>$Inner::None$Variant": { + "size": 32, + "type_class": 16384, + "fields": [ + { + "name": "$discr$", + "type": "unsigned long long", + "offset": 0 + }, + { + "name": "value", + "type": "core::option::Option>::None >", + "offset": 8 + } + ] + }, + "core::option::Option>::core::option::Option>$Inner::Some$Variant": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "value", + "type": "core::option::Option>::Some >", + "offset": 0 + } + ] + }, + "core::ptr::non_null::NonNull": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "pointer", + "type": "unsigned char *", + "offset": 0 + } + ], + "generic_params": [ + "unsigned char" + ] + }, + "double": { + "size": 8, + "type_class": 4, + "basic_type": 24 + }, + "int": { + "size": 4, + "type_class": 4, + "basic_type": 13 + }, + "main::EndPad": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "a", + "type": "unsigned int", + "offset": 0 + }, + { + "name": "b", + "type": "unsigned char", + "offset": 4 + } + ] + }, + "main::MidPad": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "a", + "type": "unsigned char", + "offset": 0 + }, + { + "name": "b", + "type": "unsigned int", + "offset": 4 + } + ] + }, + "main::Point >": { + "size": 48, + "type_class": 16384, + "fields": [ + { + "name": "x", + "type": "alloc::vec::Vec", + "offset": 0 + }, + { + "name": "y", + "type": "alloc::vec::Vec", + "offset": 24 + } + ], + "generic_params": [ + "alloc::vec::Vec" + ] + }, + "main::Point": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "x", + "type": "double", + "offset": 0 + }, + { + "name": "y", + "type": "double", + "offset": 8 + } + ], + "generic_params": [ + "double" + ] + }, + "unsigned char": { + "size": 1, + "type_class": 4, + "basic_type": 4 + }, + "unsigned char *": { + "size": 8, + "type_class": 4096 + }, + "unsigned int": { + "size": 4, + "type_class": 4, + "basic_type": 14 + }, + "unsigned int *": { + "size": 8, + "type_class": 4096 + }, + "unsigned long long": { + "size": 8, + "type_class": 4, + "basic_type": 18 + } + } +} diff --git a/tests/debuginfo/vec_visualizer/lldb_input/windows_msvc.json b/tests/debuginfo/vec_visualizer/lldb_input/windows_msvc.json new file mode 100644 index 0000000000000..ab32e95eff8e7 --- /dev/null +++ b/tests/debuginfo/vec_visualizer/lldb_input/windows_msvc.json @@ -0,0 +1,812 @@ +{ + "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.8 (https://github.com/llvm/llvm-project revision ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)\n clang revision ca7933e47d3a3451d81e72ac174dcb5aa28b59d1\n llvm revision ca7933e47d3a3451d81e72ac174dcb5aa28b59d1", + "feature_flags": "LLDBFeature.StaticFields|TypeRecognizers|Float128" + }, + "breakpoints": [ + { + "vec_primitive": { + "type": "alloc::vec::Vec", + "pretty_print": "size=5", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "long", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "vec_ref": { + "type": "alloc::vec::Vec,alloc::alloc::Global>", + "pretty_print": "size=4", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "unsigned long *", + "vals": [ + { + "children": [ + { + "name": "*[0]", + "type": "unsigned long", + "value": 0 + } + ] + }, + { + "children": [ + { + "name": "*[1]", + "type": "unsigned long", + "value": 1 + } + ] + }, + { + "children": [ + { + "name": "*[2]", + "type": "unsigned long", + "value": 2 + } + ] + }, + { + "children": [ + { + "name": "*[3]", + "type": "unsigned long", + "value": 4294967295 + } + ] + } + ] + } + }, + "vec_endpad": { + "type": "alloc::vec::Vec", + "pretty_print": "size=3", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::EndPad", + "vals": [ + { + "children": [ + { + "name": "a", + "type": "unsigned int", + "value": 10 + }, + { + "name": "b", + "type": "unsigned char", + "value": 20 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned int", + "value": 30 + }, + { + "name": "b", + "type": "unsigned char", + "value": 40 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned int", + "value": 50 + }, + { + "name": "b", + "type": "unsigned char", + "value": 60 + } + ] + } + ] + } + }, + "vec_midpad": { + "type": "alloc::vec::Vec", + "pretty_print": "size=3", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::MidPad", + "vals": [ + { + "children": [ + { + "name": "a", + "type": "unsigned char", + "value": 10 + }, + { + "name": "b", + "type": "unsigned int", + "value": 20 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned char", + "value": 30 + }, + { + "name": "b", + "type": "unsigned int", + "value": 40 + } + ] + }, + { + "children": [ + { + "name": "a", + "type": "unsigned char", + "value": 50 + }, + { + "name": "b", + "type": "unsigned int", + "value": 60 + } + ] + } + ] + } + }, + "vec_generic_i32": { + "type": "alloc::vec::Vec,alloc::alloc::Global>", + "pretty_print": "size=2", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::Point", + "vals": [ + { + "children": [ + { + "name": "x", + "type": "double", + "value": 0.0 + }, + { + "name": "y", + "type": "double", + "value": 1.1 + } + ] + }, + { + "children": [ + { + "name": "x", + "type": "double", + "value": 2.2 + }, + { + "name": "y", + "type": "double", + "value": 3.3 + } + ] + } + ] + } + }, + "vec_generic_udt": { + "type": "alloc::vec::Vec >,alloc::alloc::Global>", + "pretty_print": "size=2", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "main::Point >", + "vals": [ + { + "children": [ + { + "name": "x", + "type": "alloc::vec::Vec", + "children": { + "type": "long", + "vals": [ + 0, + 0 + ] + } + }, + { + "name": "y", + "type": "alloc::vec::Vec", + "children": { + "type": "long", + "vals": [ + 1, + 1 + ] + } + } + ] + }, + { + "children": [ + { + "name": "x", + "type": "alloc::vec::Vec", + "children": { + "type": "long", + "vals": [ + 2, + 2 + ] + } + }, + { + "name": "y", + "type": "alloc::vec::Vec", + "children": { + "type": "long", + "vals": [ + 3, + 3 + ] + } + } + ] + } + ] + } + }, + "ref_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "long", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "ptr_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "long", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "ref_mut_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "long", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "ptr_mut_vec": { + "type": "alloc::vec::Vec *", + "synthetic": "lldb_lookup.StdVecSyntheticProvider", + "summary": "lldb_lookup.SizeSummaryProvider", + "children": { + "type": "long", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + }, + "some_vec": { + "type": "enum2$ > >", + "pretty_type_name": "core::option::Option >", + "pretty_print": "Some(size=5)", + "synthetic": "lldb_lookup.MSVCEnumSyntheticProvider", + "summary": "lldb_lookup.MSVCEnumSummaryProvider", + "children": [ + { + "name": "0", + "type": "alloc::vec::Vec", + "children": { + "type": "long", + "vals": [ + -2147483648, + -1, + 0, + 1, + 2147483647 + ] + } + } + ] + }, + "some_empty_vec": { + "type": "enum2$ > >", + "pretty_type_name": "core::option::Option >", + "pretty_print": "Some(size=0)", + "synthetic": "lldb_lookup.MSVCEnumSyntheticProvider", + "summary": "lldb_lookup.MSVCEnumSummaryProvider", + "children": [ + { + "name": "0", + "type": "alloc::vec::Vec" + } + ] + } + } + ], + "types": { + "alloc::alloc::Global": { + "size": 0, + "type_class": 16384 + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + } + ], + "generic_params": [ + "long", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + } + ], + "generic_params": [ + "main::EndPad", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + } + ], + "generic_params": [ + "main::MidPad", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec >,alloc::alloc::Global>": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + } + ], + "generic_params": [ + "main::Point >", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec,alloc::alloc::Global>": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + } + ], + "generic_params": [ + "main::Point", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVec,alloc::alloc::Global>": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "inner", + "type": "alloc::raw_vec::RawVecInner", + "offset": 0 + } + ], + "generic_params": [ + "unsigned long *", + "alloc::alloc::Global" + ] + }, + "alloc::raw_vec::RawVecInner": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "cap", + "type": "core::num::niche_types::UsizeNoHighBit", + "offset": 0 + }, + { + "name": "ptr", + "type": "core::ptr::non_null::NonNull", + "offset": 8 + } + ], + "generic_params": [ + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "long", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec *": { + "size": 8, + "type_class": 4096, + "generic_params": [ + "long", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "main::EndPad", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "main::MidPad", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec >,alloc::alloc::Global>": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec >,alloc::alloc::Global>", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "main::Point >", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec,alloc::alloc::Global>": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec,alloc::alloc::Global>", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "main::Point", + "alloc::alloc::Global" + ] + }, + "alloc::vec::Vec,alloc::alloc::Global>": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "buf", + "type": "alloc::raw_vec::RawVec,alloc::alloc::Global>", + "offset": 0 + }, + { + "name": "len", + "type": "unsigned long long", + "offset": 16 + } + ], + "generic_params": [ + "unsigned long *", + "alloc::alloc::Global" + ] + }, + "core::num::niche_types::UsizeNoHighBit": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "unsigned long long", + "offset": 0 + } + ] + }, + "core::ptr::non_null::NonNull": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "pointer", + "type": "unsigned char *", + "offset": 0 + } + ], + "generic_params": [ + "unsigned char" + ] + }, + "double": { + "size": 8, + "type_class": 4, + "basic_type": 24 + }, + "enum2$ > >": { + "size": 24, + "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 + } + ] + }, + "enum2$ > >::None": { + "size": 24, + "type_class": 16384 + }, + "enum2$ > >::Some": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "__0", + "type": "alloc::vec::Vec", + "offset": 0 + } + ] + }, + "enum2$ > >::Variant0": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "value", + "type": "enum2$ > >::None", + "offset": 0 + } + ] + }, + "enum2$ > >::Variant1": { + "size": 24, + "type_class": 16384, + "fields": [ + { + "name": "value", + "type": "enum2$ > >::Some", + "offset": 0 + } + ] + }, + "long": { + "size": 4, + "type_class": 4, + "basic_type": 15 + }, + "main::EndPad": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "a", + "type": "unsigned int", + "offset": 0 + }, + { + "name": "b", + "type": "unsigned char", + "offset": 4 + } + ] + }, + "main::MidPad": { + "size": 8, + "type_class": 16384, + "fields": [ + { + "name": "a", + "type": "unsigned char", + "offset": 0 + }, + { + "name": "b", + "type": "unsigned int", + "offset": 4 + } + ] + }, + "main::Point >": { + "size": 48, + "type_class": 16384, + "fields": [ + { + "name": "x", + "type": "alloc::vec::Vec", + "offset": 0 + }, + { + "name": "y", + "type": "alloc::vec::Vec", + "offset": 24 + } + ], + "generic_params": [ + "alloc::vec::Vec" + ] + }, + "main::Point": { + "size": 16, + "type_class": 16384, + "fields": [ + { + "name": "x", + "type": "double", + "offset": 0 + }, + { + "name": "y", + "type": "double", + "offset": 8 + } + ], + "generic_params": [ + "double" + ] + }, + "unsigned char": { + "size": 1, + "type_class": 4, + "basic_type": 4 + }, + "unsigned char *": { + "size": 8, + "type_class": 4096 + }, + "unsigned int": { + "size": 4, + "type_class": 4, + "basic_type": 14 + }, + "unsigned long": { + "size": 4, + "type_class": 4, + "basic_type": 16 + }, + "unsigned long *": { + "size": 8, + "type_class": 4096 + }, + "unsigned long long": { + "size": 8, + "type_class": 4, + "basic_type": 18 + } + } +} diff --git a/tests/debuginfo/vec_visualizer/main.rs b/tests/debuginfo/vec_visualizer/main.rs new file mode 100644 index 0000000000000..8f73b4d58b0eb --- /dev/null +++ b/tests/debuginfo/vec_visualizer/main.rs @@ -0,0 +1,91 @@ +#![allow(unused)] +// Ensures `Vec` visualizers still work as expected + +//@ compile-flags:-g +//@ min-llvm-lldb-version: 21.1.0 +//@ min-apple-lldb-version: 1703.0.236.21 + +//@ ignore-backends: gcc + +// === LLDB TESTS ================================================================================== +//@ lldb-command:run +//@ lldb-repr:vec_primitive +//@ lldb-repr:vec_ref +//@ lldb-repr:vec_endpad +//@ lldb-repr:vec_midpad +//@ lldb-repr:vec_generic_i32 +//@ lldb-repr:vec_generic_udt + +// #FIXME(Walnut356): The visualizers don't really handle these correctly. They don't break exactly, +// but the output is awkward in a way that `debugger_tester` can't handle (i.e. it reports having +// children, but those children are invalid because LLDB doesn't like interacting with ZSTs). +// //@ lldb-repr:vec_zst + +//@ lldb-repr:ref_vec +//@ lldb-repr:ptr_vec +//@ lldb-repr:ref_mut_vec +//@ lldb-repr:ptr_mut_vec +//@ lldb-repr:some_vec +//@ lldb-repr:some_empty_vec + +use std::mem::offset_of; + +#[repr(C)] +struct Point { + x: T, + y: T, +} + +// The following 2 structs ensure the debugger can properly locate sequential padded values +#[repr(C)] +struct EndPad { + a: u32, + b: u8, +} + +// u32 + u8 = 5 bytes total. If the struct is 8 bytes and a 1-byte value is last, we know there +// are 3 pad bytes at the end +const _: () = assert!(size_of::() == 8 && offset_of!(EndPad, b) == 4); + +#[repr(C)] +struct MidPad { + a: u8, + b: u32, +} + +// u8 = 1 byte, so if the next field is at offset 4, we know we have 3 pad bytes in the middle +const _: () = assert!(offset_of!(MidPad, b) == 4); + +struct Zst(); + +fn main() { + // basic functionality + let mut vec_primitive = vec![i32::MIN, -1, 0, 1, i32::MAX]; + let vec_ref = vec![&u32::MIN, &1, &2, &u32::MAX]; + let vec_endpad = + vec![EndPad { a: 10, b: 20 }, EndPad { a: 30, b: 40 }, EndPad { a: 50, b: 60 }]; + let vec_midpad = + vec![MidPad { a: 10, b: 20 }, MidPad { a: 30, b: 40 }, MidPad { a: 50, b: 60 }]; + + // Make sure we can properly populate generic children, especially when a namespaced type is + // used as a generic arg. + let vec_generic_i32 = vec![Point { x: 0.0, y: 1.1 }, Point { x: 2.2, y: 3.3 }]; + let vec_generic_udt = + vec![Point { x: vec![0, 0], y: vec![1, 1] }, Point { x: vec![2, 2], y: vec![3, 3] }]; + + let vec_zst = vec![Zst(), Zst(), Zst(), Zst()]; + + // wrappers + let ref_vec = &vec_primitive; + let ptr_vec = ref_vec as *const _; + let ref_mut_vec = &mut vec_primitive; + let ptr_mut_vec = ref_mut_vec as *mut _; + let some_vec = Some(vec_primitive.clone()); + let some_empty_vec: Option> = Some(vec![]); + // FIXME(min-lldb): re-enable once CI is updated to LLDB 23 + // let none_vec: Option> = None; + + zzz(); // #break +} + +fn zzz() {}