GDB (API)
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.

◆ 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.

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.

◆ 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.

◆ last_field

int variant::last_field

Definition at line 233 of file gdbtypes.h.

◆ parts

gdb::array_view<variant_part> variant::parts

Variant parts controlled by this variant.

Definition at line 236 of file gdbtypes.h.


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