GDB (xrefs)
Public Attributes | List of all members
type Struct Reference

#include "gdbtypes.h"

Public Attributes

struct typepointer_type
 
struct typereference_type
 
struct typervalue_reference_type
 
struct typechain
 
int instance_flags
 
unsigned int length
 
struct main_typemain_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.

Referenced by make_pointer_type(), make_reference_type(), and replace_type().

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

Referenced by check_typedef().

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

Referenced by ada_printstr(), c_get_string(), c_type_print_base_struct_union(), convert_ast_to_expression(), convert_escape(), convert_ucn(), cp_lookup_transparent_type_loop(), gdbpy_create_lazy_string_object(), gdbpy_extract_lazy_string(), gdbscm_value_to_bytevector(), gdbscm_value_to_lazy_string(), gen_expr(), gen_repeat(), lex_identifier(), lookup_opencl_vector_type(), parse_and_eval_type(), ppscm_print_string_repr(), print_children(), print_go_string(), print_string_repr(), printstr(), read_member_functions(), rust_dump_subexp_body(), rust_language_arch_info(), rust_print_subexp(), rust_printstr(), s390_handle_arg(), safe_parse_type(), validate_arg_format(), valpy_lazy_string(), valpy_string(), value_slice(), and yyparse().

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