GDB (API)
Loading...
Searching...
No Matches
Public Attributes | List of all members
main_type Struct Reference

#include "gdbtypes.h"

Public Attributes

__extension__ enum type_code code: 8
 
unsigned int m_flag_unsigned: 1
 
unsigned int m_flag_nosign: 1
 
unsigned int m_flag_stub: 1
 
unsigned int m_flag_target_stub: 1
 
unsigned int m_flag_prototyped: 1
 
unsigned int m_flag_varargs: 1
 
unsigned int m_flag_vector: 1
 
unsigned int m_flag_stub_supported: 1
 
unsigned int m_flag_gnu_ifunc: 1
 
unsigned int m_flag_fixed_instance: 1
 
unsigned int m_flag_objfile_owned: 1
 
unsigned int m_flag_endianity_not_default: 1
 
unsigned int m_flag_declared_class: 1
 
unsigned int m_flag_flag_enum: 1
 
unsigned int m_multi_dimensional: 1
 
__extension__ enum type_specific_kind type_specific_field: 3
 
__extension__ enum language m_lang: LANGUAGE_BITS
 
unsigned int m_nfields
 
const charname
 
union type_owner m_owner
 
struct typem_target_type
 
union { 
 
   struct field *   fields 
 
   struct range_bounds *   bounds 
 
   struct type *   complex_type 
 
flds_bnds 
 
union type_specific type_specific
 
struct dynamic_prop_listdyn_prop_list
 

Detailed Description

Main structure representing a type in GDB.

This structure is space-critical. Its layout has been tweaked to reduce the space used.

Definition at line 814 of file gdbtypes.h.

Member Data Documentation

◆ bounds

struct range_bounds* main_type::bounds

Union member used for range types.

Definition at line 926 of file gdbtypes.h.

◆ code

__extension__ enum type_code main_type::code

Code for kind of type.

Definition at line 818 of file gdbtypes.h.

◆ complex_type

struct type* main_type::complex_type

Definition at line 930 of file gdbtypes.h.

◆ dyn_prop_list

struct dynamic_prop_list* main_type::dyn_prop_list

Contains all dynamic type properties.

Definition at line 940 of file gdbtypes.h.

◆ fields

struct field* main_type::fields

Definition at line 922 of file gdbtypes.h.

◆ [union]

union { ... } main_type::flds_bnds

For structure and union types, a description of each field. For set and pascal array types, there is one "field", whose type is the domain type of the set or array. For range types, there are two "fields", the minimum and maximum values (both inclusive). For enum types, each possible value is described by one "field". For a function or method type, a "field" for each parameter. For C++ classes, there is one field for each base class (if it is a derived class) plus one field for each class data member. Member functions are recorded elsewhere.

Using a pointer to a separate array of fields allows all types to have the same size, which is useful because we can allocate the space for a type before we know what to put in it.

◆ m_flag_declared_class

unsigned int main_type::m_flag_declared_class

True if this type was declared with "class" rather than "struct".

Definition at line 840 of file gdbtypes.h.

◆ m_flag_endianity_not_default

unsigned int main_type::m_flag_endianity_not_default

Definition at line 835 of file gdbtypes.h.

◆ m_flag_fixed_instance

unsigned int main_type::m_flag_fixed_instance

Definition at line 833 of file gdbtypes.h.

◆ m_flag_flag_enum

unsigned int main_type::m_flag_flag_enum

True if this is an enum type with disjoint values. This affects how the enum is printed.

Definition at line 845 of file gdbtypes.h.

◆ m_flag_gnu_ifunc

unsigned int main_type::m_flag_gnu_ifunc

Definition at line 832 of file gdbtypes.h.

◆ m_flag_nosign

unsigned int main_type::m_flag_nosign

Definition at line 825 of file gdbtypes.h.

◆ m_flag_objfile_owned

unsigned int main_type::m_flag_objfile_owned

Definition at line 834 of file gdbtypes.h.

◆ m_flag_prototyped

unsigned int main_type::m_flag_prototyped

Definition at line 828 of file gdbtypes.h.

◆ m_flag_stub

unsigned int main_type::m_flag_stub

Definition at line 826 of file gdbtypes.h.

◆ m_flag_stub_supported

unsigned int main_type::m_flag_stub_supported

Definition at line 831 of file gdbtypes.h.

◆ m_flag_target_stub

unsigned int main_type::m_flag_target_stub

Definition at line 827 of file gdbtypes.h.

◆ m_flag_unsigned

unsigned int main_type::m_flag_unsigned

Flags about this type. These fields appear at this location because they packs nicely here. See the TYPE_* macros for documentation about these fields.

Definition at line 824 of file gdbtypes.h.

◆ m_flag_varargs

unsigned int main_type::m_flag_varargs

Definition at line 829 of file gdbtypes.h.

◆ m_flag_vector

unsigned int main_type::m_flag_vector

Definition at line 830 of file gdbtypes.h.

◆ m_lang

__extension__ enum language main_type::m_lang

Definition at line 863 of file gdbtypes.h.

◆ m_multi_dimensional

unsigned int main_type::m_multi_dimensional

For TYPE_CODE_ARRAY, this is true if this type is part of a multi-dimensional array. Multi-dimensional arrays are represented internally as arrays of arrays, and this flag lets gdb distinguish between multiple dimensions and an ordinary array of arrays. The flag is set on each inner dimension, but not the outermost dimension.

Definition at line 854 of file gdbtypes.h.

◆ m_nfields

unsigned int main_type::m_nfields

Number of fields described for this type. This field appears at this location because it packs nicely here.

Definition at line 868 of file gdbtypes.h.

◆ m_owner

union type_owner main_type::m_owner

Every type is now associated with a particular objfile, and the type is allocated on the objfile_obstack for that objfile. One problem however, is that there are times when gdb allocates new types while it is not in the process of reading symbols from a particular objfile. Fortunately, these happen when the type being created is a derived type of an existing type, such as in lookup_pointer_type(). So we can just allocate the new type using the same objfile as the existing type, but to do this we need a backpointer to the objfile from the existing type. Yes this is somewhat ugly, but without major overhaul of the internal type system, it can't be avoided for now.

Definition at line 890 of file gdbtypes.h.

◆ m_target_type

struct type* main_type::m_target_type

For a pointer type, describes the type of object pointed to.

  • For an array type, describes the type of the elements.
  • For a function or method type, describes the type of the return value.
  • For a range type, describes the type of the full range.
  • For a complex type, describes the type of each coordinate.
  • For a special record or union type encoding a dynamic-sized type in GNAT, a memoized pointer to a corresponding static version of the type.
  • Unused otherwise.

Definition at line 902 of file gdbtypes.h.

◆ name

const char* main_type::name

Name of this type, or NULL if none.

This is used for printing only. For looking up a name, look for a symbol in the VAR_DOMAIN. This is generally allocated in the objfile's obstack. However coffread.c uses malloc.

Definition at line 876 of file gdbtypes.h.

◆ type_specific

union type_specific main_type::type_specific

Slot to point to additional language-specific fields of this type.

Definition at line 937 of file gdbtypes.h.

◆ type_specific_field

__extension__ enum type_specific_kind main_type::type_specific_field

A discriminant telling us which field of the type_specific union is being used for this type, if any.

Definition at line 859 of file gdbtypes.h.


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