GDB (API)

Public Attributes | List of all members
type Struct Reference

`#include "gdbtypes.h"`

## Public Attributes
struct type * | pointer_type
struct type * | reference_type
struct type * | rvalue_reference_type
struct type * | chain
int | instance_flags
unsigned int | length
struct main_type * | main_type

## Detailed Description

A `‘struct type’' describes a particular instance of a type, with some particular qualification.

Definition at line 749 of file gdbtypes.h.

## Member Data Documentation

## ◆ chain

struct type* type::chain

Variant chain. This points to a type that differs from this one only in qualifiers and length. Currently, the possible qualifiers are const, volatile, code-space, data-space, and address class. The length may differ only when one of the address class flags are set. The variants are linked in a circular ring and share MAIN_TYPE.

Definition at line 773 of file gdbtypes.h.

## ◆ instance_flags

int type::instance_flags

Flags specific to this instance of the type, indicating where on the ring we are.

For TYPE_CODE_TYPEDEF the flags of the typedef type should be binary or-ed with the target type, with a special case for address class and space class. For example if this typedef does not specify any new qualifiers, TYPE_INSTANCE_FLAGS is 0 and the instance flags are completely inherited from the target type. No qualifiers can be cleared by the typedef. See also check_typedef.

Definition at line 785 of file gdbtypes.h.

## ◆ length

unsigned int type::length

Length of storage for a value of this type. The value is the expression in host bytes of what sizeof(type) would return. This size includes padding. For example, an i386 extended-precision floating point value really only occupies ten bytes, but most ABI's declare its size to be 12 bytes, to preserve alignment. A ‘struct type’ representing such a floating-point type would have a ‘length’ value of 12, even though the last two bytes are unused.

Since this field is expressed in host bytes, its value is appropriate to pass to memcpy and such (it is assumed that GDB itself always runs on an 8-bits addressable architecture). However, when using it for target address arithmetic (e.g. adding it to a target address), the type_length_units function should be used in order to get the length expressed in target addressable memory units.

Definition at line 803 of file gdbtypes.h.

## ◆ main_type

struct main_type* type::main_type

Core type, shared by a group of qualified types.

Definition at line 807 of file gdbtypes.h.

## ◆ pointer_type

struct type* type::pointer_type

Type that is a pointer to this type. NULL if no such pointer-to type is known yet. The debugger may add the address of such a type if it has to construct one later.

Definition at line 756 of file gdbtypes.h.

## ◆ reference_type

struct type* type::reference_type

C++: also need a reference type.

Definition at line 760 of file gdbtypes.h.

## ◆ rvalue_reference_type

struct type* type::rvalue_reference_type

A C++ rvalue reference type added in C++11.

Definition at line 764 of file gdbtypes.h.

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

- /tmp/gdb-8.1/gdb/gdbtypes.h