Repository navigation
Fix error output for invalid SBValue children - #165228
Merged
Merged
Conversation
Kobzol
approved these changes
Oct 31, 2026
Member
There was a problem hiding this comment.
Sigh, this GetTypeName() thing is annoying. Something that seems like an API shortcut should really behave in the same way as if you didn't use the shortcut. Shoo, inconsistent API!
Thanks.
@bors r+
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Oct 31, 2026
Fix error output for invalid `SBValue` children LLDB has some weird inconsistencies around objects in invalid states. ``` (lldb) script type(lldb.SBValue().GetName()) <class 'NoneType'> (lldb) script type(lldb.SBValue().GetTypeName()) <class 'NoneType'> (lldb) script type(lldb.SBValue().GetType().GetName()) <class 'str'> (lldb) script lldb.SBValue().GetType().GetName() '' ``` tl;dr, `SBValue` seems to tend to return `None` instead of empty strings? Whereas `SBType` tends to return an empty string. The last example is particularly baffling because `.GetType().GetName()` and `.GetTypeName()` should be doing literally exactly the same thing? Iunno. In any case, the fact that `None` was sometimes returned lead to some [error messages getting clobbered by an exception](rust-lang#164975 (comment)). This change ensures that all `Child` objects are initialized to a reasonable state (and an error is reported) in cases where we encounter invalid `SBValue` objects. To verify the output, you can change the contents of [this function](https://github.com/rust-lang/rust/blob/92b5b8c87c61b20adc9001b41baf587634a74734/src/etc/lldb_providers.py#L1175) to: ```py from lldb import SBValue return SBValue() ``` and run `./x test tests/debuginfo/vec_visualizer` That should result in something along the lines of <details><summary>Details</summary> <p> ``` (lldb) run (lldb) repr vec_primitive [repr error: vec_primitive] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_primitive] GetChildAtIndex(1) returned an invalid SBValue [repr error: vec_primitive] GetChildAtIndex(2) returned an invalid SBValue [repr error: vec_primitive] GetChildAtIndex(3) returned an invalid SBValue [repr error: vec_primitive] GetChildAtIndex(4) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'core::num::niche_types::UsizeNoHighBit'] The following field(s) do not match (expected -> got): Field(name='__0', type='unsigned long', offset=0) -> Field(name='__0', type='usize', offset=0) [repr error: type 'usize'] type not found in input data [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] type not found in input data [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_primitive] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global>) vec_primitive = size=5 { buf = {inner:{ptr:{pointer:""}, cap:{0:5}, alloc:{}}, _marker:{}} len = 5 }, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr vec_ref [repr error: vec_ref] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_ref] GetChildAtIndex(1) returned an invalid SBValue [repr error: vec_ref] GetChildAtIndex(2) returned an invalid SBValue [repr error: vec_ref] GetChildAtIndex(3) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<unsigned int *, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<unsigned int *, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_ref] The following children do not match (expected -> got): [0]: unsigned int * = None -> : = None [1]: unsigned int * = None -> : = None [2]: unsigned int * = None -> : = None [3]: unsigned int * = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<unsigned int *, alloc::alloc::Global>) vec_ref = size=4 { buf = {inner:{ptr:{pointer:"\bTUUUU"}, cap:{0:4}, alloc:{}}, _marker:{}} len = 4 }, 'element_type': unsigned int *, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 8, 'data_ptr': (unsigned char *) pointer = 0x000055555555d220 "\bTUUUU", 'length': 4}) (lldb) repr vec_endpad [repr error: vec_endpad] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_endpad] GetChildAtIndex(1) returned an invalid SBValue [repr error: vec_endpad] GetChildAtIndex(2) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<main::EndPad, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<main::EndPad, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_endpad] The following children do not match (expected -> got): [0]: main::EndPad = None -> : = None [1]: main::EndPad = None -> : = None [2]: main::EndPad = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<main::EndPad, alloc::alloc::Global>) vec_endpad = size=3 { buf = {inner:{ptr:{pointer:"\n"}, cap:{0:3}, alloc:{}}, _marker:{}} len = 3 }, 'element_type': struct EndPad { private: unsigned int a; unsigned char b; }, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 8, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd70 "\n", 'length': 3}) (lldb) repr vec_midpad [repr error: vec_midpad] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_midpad] GetChildAtIndex(1) returned an invalid SBValue [repr error: vec_midpad] GetChildAtIndex(2) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<main::MidPad, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<main::MidPad, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_midpad] The following children do not match (expected -> got): [0]: main::MidPad = None -> : = None [1]: main::MidPad = None -> : = None [2]: main::MidPad = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<main::MidPad, alloc::alloc::Global>) vec_midpad = size=3 { buf = {inner:{ptr:{pointer:"\n"}, cap:{0:3}, alloc:{}}, _marker:{}} len = 3 }, 'element_type': struct MidPad { private: unsigned char a; unsigned int b; }, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 8, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd90 "\n", 'length': 3}) (lldb) repr vec_generic_i32 [repr error: vec_generic_i32] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_generic_i32] GetChildAtIndex(1) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<main::Point<double>, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<main::Point<double>, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_generic_i32] The following children do not match (expected -> got): [0]: main::Point<double> = None -> : = None [1]: main::Point<double> = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<main::Point<double>, alloc::alloc::Global>) vec_generic_i32 = size=2 { buf = {inner:{ptr:{pointer:""}, cap:{0:2}, alloc:{}}, _marker:{}} len = 2 }, 'element_type': template<> struct Point<double> { private: double x; double y; }, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 16, 'data_ptr': (unsigned char *) pointer = 0x000055555555d1f0 "", 'length': 2}) (lldb) repr vec_generic_udt [repr error: vec_generic_udt] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_generic_udt] GetChildAtIndex(1) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<main::Point<alloc::vec::Vec<int, alloc::alloc::Global> >, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<main::Point<alloc::vec::Vec<int, alloc::alloc::Global> >, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_generic_udt] The following children do not match (expected -> got): [0]: main::Point<alloc::vec::Vec<int, alloc::alloc::Global> > = None -> : = None [1]: main::Point<alloc::vec::Vec<int, alloc::alloc::Global> > = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<main::Point<alloc::vec::Vec<int, alloc::alloc::Global> >, alloc::alloc::Global>) vec_generic_udt = size=2 { buf = {inner:{ptr:{pointer:"\U00000002"}, cap:{0:2}, alloc:{}}, _marker:{}} len = 2 }, 'element_type': template<> struct Point<alloc::vec::Vec<int, alloc::alloc::Global>> { private: alloc::vec::Vec<int, alloc::alloc::Global> x; alloc::vec::Vec<int, alloc::alloc::Global> y; }, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 48, 'data_ptr': (unsigned char *) pointer = 0x000055555555ddb0 "\U00000002", 'length': 2}) (lldb) repr ref_vec [repr error: ref_vec] GetChildAtIndex(0) returned an invalid SBValue [repr error: ref_vec] GetChildAtIndex(1) returned an invalid SBValue [repr error: ref_vec] GetChildAtIndex(2) returned an invalid SBValue [repr error: ref_vec] GetChildAtIndex(3) returned an invalid SBValue [repr error: ref_vec] GetChildAtIndex(4) returned an invalid SBValue [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: ref_vec] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global> *) ref_vec = 0x00007fffffffd918 size=5, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr ptr_vec [repr error: ptr_vec] GetChildAtIndex(0) returned an invalid SBValue [repr error: ptr_vec] GetChildAtIndex(1) returned an invalid SBValue [repr error: ptr_vec] GetChildAtIndex(2) returned an invalid SBValue [repr error: ptr_vec] GetChildAtIndex(3) returned an invalid SBValue [repr error: ptr_vec] GetChildAtIndex(4) returned an invalid SBValue [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: ptr_vec] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global> *) ptr_vec = 0x00007fffffffd918 size=5, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr ref_mut_vec [repr error: ref_mut_vec] GetChildAtIndex(0) returned an invalid SBValue [repr error: ref_mut_vec] GetChildAtIndex(1) returned an invalid SBValue [repr error: ref_mut_vec] GetChildAtIndex(2) returned an invalid SBValue [repr error: ref_mut_vec] GetChildAtIndex(3) returned an invalid SBValue [repr error: ref_mut_vec] GetChildAtIndex(4) returned an invalid SBValue [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: ref_mut_vec] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global> *) ref_mut_vec = 0x00007fffffffd918 size=5, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr ptr_mut_vec [repr error: ptr_mut_vec] GetChildAtIndex(0) returned an invalid SBValue [repr error: ptr_mut_vec] GetChildAtIndex(1) returned an invalid SBValue [repr error: ptr_mut_vec] GetChildAtIndex(2) returned an invalid SBValue [repr error: ptr_mut_vec] GetChildAtIndex(3) returned an invalid SBValue [repr error: ptr_mut_vec] GetChildAtIndex(4) returned an invalid SBValue [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: ptr_mut_vec] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global> *) ptr_mut_vec = 0x00007fffffffd918 size=5, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr some_vec [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(0) returned an invalid SBValue [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(1) returned an invalid SBValue [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(2) returned an invalid SBValue [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(3) returned an invalid SBValue [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(4) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: some_vec.0] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None (lldb) repr some_empty_vec [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') some_empty_vec: Ok (lldb) quit ``` </p> </details> The output probably still isn't optimal, but for the time being, this is infinitely more helpful than the "unrelated" exception we were getting before. r? @jieyouxu, @Kobzol
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 31, 2026
…uwer Rollup of 23 pull requests Successful merges: - #163410 (Use a macro to reduce duplication in `core/src/num/f{16,32,64,128}.rs` (part 1)) - #164290 (virtual function elimination: only use `type.checked.load` for function pointers) - #165113 (Limit lldb string summary length) - #165146 (Stop using LLVM struct types for array/pointer offset GEPs (rebase)) - #165197 (Inline usages of `is_doc_keyword_or_attribute` and `is_rustc_doc_primitive`) - #165209 (Don't ICE when making diagnostic in `point_at_dyn_trait_in_field_def` if there's no `dyn Trait` field to point at) - #165228 (Fix error output for invalid `SBValue` children) - #153633 (feat: improve `Cell` doc) - #164686 (Add regression test for new solver hang on cyclic projection bound) - #164730 (core: Rename `abort_immediate` to `crash`) - #164937 (Add example for misaligned elements in `subslice_range`) - #165019 (Add safety section for from_utf8_unchecked/from_raw_parts) - #165035 (Suggest `gca!` for path const args that use generic params) - #165106 (Windows: Disallow some special chars in bat script names) - #165120 (Add regression test for overlap check hang with unresolved type in where clause) - #165158 (Tiny optimization to `TypeErrCtxt::report_inference_failure()`) - #165184 (GCI: Check where-clauses of associated constants for well-formedness) - #165190 (Improve delayed bug comment and message on first_method_vtable_slot) - #165196 (inhabitedness: use try_normalize_erasing_regions on ADT fields) - #165206 (tests: clarify dead_code_pub_in_binary FIXME after Cargo workaround) - #165214 (add MaybeUninit::from_ref) - #165225 (LoongArch: Restore `feature(stdarch_loongarch)` for bootstrap) - #165235 (two LLVM backend cleanups) Failed merges: - #160370 (rustdoc: notable trait badge and popover enhancements) - #164981 (Reflection add TypeId::name)
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 31, 2026
Rollup merge of #165228 - Walnut356:invalid_sbvalue, r=Kobzol Fix error output for invalid `SBValue` children LLDB has some weird inconsistencies around objects in invalid states. ``` (lldb) script type(lldb.SBValue().GetName()) <class 'NoneType'> (lldb) script type(lldb.SBValue().GetTypeName()) <class 'NoneType'> (lldb) script type(lldb.SBValue().GetType().GetName()) <class 'str'> (lldb) script lldb.SBValue().GetType().GetName() '' ``` tl;dr, `SBValue` seems to tend to return `None` instead of empty strings? Whereas `SBType` tends to return an empty string. The last example is particularly baffling because `.GetType().GetName()` and `.GetTypeName()` should be doing literally exactly the same thing? Iunno. In any case, the fact that `None` was sometimes returned lead to some [error messages getting clobbered by an exception](#164975 (comment)). This change ensures that all `Child` objects are initialized to a reasonable state (and an error is reported) in cases where we encounter invalid `SBValue` objects. To verify the output, you can change the contents of [this function](https://github.com/rust-lang/rust/blob/92b5b8c87c61b20adc9001b41baf587634a74734/src/etc/lldb_providers.py#L1175) to: ```py from lldb import SBValue return SBValue() ``` and run `./x test tests/debuginfo/vec_visualizer` That should result in something along the lines of <details><summary>Details</summary> <p> ``` (lldb) run (lldb) repr vec_primitive [repr error: vec_primitive] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_primitive] GetChildAtIndex(1) returned an invalid SBValue [repr error: vec_primitive] GetChildAtIndex(2) returned an invalid SBValue [repr error: vec_primitive] GetChildAtIndex(3) returned an invalid SBValue [repr error: vec_primitive] GetChildAtIndex(4) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'core::num::niche_types::UsizeNoHighBit'] The following field(s) do not match (expected -> got): Field(name='__0', type='unsigned long', offset=0) -> Field(name='__0', type='usize', offset=0) [repr error: type 'usize'] type not found in input data [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] type not found in input data [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_primitive] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global>) vec_primitive = size=5 { buf = {inner:{ptr:{pointer:""}, cap:{0:5}, alloc:{}}, _marker:{}} len = 5 }, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr vec_ref [repr error: vec_ref] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_ref] GetChildAtIndex(1) returned an invalid SBValue [repr error: vec_ref] GetChildAtIndex(2) returned an invalid SBValue [repr error: vec_ref] GetChildAtIndex(3) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<unsigned int *, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<unsigned int *, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_ref] The following children do not match (expected -> got): [0]: unsigned int * = None -> : = None [1]: unsigned int * = None -> : = None [2]: unsigned int * = None -> : = None [3]: unsigned int * = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<unsigned int *, alloc::alloc::Global>) vec_ref = size=4 { buf = {inner:{ptr:{pointer:"\bTUUUU"}, cap:{0:4}, alloc:{}}, _marker:{}} len = 4 }, 'element_type': unsigned int *, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 8, 'data_ptr': (unsigned char *) pointer = 0x000055555555d220 "\bTUUUU", 'length': 4}) (lldb) repr vec_endpad [repr error: vec_endpad] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_endpad] GetChildAtIndex(1) returned an invalid SBValue [repr error: vec_endpad] GetChildAtIndex(2) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<main::EndPad, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<main::EndPad, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_endpad] The following children do not match (expected -> got): [0]: main::EndPad = None -> : = None [1]: main::EndPad = None -> : = None [2]: main::EndPad = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<main::EndPad, alloc::alloc::Global>) vec_endpad = size=3 { buf = {inner:{ptr:{pointer:"\n"}, cap:{0:3}, alloc:{}}, _marker:{}} len = 3 }, 'element_type': struct EndPad { private: unsigned int a; unsigned char b; }, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 8, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd70 "\n", 'length': 3}) (lldb) repr vec_midpad [repr error: vec_midpad] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_midpad] GetChildAtIndex(1) returned an invalid SBValue [repr error: vec_midpad] GetChildAtIndex(2) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<main::MidPad, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<main::MidPad, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_midpad] The following children do not match (expected -> got): [0]: main::MidPad = None -> : = None [1]: main::MidPad = None -> : = None [2]: main::MidPad = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<main::MidPad, alloc::alloc::Global>) vec_midpad = size=3 { buf = {inner:{ptr:{pointer:"\n"}, cap:{0:3}, alloc:{}}, _marker:{}} len = 3 }, 'element_type': struct MidPad { private: unsigned char a; unsigned int b; }, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 8, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd90 "\n", 'length': 3}) (lldb) repr vec_generic_i32 [repr error: vec_generic_i32] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_generic_i32] GetChildAtIndex(1) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<main::Point<double>, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<main::Point<double>, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_generic_i32] The following children do not match (expected -> got): [0]: main::Point<double> = None -> : = None [1]: main::Point<double> = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<main::Point<double>, alloc::alloc::Global>) vec_generic_i32 = size=2 { buf = {inner:{ptr:{pointer:""}, cap:{0:2}, alloc:{}}, _marker:{}} len = 2 }, 'element_type': template<> struct Point<double> { private: double x; double y; }, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 16, 'data_ptr': (unsigned char *) pointer = 0x000055555555d1f0 "", 'length': 2}) (lldb) repr vec_generic_udt [repr error: vec_generic_udt] GetChildAtIndex(0) returned an invalid SBValue [repr error: vec_generic_udt] GetChildAtIndex(1) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<main::Point<alloc::vec::Vec<int, alloc::alloc::Global> >, alloc::alloc::Global>'] The following field(s) do not match (expected -> got): Field(name='len', type='unsigned long', offset=16) -> Field(name='len', type='usize', offset=16) [repr error: type 'alloc::vec::Vec<main::Point<alloc::vec::Vec<int, alloc::alloc::Global> >, alloc::alloc::Global>'] It appears these changes do not affect the type's providers. Consider rerunning with the `--bless` option [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'usize'] mismatch (see prior output for type 'usize') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: vec_generic_udt] The following children do not match (expected -> got): [0]: main::Point<alloc::vec::Vec<int, alloc::alloc::Global> > = None -> : = None [1]: main::Point<alloc::vec::Vec<int, alloc::alloc::Global> > = None -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<main::Point<alloc::vec::Vec<int, alloc::alloc::Global> >, alloc::alloc::Global>) vec_generic_udt = size=2 { buf = {inner:{ptr:{pointer:"\U00000002"}, cap:{0:2}, alloc:{}}, _marker:{}} len = 2 }, 'element_type': template<> struct Point<alloc::vec::Vec<int, alloc::alloc::Global>> { private: alloc::vec::Vec<int, alloc::alloc::Global> x; alloc::vec::Vec<int, alloc::alloc::Global> y; }, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 48, 'data_ptr': (unsigned char *) pointer = 0x000055555555ddb0 "\U00000002", 'length': 2}) (lldb) repr ref_vec [repr error: ref_vec] GetChildAtIndex(0) returned an invalid SBValue [repr error: ref_vec] GetChildAtIndex(1) returned an invalid SBValue [repr error: ref_vec] GetChildAtIndex(2) returned an invalid SBValue [repr error: ref_vec] GetChildAtIndex(3) returned an invalid SBValue [repr error: ref_vec] GetChildAtIndex(4) returned an invalid SBValue [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: ref_vec] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global> *) ref_vec = 0x00007fffffffd918 size=5, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr ptr_vec [repr error: ptr_vec] GetChildAtIndex(0) returned an invalid SBValue [repr error: ptr_vec] GetChildAtIndex(1) returned an invalid SBValue [repr error: ptr_vec] GetChildAtIndex(2) returned an invalid SBValue [repr error: ptr_vec] GetChildAtIndex(3) returned an invalid SBValue [repr error: ptr_vec] GetChildAtIndex(4) returned an invalid SBValue [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: ptr_vec] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global> *) ptr_vec = 0x00007fffffffd918 size=5, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr ref_mut_vec [repr error: ref_mut_vec] GetChildAtIndex(0) returned an invalid SBValue [repr error: ref_mut_vec] GetChildAtIndex(1) returned an invalid SBValue [repr error: ref_mut_vec] GetChildAtIndex(2) returned an invalid SBValue [repr error: ref_mut_vec] GetChildAtIndex(3) returned an invalid SBValue [repr error: ref_mut_vec] GetChildAtIndex(4) returned an invalid SBValue [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: ref_mut_vec] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global> *) ref_mut_vec = 0x00007fffffffd918 size=5, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr ptr_mut_vec [repr error: ptr_mut_vec] GetChildAtIndex(0) returned an invalid SBValue [repr error: ptr_mut_vec] GetChildAtIndex(1) returned an invalid SBValue [repr error: ptr_mut_vec] GetChildAtIndex(2) returned an invalid SBValue [repr error: ptr_mut_vec] GetChildAtIndex(3) returned an invalid SBValue [repr error: ptr_mut_vec] GetChildAtIndex(4) returned an invalid SBValue [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: type ''] mismatch (see prior output for type '') [repr error: ptr_mut_vec] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None Synthetic Provider state: {'valobj': (alloc::vec::Vec<int, alloc::alloc::Global> *) ptr_mut_vec = 0x00007fffffffd918 size=5, 'element_type': int, 'no_hi_bit_max': 9223372036854775808, 'element_type_size': 4, 'data_ptr': (unsigned char *) pointer = 0x000055555555dd50 "", 'length': 5}) (lldb) repr some_vec [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(0) returned an invalid SBValue [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(1) returned an invalid SBValue [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(2) returned an invalid SBValue [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(3) returned an invalid SBValue [repr error: some_vec.$variants$.$variant$.value.0] GetChildAtIndex(4) returned an invalid SBValue [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') [repr error: some_vec.0] The following children do not match (expected -> got): [0]: int = -2147483648 -> : = None [1]: int = -1 -> : = None [2]: int = 0 -> : = None [3]: int = 1 -> : = None [4]: int = 2147483647 -> : = None (lldb) repr some_empty_vec [repr error: type 'alloc::vec::Vec<int, alloc::alloc::Global>'] mismatch (see prior output for type 'alloc::vec::Vec<int, alloc::alloc::Global>') some_empty_vec: Ok (lldb) quit ``` </p> </details> The output probably still isn't optimal, but for the time being, this is infinitely more helpful than the "unrelated" exception we were getting before. r? @jieyouxu, @Kobzol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLDB has some weird inconsistencies around objects in invalid states.
tl;dr,
SBValueseems to tend to returnNoneinstead of empty strings? WhereasSBTypetends to return an empty string. The last example is particularly baffling because.GetType().GetName()and.GetTypeName()should be doing literally exactly the same thing? Iunno.In any case, the fact that
Nonewas sometimes returned lead to some error messages getting clobbered by an exception. This change ensures that allChildobjects are initialized to a reasonable state (and an error is reported) in cases where we encounter invalidSBValueobjects.To verify the output, you can change the contents of this function to:
and run
./x test tests/debuginfo/vec_visualizerThat should result in something along the lines of
Details
The output probably still isn't optimal, but for the time being, this is infinitely more helpful than the "unrelated" exception we were getting before.
r? @jieyouxu, @Kobzol