1
Fork 0

Update cdb tests for expected output

Also an fix issue with tuple type names where we can't cast to them in
natvis (required by the visualizer for `HashMap`) because of
peculiarities with the natvis expression evaluator.
This commit is contained in:
Wesley Wiser 2021-07-01 14:26:20 -04:00
parent aac8a88552
commit 721b622e07
8 changed files with 82 additions and 68 deletions

View file

@ -81,12 +81,22 @@ pub fn push_debuginfo_type_name<'tcx>(
for component_type in component_types {
push_debuginfo_type_name(tcx, component_type.expect_ty(), true, output, visited);
output.push_str(", ");
output.push(',');
// Natvis does not always like having spaces between parts of the type name
// and this causes issues when we need to write a typename in natvis, for example
// as part of a cast like the `HashMap` visualizer does.
if !cpp_like_names {
output.push(' ');
}
}
if !component_types.is_empty() {
output.pop();
if !cpp_like_names {
output.pop();
}
}
if cpp_like_names {
push_close_angle_bracket(tcx, output);

View file

@ -129,7 +129,7 @@
// cdb-check:f64 : 3.500000 [Type: double]
// cdb-command:.enable_unicode 1
// cdb-command:dx s
// cdb-check:s : 72 [Type: str]
// cdb-check:s : "Hello, World!" [Type: str]
#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]

View file

@ -7,43 +7,43 @@
// so the best we can do is to make sure we are generating the right debuginfo
// cdb-command: dx -r2 a,!
// cdb-check:a,! : Some({...}) [Type: enum$<core::option::Option<enum$<msvc_pretty_enums::CStyleEnum> >, 2, 16, Some>]
// cdb-check:a,! [Type: enum$<core::option::Option<enum$<msvc_pretty_enums::CStyleEnum> >, 2, 16, Some>]
// cdb-check: [+0x000] dataful_variant [Type: enum$<core::option::Option<enum$<msvc_pretty_enums::CStyleEnum> >, 2, 16, Some>::Some]
// cdb-check: [+0x000] __0 : Low (0x2) [Type: msvc_pretty_enums::CStyleEnum]
// cdb-check: [+0x000] discriminant : 0x2 [Type: enum$<core::option::Option<enum$<msvc_pretty_enums::CStyleEnum> >, 2, 16, Some>::Discriminant$]
// cdb-command: dx -r2 b,!
// cdb-check:b,! : None [Type: enum$<core::option::Option<enum$<msvc_pretty_enums::CStyleEnum> >, 2, 16, Some>]
// cdb-check:b,! [Type: enum$<core::option::Option<enum$<msvc_pretty_enums::CStyleEnum> >, 2, 16, Some>]
// cdb-check: [+0x000] dataful_variant [Type: enum$<core::option::Option<enum$<msvc_pretty_enums::CStyleEnum> >, 2, 16, Some>::Some]
// cdb-check: [+0x000] __0 : 0x11 [Type: msvc_pretty_enums::CStyleEnum]
// cdb-check: [+0x000] discriminant : None (0x11) [Type: enum$<core::option::Option<enum$<msvc_pretty_enums::CStyleEnum> >, 2, 16, Some>::Discriminant$]
// cdb-command: dx -r2 c,!
// cdb-check:c,! : Tag1 [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
// cdb-check:c,! [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
// cdb-check: [+0x000] dataful_variant [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>::Data]
// cdb-check: [+0x000] my_data : 0x11 [Type: msvc_pretty_enums::CStyleEnum]
// cdb-check: [+0x000] discriminant : Tag1 (0x11) [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>::Discriminant$]
// cdb-command: dx -r2 d,!
// cdb-check:d,! : Data({...}) [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
// cdb-check:d,! [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
// cdb-check: [+0x000] dataful_variant [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>::Data]
// cdb-check: [+0x000] my_data : High (0x10) [Type: msvc_pretty_enums::CStyleEnum]
// cdb-check: [+0x000] discriminant : 0x10 [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>::Discriminant$]
// cdb-command: dx -r2 e,!
// cdb-check:e,! : Tag2 [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
// cdb-check:e,! [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
// cdb-check: [+0x000] dataful_variant [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>::Data]
// cdb-check: [+0x000] my_data : 0x13 [Type: msvc_pretty_enums::CStyleEnum]
// cdb-check: [+0x000] discriminant : Tag2 (0x13) [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>::Discriminant$]
// cdb-command: dx -r2 f,!
// cdb-check:f,! : Some({...}) [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
// cdb-check:f,! [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
// cdb-check: [+0x000] dataful_variant [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>::Some]
// cdb-check: [+0x000] __0 : 0x[...] : 0x1 [Type: unsigned int *]
// cdb-check: [+0x000] discriminant : 0x[...] [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>::Discriminant$]
// cdb-command: dx -r2 g,!
// cdb-check:g,! : None [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
// cdb-check:g,! [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
// cdb-check: [+0x000] dataful_variant [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>::Some]
// cdb-check: [+0x000] __0 : 0x0 [Type: unsigned int *]
// cdb-check: [+0x000] discriminant : None (0x0) [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>::Discriminant$]
@ -61,7 +61,7 @@
// cdb-check:j : High (0x10) [Type: msvc_pretty_enums::CStyleEnum]
// cdb-command: dx -r2 k,!
// cdb-check:k,! : Some({...}) [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
// cdb-check:k,! [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
// cdb-check: [+0x000] dataful_variant [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>::Some]
// cdb-check: [+0x000] __0 [Type: alloc::string::String]
// cdb-check: [+0x000] discriminant : 0x[...] [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>::Discriminant$]

View file

@ -77,6 +77,8 @@
// cdb-command: dx hash_map,d
// cdb-check: ["0xe"] : 14 [Type: unsigned __int64]
// cdb-command: dx x
#![allow(unused_variables)]
use std::collections::HashSet;
use std::collections::HashMap;
@ -95,6 +97,9 @@ fn main() {
hash_map.insert(i as u64, i as u64);
}
let x = &(123u64, 456u64);
let string = "awefawefawe".to_string();
zzz(); // #break
}

View file

@ -125,8 +125,7 @@
// cdb-command: dx some_string
// NOTE: cdb fails to interpret debug info of Option enums on i686.
// cdb-check:some_string : Some({...}) [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
// cdb-check: [...] __0 : "IAMA optional string!" [Type: alloc::string::String]
// cdb-check:some_string [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
#![allow(unused_variables)]
use std::ffi::OsString;