class VariantPart
Defined at line 28 of file ../../src/developer/debug/zxdb/symbols/variant_part.h
In DWARF a collection (struct or class) can have part of it that's a variant (basically a tagged
union).
- C++ doesn't use these.
- Rust uses them for its enums which have a single value of a known type (though possibly a
tuple) associated with each enum value. In this case there will be no non-variant parts of the
structure.
VariantParts can have a "discriminant" which is a variable in the structure whose value indicates
which of the variants is currently active. DWARF doesn't require this discriminant but currently
we do since our only case (Rust) generates them.
The discriminant is a DataMember that holds a value. This is one of the "discr_value" values from
the variants and identifies which Variant this VariantPart currently contains.
Public Methods
const LazySymbol & discriminant ()
DataMember whose value indicates which variant is active. Most callers will want only
GetVariant(). The offsets of the data member will be from the structure containing this
VariantPart.
Defined at line 35 of file ../../src/developer/debug/zxdb/symbols/variant_part.h
const std::vector<LazySymbol> & variants ()
All variants described. Most callers will want only GetVariant().
Defined at line 38 of file ../../src/developer/debug/zxdb/symbols/variant_part.h
Friends
class MakeRefCountedHelper
class RefCountedThreadSafe