debuginfo: Make DWARF representation of enums uniform.
So far the DWARF information for enums was different for regular enums, univariant enums, Option-like enums, etc. Regular enums were encoded as unions of structs, while the other variants were encoded as bare structs. With the changes in this PR all enums are encoded as unions so that debuggers can reconstruct if something originally was a struct, a univariant enum, or an Option-like enum. For the latter case, information about the Null variant is encoded into the union field name. This information can then be used by the debugger to print a None value actually as None instead of Some(0x0).
This commit is contained in:
parent
138089355d
commit
eea329b0f7
11 changed files with 221 additions and 145 deletions
|
@ -1272,7 +1272,7 @@ enum RecursiveTypeDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RecursiveTypeDescription {
|
impl RecursiveTypeDescription {
|
||||||
// Finishes up the description of the type in question (mostly by providing description of the
|
// Finishes up the description of the type in question (mostly by providing descriptions of the
|
||||||
// fields of the given type) and returns the final type metadata.
|
// fields of the given type) and returns the final type metadata.
|
||||||
fn finalize(&self, cx: &CrateContext) -> DICompositeType {
|
fn finalize(&self, cx: &CrateContext) -> DICompositeType {
|
||||||
match *self {
|
match *self {
|
||||||
|
@ -1453,7 +1453,7 @@ fn prepare_tuple_metadata(cx: &CrateContext,
|
||||||
struct EnumMemberDescriptionFactory {
|
struct EnumMemberDescriptionFactory {
|
||||||
type_rep: Rc<adt::Repr>,
|
type_rep: Rc<adt::Repr>,
|
||||||
variants: Rc<Vec<Rc<ty::VariantInfo>>>,
|
variants: Rc<Vec<Rc<ty::VariantInfo>>>,
|
||||||
discriminant_type_metadata: DIType,
|
discriminant_type_metadata: Option<DIType>,
|
||||||
containing_scope: DIScope,
|
containing_scope: DIScope,
|
||||||
file_metadata: DIFile,
|
file_metadata: DIFile,
|
||||||
span: Span,
|
span: Span,
|
||||||
|
@ -1461,41 +1461,170 @@ struct EnumMemberDescriptionFactory {
|
||||||
|
|
||||||
impl EnumMemberDescriptionFactory {
|
impl EnumMemberDescriptionFactory {
|
||||||
fn create_member_descriptions(&self, cx: &CrateContext) -> Vec<MemberDescription> {
|
fn create_member_descriptions(&self, cx: &CrateContext) -> Vec<MemberDescription> {
|
||||||
// Capture type_rep, so we don't have to copy the struct_defs array
|
match *self.type_rep {
|
||||||
let struct_defs = match *self.type_rep {
|
adt::General(_, ref struct_defs) => {
|
||||||
adt::General(_, ref struct_defs) => struct_defs,
|
let discriminant_info = RegularDiscriminant(self.discriminant_type_metadata
|
||||||
_ => cx.sess().bug("unreachable")
|
.expect(""));
|
||||||
};
|
|
||||||
|
|
||||||
struct_defs
|
struct_defs
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, struct_def)| {
|
.map(|(i, struct_def)| {
|
||||||
let (variant_type_metadata, variant_llvm_type, member_desc_factory) =
|
let (variant_type_metadata, variant_llvm_type, member_desc_factory) =
|
||||||
|
describe_enum_variant(cx,
|
||||||
|
struct_def,
|
||||||
|
&**self.variants.get(i),
|
||||||
|
discriminant_info,
|
||||||
|
self.containing_scope,
|
||||||
|
self.file_metadata,
|
||||||
|
self.span);
|
||||||
|
|
||||||
|
let member_descriptions = member_desc_factory
|
||||||
|
.create_member_descriptions(cx);
|
||||||
|
|
||||||
|
set_members_of_composite_type(cx,
|
||||||
|
variant_type_metadata,
|
||||||
|
variant_llvm_type,
|
||||||
|
member_descriptions.as_slice(),
|
||||||
|
self.file_metadata,
|
||||||
|
codemap::DUMMY_SP);
|
||||||
|
MemberDescription {
|
||||||
|
name: "".to_string(),
|
||||||
|
llvm_type: variant_llvm_type,
|
||||||
|
type_metadata: variant_type_metadata,
|
||||||
|
offset: FixedMemberOffset { bytes: 0 },
|
||||||
|
}
|
||||||
|
}).collect()
|
||||||
|
},
|
||||||
|
adt::Univariant(ref struct_def, _) => {
|
||||||
|
assert!(self.variants.len() <= 1);
|
||||||
|
|
||||||
|
if self.variants.len() == 0 {
|
||||||
|
vec![]
|
||||||
|
} else {
|
||||||
|
let (variant_type_metadata, variant_llvm_type, member_description_factory) =
|
||||||
|
describe_enum_variant(cx,
|
||||||
|
struct_def,
|
||||||
|
&**self.variants.get(0),
|
||||||
|
NoDiscriminant,
|
||||||
|
self.containing_scope,
|
||||||
|
self.file_metadata,
|
||||||
|
self.span);
|
||||||
|
|
||||||
|
let member_descriptions =
|
||||||
|
member_description_factory.create_member_descriptions(cx);
|
||||||
|
|
||||||
|
set_members_of_composite_type(cx,
|
||||||
|
variant_type_metadata,
|
||||||
|
variant_llvm_type,
|
||||||
|
member_descriptions.as_slice(),
|
||||||
|
self.file_metadata,
|
||||||
|
codemap::DUMMY_SP);
|
||||||
|
vec![
|
||||||
|
MemberDescription {
|
||||||
|
name: "".to_string(),
|
||||||
|
llvm_type: variant_llvm_type,
|
||||||
|
type_metadata: variant_type_metadata,
|
||||||
|
offset: FixedMemberOffset { bytes: 0 },
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adt::RawNullablePointer { nndiscr: non_null_variant_index, nnty, .. } => {
|
||||||
|
// As far as debuginfo is concerned, the pointer this enum represents is still
|
||||||
|
// wrapped in a struct. This is to make the DWARF representation of enums uniform.
|
||||||
|
|
||||||
|
// First create a description of the artifical wrapper struct:
|
||||||
|
let non_null_variant = self.variants.get(non_null_variant_index as uint);
|
||||||
|
let non_null_variant_ident = non_null_variant.name;
|
||||||
|
let non_null_variant_name = token::get_ident(non_null_variant_ident);
|
||||||
|
|
||||||
|
// The llvm type and metadata of the pointer
|
||||||
|
let non_null_llvm_type = type_of::type_of(cx, nnty);
|
||||||
|
let non_null_type_metadata = type_metadata(cx, nnty, self.span);
|
||||||
|
|
||||||
|
// The type of the artificial struct wrapping the pointer
|
||||||
|
let artificial_struct_llvm_type = Type::struct_(cx, &[non_null_llvm_type], false);
|
||||||
|
|
||||||
|
// For the metadata of the wrapper struct, we need to create a MemberDescription
|
||||||
|
// of the struct's single field.
|
||||||
|
let sole_struct_member_description = MemberDescription {
|
||||||
|
name: match non_null_variant.arg_names {
|
||||||
|
Some(ref names) => token::get_ident(*names.get(0)).get().to_string(),
|
||||||
|
None => "".to_string()
|
||||||
|
},
|
||||||
|
llvm_type: non_null_llvm_type,
|
||||||
|
type_metadata: non_null_type_metadata,
|
||||||
|
offset: FixedMemberOffset { bytes: 0 },
|
||||||
|
};
|
||||||
|
|
||||||
|
// Now we can create the metadata of the artificial struct
|
||||||
|
let artificial_struct_metadata =
|
||||||
|
composite_type_metadata(cx,
|
||||||
|
artificial_struct_llvm_type,
|
||||||
|
non_null_variant_name.get(),
|
||||||
|
&[sole_struct_member_description],
|
||||||
|
self.containing_scope,
|
||||||
|
self.file_metadata,
|
||||||
|
codemap::DUMMY_SP);
|
||||||
|
|
||||||
|
// Encode the information about the null variant in the union member's name
|
||||||
|
let null_variant_index = (1 - non_null_variant_index) as uint;
|
||||||
|
let null_variant_ident = self.variants.get(null_variant_index).name;
|
||||||
|
let null_variant_name = token::get_ident(null_variant_ident);
|
||||||
|
let union_member_name = format!("RUST$ENCODED$ENUM${}${}", 0, null_variant_name);
|
||||||
|
|
||||||
|
// Finally create the (singleton) list of descriptions of union members
|
||||||
|
vec![
|
||||||
|
MemberDescription {
|
||||||
|
name: union_member_name,
|
||||||
|
llvm_type: artificial_struct_llvm_type,
|
||||||
|
type_metadata: artificial_struct_metadata,
|
||||||
|
offset: FixedMemberOffset { bytes: 0 },
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
adt::StructWrappedNullablePointer { nonnull: ref struct_def, nndiscr, ptrfield, ..} => {
|
||||||
|
// Create a description of the non-null variant
|
||||||
|
let (variant_type_metadata, variant_llvm_type, member_description_factory) =
|
||||||
describe_enum_variant(cx,
|
describe_enum_variant(cx,
|
||||||
struct_def,
|
struct_def,
|
||||||
&**self.variants.get(i),
|
&**self.variants.get(nndiscr as uint),
|
||||||
RegularDiscriminant(self.discriminant_type_metadata),
|
OptimizedDiscriminant(ptrfield),
|
||||||
self.containing_scope,
|
self.containing_scope,
|
||||||
self.file_metadata,
|
self.file_metadata,
|
||||||
self.span);
|
self.span);
|
||||||
|
|
||||||
let member_descriptions =
|
let variant_member_descriptions =
|
||||||
member_desc_factory.create_member_descriptions(cx);
|
member_description_factory.create_member_descriptions(cx);
|
||||||
|
|
||||||
set_members_of_composite_type(cx,
|
set_members_of_composite_type(cx,
|
||||||
variant_type_metadata,
|
variant_type_metadata,
|
||||||
variant_llvm_type,
|
variant_llvm_type,
|
||||||
member_descriptions.as_slice(),
|
variant_member_descriptions.as_slice(),
|
||||||
self.file_metadata,
|
self.file_metadata,
|
||||||
codemap::DUMMY_SP);
|
codemap::DUMMY_SP);
|
||||||
MemberDescription {
|
|
||||||
name: "".to_string(),
|
// Encode the information about the null variant in the union member's name
|
||||||
llvm_type: variant_llvm_type,
|
let null_variant_index = (1 - nndiscr) as uint;
|
||||||
type_metadata: variant_type_metadata,
|
let null_variant_ident = self.variants.get(null_variant_index).name;
|
||||||
offset: FixedMemberOffset { bytes: 0 },
|
let null_variant_name = token::get_ident(null_variant_ident);
|
||||||
}
|
let union_member_name = format!("RUST$ENCODED$ENUM${}${}",
|
||||||
}).collect()
|
ptrfield,
|
||||||
|
null_variant_name);
|
||||||
|
|
||||||
|
// Create the (singleton) list of descriptions of union members
|
||||||
|
vec![
|
||||||
|
MemberDescription {
|
||||||
|
name: union_member_name,
|
||||||
|
llvm_type: variant_llvm_type,
|
||||||
|
type_metadata: variant_type_metadata,
|
||||||
|
offset: FixedMemberOffset { bytes: 0 },
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
adt::CEnum(..) => cx.sess().span_bug(self.span, "This should be unreachable.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1546,7 +1675,7 @@ fn describe_enum_variant(cx: &CrateContext,
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.as_slice(),
|
.as_slice(),
|
||||||
struct_def.packed);
|
struct_def.packed);
|
||||||
// Could some consistency checks here: size, align, field count, discr type
|
// Could do some consistency checks here: size, align, field count, discr type
|
||||||
|
|
||||||
// Find the source code location of the variant's definition
|
// Find the source code location of the variant's definition
|
||||||
let variant_definition_span = if variant_info.id.krate == ast::LOCAL_CRATE {
|
let variant_definition_span = if variant_info.id.krate == ast::LOCAL_CRATE {
|
||||||
|
@ -1610,21 +1739,6 @@ fn prepare_enum_metadata(cx: &CrateContext,
|
||||||
let loc = span_start(cx, definition_span);
|
let loc = span_start(cx, definition_span);
|
||||||
let file_metadata = file_metadata(cx, loc.file.name.as_slice());
|
let file_metadata = file_metadata(cx, loc.file.name.as_slice());
|
||||||
|
|
||||||
// For empty enums there is an early exit. Just describe it as an empty struct with the
|
|
||||||
// appropriate type name
|
|
||||||
if ty::type_is_empty(cx.tcx(), enum_type) {
|
|
||||||
let empty_type_metadata = composite_type_metadata(
|
|
||||||
cx,
|
|
||||||
Type::nil(cx),
|
|
||||||
enum_name.as_slice(),
|
|
||||||
[],
|
|
||||||
containing_scope,
|
|
||||||
file_metadata,
|
|
||||||
definition_span);
|
|
||||||
|
|
||||||
return FinalMetadata(empty_type_metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
let variants = ty::enum_variants(cx.tcx(), enum_def_id);
|
let variants = ty::enum_variants(cx.tcx(), enum_def_id);
|
||||||
|
|
||||||
let enumerators_metadata: Vec<DIDescriptor> = variants
|
let enumerators_metadata: Vec<DIDescriptor> = variants
|
||||||
|
@ -1685,92 +1799,52 @@ fn prepare_enum_metadata(cx: &CrateContext,
|
||||||
|
|
||||||
let type_rep = adt::represent_type(cx, enum_type);
|
let type_rep = adt::represent_type(cx, enum_type);
|
||||||
|
|
||||||
return match *type_rep {
|
let discriminant_type_metadata = match *type_rep {
|
||||||
adt::CEnum(inttype, _, _) => {
|
adt::CEnum(inttype, _, _) => {
|
||||||
FinalMetadata(discriminant_type_metadata(inttype))
|
return FinalMetadata(discriminant_type_metadata(inttype))
|
||||||
}
|
},
|
||||||
adt::Univariant(ref struct_def, _) => {
|
adt::RawNullablePointer { .. } |
|
||||||
assert!(variants.len() == 1);
|
adt::StructWrappedNullablePointer { .. } |
|
||||||
let (metadata_stub,
|
adt::Univariant(..) => None,
|
||||||
variant_llvm_type,
|
adt::General(inttype, _) => Some(discriminant_type_metadata(inttype)),
|
||||||
member_description_factory) =
|
};
|
||||||
describe_enum_variant(cx,
|
|
||||||
struct_def,
|
|
||||||
&**variants.get(0),
|
|
||||||
NoDiscriminant,
|
|
||||||
containing_scope,
|
|
||||||
file_metadata,
|
|
||||||
span);
|
|
||||||
UnfinishedMetadata {
|
|
||||||
cache_id: cache_id_for_type(enum_type),
|
|
||||||
metadata_stub: metadata_stub,
|
|
||||||
llvm_type: variant_llvm_type,
|
|
||||||
file_metadata: file_metadata,
|
|
||||||
member_description_factory: member_description_factory
|
|
||||||
}
|
|
||||||
}
|
|
||||||
adt::General(inttype, _) => {
|
|
||||||
let discriminant_type_metadata = discriminant_type_metadata(inttype);
|
|
||||||
let enum_llvm_type = type_of::type_of(cx, enum_type);
|
|
||||||
let (enum_type_size, enum_type_align) = size_and_align_of(cx, enum_llvm_type);
|
|
||||||
let unique_id = generate_unique_type_id("DI_ENUM_");
|
|
||||||
|
|
||||||
let enum_metadata = enum_name.as_slice().with_c_str(|enum_name| {
|
let enum_llvm_type = type_of::type_of(cx, enum_type);
|
||||||
unique_id.as_slice().with_c_str(|unique_id| {
|
let (enum_type_size, enum_type_align) = size_and_align_of(cx, enum_llvm_type);
|
||||||
unsafe {
|
let unique_id = generate_unique_type_id("DI_ENUM_");
|
||||||
llvm::LLVMDIBuilderCreateUnionType(
|
|
||||||
DIB(cx),
|
|
||||||
containing_scope,
|
|
||||||
enum_name,
|
|
||||||
file_metadata,
|
|
||||||
loc.line as c_uint,
|
|
||||||
bytes_to_bits(enum_type_size),
|
|
||||||
bytes_to_bits(enum_type_align),
|
|
||||||
0, // Flags
|
|
||||||
ptr::null(),
|
|
||||||
0, // RuntimeLang
|
|
||||||
unique_id)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
UnfinishedMetadata {
|
let enum_metadata = enum_name.as_slice().with_c_str(|enum_name| {
|
||||||
cache_id: cache_id_for_type(enum_type),
|
unique_id.as_slice().with_c_str(|unique_id| {
|
||||||
metadata_stub: enum_metadata,
|
unsafe {
|
||||||
llvm_type: enum_llvm_type,
|
llvm::LLVMDIBuilderCreateUnionType(
|
||||||
file_metadata: file_metadata,
|
DIB(cx),
|
||||||
member_description_factory: EnumMDF(EnumMemberDescriptionFactory {
|
containing_scope,
|
||||||
type_rep: type_rep.clone(),
|
enum_name,
|
||||||
variants: variants,
|
file_metadata,
|
||||||
discriminant_type_metadata: discriminant_type_metadata,
|
loc.line as c_uint,
|
||||||
containing_scope: containing_scope,
|
bytes_to_bits(enum_type_size),
|
||||||
file_metadata: file_metadata,
|
bytes_to_bits(enum_type_align),
|
||||||
span: span,
|
0, // Flags
|
||||||
}),
|
ptr::null(),
|
||||||
|
0, // RuntimeLang
|
||||||
|
unique_id)
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
adt::RawNullablePointer { nnty, .. } => {
|
});
|
||||||
FinalMetadata(type_metadata(cx, nnty, span))
|
|
||||||
}
|
return UnfinishedMetadata {
|
||||||
adt::StructWrappedNullablePointer { nonnull: ref struct_def, nndiscr, ptrfield, .. } => {
|
cache_id: cache_id_for_type(enum_type),
|
||||||
let (metadata_stub,
|
metadata_stub: enum_metadata,
|
||||||
variant_llvm_type,
|
llvm_type: enum_llvm_type,
|
||||||
member_description_factory) =
|
file_metadata: file_metadata,
|
||||||
describe_enum_variant(cx,
|
member_description_factory: EnumMDF(EnumMemberDescriptionFactory {
|
||||||
struct_def,
|
type_rep: type_rep.clone(),
|
||||||
&**variants.get(nndiscr as uint),
|
variants: variants,
|
||||||
OptimizedDiscriminant(ptrfield),
|
discriminant_type_metadata: discriminant_type_metadata,
|
||||||
containing_scope,
|
containing_scope: containing_scope,
|
||||||
file_metadata,
|
file_metadata: file_metadata,
|
||||||
span);
|
span: span,
|
||||||
UnfinishedMetadata {
|
}),
|
||||||
cache_id: cache_id_for_type(enum_type),
|
|
||||||
metadata_stub: metadata_stub,
|
|
||||||
llvm_type: variant_llvm_type,
|
|
||||||
file_metadata: file_metadata,
|
|
||||||
member_description_factory: member_description_factory
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fn get_enum_discriminant_name(cx: &CrateContext, def_id: ast::DefId) -> token::InternedString {
|
fn get_enum_discriminant_name(cx: &CrateContext, def_id: ast::DefId) -> token::InternedString {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// gdb-check:$2 = {{TheB, x = 0, y = 1229782938247303441}, {TheB, 0, 286331153, 286331153}}
|
// gdb-check:$2 = {{TheB, x = 0, y = 1229782938247303441}, {TheB, 0, 286331153, 286331153}}
|
||||||
|
|
||||||
// gdb-command:print *univariant_ref
|
// gdb-command:print *univariant_ref
|
||||||
// gdb-check:$3 = {4820353753753434}
|
// gdb-check:$3 = {{4820353753753434}}
|
||||||
|
|
||||||
#![allow(unused_variable)]
|
#![allow(unused_variable)]
|
||||||
#![feature(struct_variant)]
|
#![feature(struct_variant)]
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
// gdb-check:$3 = {{Case3, a = 0, b = 22873, c = 22873, d = 22873, e = 22873}, {Case3, a = 0, b = 1499027801, c = 1499027801}, {Case3, a = 0, b = 6438275382588823897}}
|
// gdb-check:$3 = {{Case3, a = 0, b = 22873, c = 22873, d = 22873, e = 22873}, {Case3, a = 0, b = 1499027801, c = 1499027801}, {Case3, a = 0, b = 6438275382588823897}}
|
||||||
|
|
||||||
// gdb-command:print univariant
|
// gdb-command:print univariant
|
||||||
// gdb-check:$4 = {a = -1}
|
// gdb-check:$4 = {{a = -1}}
|
||||||
|
|
||||||
#![feature(struct_variant)]
|
#![feature(struct_variant)]
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
// gdb-check:$3 = {{Case3, 0, 22873, 22873, 22873, 22873}, {Case3, 0, 1499027801, 1499027801}, {Case3, 0, 6438275382588823897}}
|
// gdb-check:$3 = {{Case3, 0, 22873, 22873, 22873, 22873}, {Case3, 0, 1499027801, 1499027801}, {Case3, 0, 6438275382588823897}}
|
||||||
|
|
||||||
// gdb-command:print univariant
|
// gdb-command:print univariant
|
||||||
// gdb-check:$4 = {-1}
|
// gdb-check:$4 = {{-1}}
|
||||||
|
|
||||||
|
|
||||||
// NOTE: This is a copy of the non-generic test case. The `Txx` type parameters have to be
|
// NOTE: This is a copy of the non-generic test case. The `Txx` type parameters have to be
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// gdb-check:$2 = {{TheB, x = 0, y = 1229782938247303441}, {TheB, 0, 286331153, 286331153}}
|
// gdb-check:$2 = {{TheB, x = 0, y = 1229782938247303441}, {TheB, 0, 286331153, 286331153}}
|
||||||
|
|
||||||
// gdb-command:print univariant->val
|
// gdb-command:print univariant->val
|
||||||
// gdb-check:$3 = {-9747455}
|
// gdb-check:$3 = {{-9747455}}
|
||||||
|
|
||||||
#![allow(unused_variable)]
|
#![allow(unused_variable)]
|
||||||
#![feature(struct_variant, managed_boxes)]
|
#![feature(struct_variant, managed_boxes)]
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// ignore-tidy-linelength
|
||||||
// ignore-android: FIXME(#10381)
|
// ignore-android: FIXME(#10381)
|
||||||
|
|
||||||
// compile-flags:-g
|
// compile-flags:-g
|
||||||
|
@ -16,19 +17,19 @@
|
||||||
// gdb-command:finish
|
// gdb-command:finish
|
||||||
|
|
||||||
// gdb-command:print some
|
// gdb-command:print some
|
||||||
// gdb-check:$1 = (u32 *) 0x12345678
|
// gdb-check:$1 = {RUST$ENCODED$ENUM$0$None = {0x12345678}}
|
||||||
|
|
||||||
// gdb-command:print none
|
// gdb-command:print none
|
||||||
// gdb-check:$2 = (u32 *) 0x0
|
// gdb-check:$2 = {RUST$ENCODED$ENUM$0$None = {0x0}}
|
||||||
|
|
||||||
// gdb-command:print full
|
// gdb-command:print full
|
||||||
// gdb-check:$3 = {454545, 0x87654321, 9988}
|
// gdb-check:$3 = {RUST$ENCODED$ENUM$1$Empty = {454545, 0x87654321, 9988}}
|
||||||
|
|
||||||
// gdb-command:print empty->discr
|
// gdb-command:print empty->discr
|
||||||
// gdb-check:$4 = (int *) 0x0
|
// gdb-check:$4 = (int *) 0x0
|
||||||
|
|
||||||
// gdb-command:print droid
|
// gdb-command:print droid
|
||||||
// gdb-check:$5 = {id = 675675, range = 10000001, internals = 0x43218765}
|
// gdb-check:$5 = {RUST$ENCODED$ENUM$2$Void = {id = 675675, range = 10000001, internals = 0x43218765}}
|
||||||
|
|
||||||
// gdb-command:print void_droid->internals
|
// gdb-command:print void_droid->internals
|
||||||
// gdb-check:$6 = (int *) 0x0
|
// gdb-check:$6 = (int *) 0x0
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// ignore-tidy-linelength
|
||||||
// ignore-android: FIXME(#10381)
|
// ignore-android: FIXME(#10381)
|
||||||
|
|
||||||
#![feature(managed_boxes)]
|
#![feature(managed_boxes)]
|
||||||
|
@ -20,53 +21,53 @@
|
||||||
|
|
||||||
// gdb-command:print stack_unique.value
|
// gdb-command:print stack_unique.value
|
||||||
// gdb-check:$1 = 0
|
// gdb-check:$1 = 0
|
||||||
// gdb-command:print stack_unique.next->value
|
// gdb-command:print stack_unique.next.RUST$ENCODED$ENUM$0$Empty.val->value
|
||||||
// gdb-check:$2 = 1
|
// gdb-check:$2 = 1
|
||||||
|
|
||||||
// gdb-command:print unique_unique->value
|
// gdb-command:print unique_unique->value
|
||||||
// gdb-check:$3 = 2
|
// gdb-check:$3 = 2
|
||||||
// gdb-command:print unique_unique->next->value
|
// gdb-command:print unique_unique->next.RUST$ENCODED$ENUM$0$Empty.val->value
|
||||||
// gdb-check:$4 = 3
|
// gdb-check:$4 = 3
|
||||||
|
|
||||||
// gdb-command:print box_unique->val.value
|
// gdb-command:print box_unique->val.value
|
||||||
// gdb-check:$5 = 4
|
// gdb-check:$5 = 4
|
||||||
// gdb-command:print box_unique->val.next->value
|
// gdb-command:print box_unique->val.next.RUST$ENCODED$ENUM$0$Empty.val->value
|
||||||
// gdb-check:$6 = 5
|
// gdb-check:$6 = 5
|
||||||
|
|
||||||
// gdb-command:print vec_unique[0].value
|
// gdb-command:print vec_unique[0].value
|
||||||
// gdb-check:$7 = 6.5
|
// gdb-check:$7 = 6.5
|
||||||
// gdb-command:print vec_unique[0].next->value
|
// gdb-command:print vec_unique[0].next.RUST$ENCODED$ENUM$0$Empty.val->value
|
||||||
// gdb-check:$8 = 7.5
|
// gdb-check:$8 = 7.5
|
||||||
|
|
||||||
// gdb-command:print borrowed_unique->value
|
// gdb-command:print borrowed_unique->value
|
||||||
// gdb-check:$9 = 8.5
|
// gdb-check:$9 = 8.5
|
||||||
// gdb-command:print borrowed_unique->next->value
|
// gdb-command:print borrowed_unique->next.RUST$ENCODED$ENUM$0$Empty.val->value
|
||||||
// gdb-check:$10 = 9.5
|
// gdb-check:$10 = 9.5
|
||||||
|
|
||||||
// MANAGED
|
// MANAGED
|
||||||
// gdb-command:print stack_managed.value
|
// gdb-command:print stack_managed.value
|
||||||
// gdb-check:$11 = 10
|
// gdb-check:$11 = 10
|
||||||
// gdb-command:print stack_managed.next.val->value
|
// gdb-command:print stack_managed.next.RUST$ENCODED$ENUM$0$Empty.val->val.value
|
||||||
// gdb-check:$12 = 11
|
// gdb-check:$12 = 11
|
||||||
|
|
||||||
// gdb-command:print unique_managed->value
|
// gdb-command:print unique_managed->value
|
||||||
// gdb-check:$13 = 12
|
// gdb-check:$13 = 12
|
||||||
// gdb-command:print unique_managed->next.val->value
|
// gdb-command:print unique_managed->next.RUST$ENCODED$ENUM$0$Empty.val->val.value
|
||||||
// gdb-check:$14 = 13
|
// gdb-check:$14 = 13
|
||||||
|
|
||||||
// gdb-command:print box_managed.val->value
|
// gdb-command:print box_managed.val->value
|
||||||
// gdb-check:$15 = 14
|
// gdb-check:$15 = 14
|
||||||
// gdb-command:print box_managed->val->next.val->value
|
// gdb-command:print box_managed->val->next.RUST$ENCODED$ENUM$0$Empty.val->val.value
|
||||||
// gdb-check:$16 = 15
|
// gdb-check:$16 = 15
|
||||||
|
|
||||||
// gdb-command:print vec_managed[0].value
|
// gdb-command:print vec_managed[0].value
|
||||||
// gdb-check:$17 = 16.5
|
// gdb-check:$17 = 16.5
|
||||||
// gdb-command:print vec_managed[0].next.val->value
|
// gdb-command:print vec_managed[0].next.RUST$ENCODED$ENUM$0$Empty.val->val.value
|
||||||
// gdb-check:$18 = 17.5
|
// gdb-check:$18 = 17.5
|
||||||
|
|
||||||
// gdb-command:print borrowed_managed->value
|
// gdb-command:print borrowed_managed->value
|
||||||
// gdb-check:$19 = 18.5
|
// gdb-check:$19 = 18.5
|
||||||
// gdb-command:print borrowed_managed->next.val->value
|
// gdb-command:print borrowed_managed->next.RUST$ENCODED$ENUM$0$Empty.val->val.value
|
||||||
// gdb-check:$20 = 19.5
|
// gdb-check:$20 = 19.5
|
||||||
|
|
||||||
// LONG CYCLE
|
// LONG CYCLE
|
||||||
|
@ -97,7 +98,7 @@
|
||||||
// gdb-command:print (*****long_cycle_w_anonymous_types).value
|
// gdb-command:print (*****long_cycle_w_anonymous_types).value
|
||||||
// gdb-check:$31 = 30
|
// gdb-check:$31 = 30
|
||||||
|
|
||||||
// gdb-command:print (*****((*****long_cycle_w_anonymous_types).next)).value
|
// gdb-command:print (*****((*****long_cycle_w_anonymous_types).next.RUST$ENCODED$ENUM$0$Empty.val)).value
|
||||||
// gdb-check:$32 = 31
|
// gdb-check:$32 = 31
|
||||||
|
|
||||||
// gdb-command:continue
|
// gdb-command:continue
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
// gdb-check:$2 = {{Case2, 0, {x = 286331153, y = 286331153, z = 4369}}, {Case2, 0, 1229782938247303441, 4369}}
|
// gdb-check:$2 = {{Case2, 0, {x = 286331153, y = 286331153, z = 4369}}, {Case2, 0, 1229782938247303441, 4369}}
|
||||||
|
|
||||||
// gdb-command:print univariant
|
// gdb-command:print univariant
|
||||||
// gdb-check:$3 = {{x = 123, y = 456, z = 789}}
|
// gdb-check:$3 = {{{x = 123, y = 456, z = 789}}}
|
||||||
|
|
||||||
#![allow(unused_variable)]
|
#![allow(unused_variable)]
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
// gdb-check:$3 = {{Case3, a = 0, b = 22873, c = 22873, d = 22873, e = 22873}, {Case3, a = 0, b = 1499027801, c = 1499027801}, {Case3, a = 0, b = 6438275382588823897}}
|
// gdb-check:$3 = {{Case3, a = 0, b = 22873, c = 22873, d = 22873, e = 22873}, {Case3, a = 0, b = 1499027801, c = 1499027801}, {Case3, a = 0, b = 6438275382588823897}}
|
||||||
|
|
||||||
// gdb-command:print univariant
|
// gdb-command:print univariant
|
||||||
// gdb-check:$4 = {a = -1}
|
// gdb-check:$4 = {{a = -1}}
|
||||||
|
|
||||||
#![allow(unused_variable)]
|
#![allow(unused_variable)]
|
||||||
#![feature(struct_variant)]
|
#![feature(struct_variant)]
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
// gdb-check:$3 = {{Case3, 0, 22873, 22873, 22873, 22873}, {Case3, 0, 1499027801, 1499027801}, {Case3, 0, 6438275382588823897}}
|
// gdb-check:$3 = {{Case3, 0, 22873, 22873, 22873, 22873}, {Case3, 0, 1499027801, 1499027801}, {Case3, 0, 6438275382588823897}}
|
||||||
|
|
||||||
// gdb-command:print univariant
|
// gdb-command:print univariant
|
||||||
// gdb-check:$4 = {-1}
|
// gdb-check:$4 = {{-1}}
|
||||||
|
|
||||||
#![allow(unused_variable)]
|
#![allow(unused_variable)]
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// gdb-check:$2 = {{TheB, x = 0, y = 1229782938247303441}, {TheB, 0, 286331153, 286331153}}
|
// gdb-check:$2 = {{TheB, x = 0, y = 1229782938247303441}, {TheB, 0, 286331153, 286331153}}
|
||||||
|
|
||||||
// gdb-command:print *univariant
|
// gdb-command:print *univariant
|
||||||
// gdb-check:$3 = {123234}
|
// gdb-check:$3 = {{123234}}
|
||||||
|
|
||||||
#![allow(unused_variable)]
|
#![allow(unused_variable)]
|
||||||
#![feature(struct_variant)]
|
#![feature(struct_variant)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue