GDB (xrefs)
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
variant Struct Reference

#include "gdbtypes.h"

Inheritance diagram for variant:

Public Member Functions

bool is_default () const
 
bool matches (ULONGEST value, bool is_unsigned) const
 

Public Attributes

gdb::array_view< discriminant_rangediscriminants
 
int first_field
 
int last_field
 
gdb::array_view< variant_partparts
 

Detailed Description

A single variant. A variant has a list of discriminant values. When the discriminator matches one of these, the variant is enabled. Each variant controls zero or more fields; and may also control other variant parts as well. This struct corresponds to DW_TAG_variant in DWARF.

Definition at line 223 of file gdbtypes.h.

Member Function Documentation

◆ is_default()

bool variant::is_default ( ) const
inline

Return true if this is the default variant. The default variant can be recognized because it has no associated discriminants.

Definition at line 241 of file gdbtypes.h.

References discriminants.

Referenced by compute_variant_fields_inner(), and print_choices().

◆ matches()

bool variant::matches ( ULONGEST value,
bool is_unsigned ) const

Return true if this variant matches VALUE. IS_UNSIGNED is true if this should be an unsigned comparison; false for signed.

Definition at line 2475 of file gdbtypes.c.

References discriminants.

Referenced by compute_variant_fields_inner().

Member Data Documentation

◆ discriminants

gdb::array_view<discriminant_range> variant::discriminants

The discriminant ranges for this variant.

Definition at line 226 of file gdbtypes.h.

Referenced by create_one_variant(), is_default(), matches(), and print_choices().

◆ first_field

int variant::first_field

The fields controlled by this variant. This is inclusive on the low end and exclusive on the high end. A variant may not control any fields, in which case the two values will be equal. These are indexes into the type's array of fields.

Definition at line 232 of file gdbtypes.h.

Referenced by compute_variant_fields_recurse(), create_one_variant(), handle_variant(), and print_variant_part().

◆ last_field

int variant::last_field

◆ parts

gdb::array_view<variant_part> variant::parts

Variant parts controlled by this variant.

Definition at line 236 of file gdbtypes.h.

Referenced by compute_variant_fields_recurse(), create_one_variant(), and print_variant_part().


The documentation for this struct was generated from the following files: