GDB (API)
|
#include "hashtab.h"
#include "gdbsupport/array-view.h"
#include "gdbsupport/gdb-hashtab.h"
#include "gdbsupport/gdb_optional.h"
#include "gdbsupport/offset-type.h"
#include "gdbsupport/enum-flags.h"
#include "gdbsupport/underlying.h"
#include "gdbsupport/print-utils.h"
#include "gdbsupport/function-view.h"
#include "dwarf2.h"
#include "gdbsupport/gdb_obstack.h"
#include "gmp-utils.h"
#include "type-codes.def"
Go to the source code of this file.
Classes | |
struct | discriminant_range |
struct | variant |
struct | variant_part |
union | dynamic_prop_data |
struct | dynamic_prop |
struct | dynamic_prop_list |
union | type_owner |
union | field_location |
struct | field |
struct | range_bounds |
union | type_specific |
struct | main_type |
struct | type |
struct | fn_fieldlist |
struct | fn_field |
struct | decl_field |
struct | cplus_struct_type |
struct | rank |
struct | gnat_aux_type |
struct | func_type |
struct | fixed_point_type_info |
struct | builtin_type |
class | type_allocator |
struct | struct_elt |
Typedefs | |
typedef std::vector< rank > | badness_vector |
True if TYPE is known to be an Ada type of some kind.
Definition at line 1848 of file gdbtypes.h.
#define ALLOCATE_CPLUS_STRUCT_TYPE | ( | type | ) | allocate_cplus_struct_type (type) |
Definition at line 1824 of file gdbtypes.h.
#define ALLOCATE_GNAT_AUX_TYPE | ( | type | ) | allocate_gnat_aux_type (type) |
Definition at line 1841 of file gdbtypes.h.
Definition at line 75 of file gdbtypes.h.
Definition at line 74 of file gdbtypes.h.
#define BASETYPE_VIA_PUBLIC | ( | thistype, | |
index ) ((!TYPE_FIELD_PRIVATE(thistype, index)) && (!TYPE_FIELD_PROTECTED(thistype, index))) |
Definition at line 1950 of file gdbtypes.h.
Definition at line 1954 of file gdbtypes.h.
#define CV_CONVERSION_CONST 1 |
Definition at line 2739 of file gdbtypes.h.
#define CV_CONVERSION_VOLATILE 2 |
Definition at line 2740 of file gdbtypes.h.
Definition at line 1826 of file gdbtypes.h.
#define HAVE_GNAT_AUX_INFO | ( | type | ) | (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_GNAT_STUFF) |
A macro that returns non-zero if the type-specific data should be read as "gnat-stuff".
Definition at line 1844 of file gdbtypes.h.
Definition at line 1819 of file gdbtypes.h.
Definition at line 1862 of file gdbtypes.h.
Definition at line 1853 of file gdbtypes.h.
Definition at line 1838 of file gdbtypes.h.
Definition at line 1830 of file gdbtypes.h.
Definition at line 85 of file gdbtypes.h.
#define REFERENCE_CONVERSION_CONST_LVALUE 2 |
Conversion to const lvalue reference.
Definition at line 2732 of file gdbtypes.h.
#define REFERENCE_CONVERSION_RVALUE 1 |
Conversion to rvalue reference.
Definition at line 2730 of file gdbtypes.h.
#define SET_TYPE_FIELD_IGNORE | ( | thistype, | |
n ) B_SET (TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits, (n)) |
Definition at line 1970 of file gdbtypes.h.
#define SET_TYPE_FIELD_PRIVATE | ( | thistype, | |
n ) B_SET (TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits, (n)) |
Definition at line 1966 of file gdbtypes.h.
#define SET_TYPE_FIELD_PROTECTED | ( | thistype, | |
n ) B_SET (TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits, (n)) |
Definition at line 1968 of file gdbtypes.h.
#define SET_TYPE_FIELD_VIRTUAL | ( | thistype, | |
n ) B_SET (TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n)) |
Definition at line 1972 of file gdbtypes.h.
Address class flags. Some environments provide for pointers whose size is different from that of a normal pointer or address types where the bits are interpreted differently than normal addresses. The TYPE_INSTANCE_FLAG_ADDRESS_CLASS_n flags may be used in target specific ways to represent these different types of address classes.
Definition at line 186 of file gdbtypes.h.
Definition at line 188 of file gdbtypes.h.
Definition at line 192 of file gdbtypes.h.
#define TYPE_ALIGN_BITS 8 |
Number of bits allocated for alignment.
Definition at line 945 of file gdbtypes.h.
Definition at line 2215 of file gdbtypes.h.
#define TYPE_ALLOCATED_PROP | ( | thistype | ) | ((thistype)->dyn_prop (DYN_PROP_ALLOCATED)) |
Definition at line 1904 of file gdbtypes.h.
#define TYPE_ASSOCIATED_PROP | ( | thistype | ) | ((thistype)->dyn_prop (DYN_PROP_ASSOCIATED)) |
Definition at line 1906 of file gdbtypes.h.
#define TYPE_ATOMIC | ( | t | ) | ((((t)->instance_flags ()) & TYPE_INSTANCE_FLAG_ATOMIC) != 0) |
Atomic type. If this is set, the corresponding type has an _Atomic modifier.
Definition at line 134 of file gdbtypes.h.
Definition at line 1946 of file gdbtypes.h.
Definition at line 1949 of file gdbtypes.h.
Definition at line 1948 of file gdbtypes.h.
#define TYPE_CALLING_CONVENTION | ( | thistype | ) | TYPE_MAIN_TYPE(thistype)->type_specific.func_stuff->calling_convention |
Definition at line 1943 of file gdbtypes.h.
Definition at line 1870 of file gdbtypes.h.
#define TYPE_CODE_SPACE | ( | t | ) | ((((t)->instance_flags ()) & TYPE_INSTANCE_FLAG_CODE_SPACE) != 0) |
Instruction-space delimited type. This is for Harvard architectures which have separate instruction and data address spaces (and perhaps others).
GDB usually defines a flat address space that is a superset of the architecture's two (or more) address spaces, but this is an extension of the architecture's model.
If TYPE_INSTANCE_FLAG_CODE_SPACE is set, an object of the corresponding type resides in instruction memory, even if its address (in the extended flat address space) does not reflect this.
Similarly, if TYPE_INSTANCE_FLAG_DATA_SPACE is set, then an object of the corresponding type resides in the data memory space, even if this is not indicated by its (flat address space) address.
If neither flag is set, the default space for functions / methods is instruction space, and for data objects is data memory.
Definition at line 173 of file gdbtypes.h.
#define TYPE_CONST | ( | t | ) | ((((t)->instance_flags ()) & TYPE_INSTANCE_FLAG_CONST) != 0) |
Constant type. If this is set, the corresponding type has a const modifier.
Definition at line 117 of file gdbtypes.h.
#define TYPE_CPLUS_CALLING_CONVENTION | ( | thistype | ) | TYPE_MAIN_TYPE(thistype)->type_specific.cplus_stuff->calling_convention |
Definition at line 1938 of file gdbtypes.h.
#define TYPE_CPLUS_DYNAMIC | ( | thistype | ) | TYPE_CPLUS_SPECIFIC (thistype)->is_dynamic |
Definition at line 1952 of file gdbtypes.h.
Definition at line 1933 of file gdbtypes.h.
#define TYPE_DATA_LOCATION | ( | thistype | ) | ((thistype)->dyn_prop (DYN_PROP_DATA_LOCATION)) |
Definition at line 1892 of file gdbtypes.h.
#define TYPE_DATA_LOCATION_ADDR | ( | thistype | ) | (TYPE_DATA_LOCATION (thistype)->const_val ()) |
Definition at line 1896 of file gdbtypes.h.
#define TYPE_DATA_LOCATION_BATON | ( | thistype | ) | TYPE_DATA_LOCATION (thistype)->data.baton |
Definition at line 1894 of file gdbtypes.h.
#define TYPE_DATA_LOCATION_KIND | ( | thistype | ) | (TYPE_DATA_LOCATION (thistype)->kind ()) |
Definition at line 1898 of file gdbtypes.h.
#define TYPE_DATA_SPACE | ( | t | ) | ((((t)->instance_flags ()) & TYPE_INSTANCE_FLAG_DATA_SPACE) != 0) |
Definition at line 176 of file gdbtypes.h.
#define TYPE_DESCRIPTIVE_TYPE | ( | thistype | ) | TYPE_GNAT_SPECIFIC(thistype)->descriptive_type |
Definition at line 1942 of file gdbtypes.h.
#define TYPE_DYNAMIC_LENGTH | ( | thistype | ) | ((thistype)->dyn_prop (DYN_PROP_BYTE_SIZE)) |
Definition at line 1900 of file gdbtypes.h.
A helper macro that returns the name of an error type. If the type has a name, it is used; otherwise, a default is used.
Definition at line 2066 of file gdbtypes.h.
Definition at line 1980 of file gdbtypes.h.
#define TYPE_FIELD_IGNORE_BITS | ( | thistype | ) | TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits |
Definition at line 1962 of file gdbtypes.h.
Definition at line 1974 of file gdbtypes.h.
#define TYPE_FIELD_PRIVATE_BITS | ( | thistype | ) | TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits |
Definition at line 1958 of file gdbtypes.h.
Definition at line 1977 of file gdbtypes.h.
#define TYPE_FIELD_PROTECTED_BITS | ( | thistype | ) | TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits |
Definition at line 1960 of file gdbtypes.h.
Definition at line 1983 of file gdbtypes.h.
#define TYPE_FIELD_VIRTUAL_BITS | ( | thistype | ) | TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits |
Definition at line 1964 of file gdbtypes.h.
#define TYPE_FLOATFORMAT | ( | thistype | ) | TYPE_MAIN_TYPE(thistype)->type_specific.floatformat |
Definition at line 1940 of file gdbtypes.h.
Definition at line 2003 of file gdbtypes.h.
Definition at line 2008 of file gdbtypes.h.
Definition at line 2004 of file gdbtypes.h.
Definition at line 2010 of file gdbtypes.h.
Definition at line 2015 of file gdbtypes.h.
Definition at line 2016 of file gdbtypes.h.
Definition at line 2011 of file gdbtypes.h.
Definition at line 2001 of file gdbtypes.h.
Definition at line 2006 of file gdbtypes.h.
Definition at line 2007 of file gdbtypes.h.
Definition at line 2014 of file gdbtypes.h.
Definition at line 2009 of file gdbtypes.h.
Definition at line 2002 of file gdbtypes.h.
Definition at line 2013 of file gdbtypes.h.
Definition at line 2012 of file gdbtypes.h.
Definition at line 2005 of file gdbtypes.h.
Definition at line 1988 of file gdbtypes.h.
#define TYPE_FN_FIELDLIST1 | ( | thistype, | |
n ) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n].fn_fields |
Definition at line 1989 of file gdbtypes.h.
#define TYPE_FN_FIELDLIST_LENGTH | ( | thistype, | |
n ) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n].length |
Definition at line 1991 of file gdbtypes.h.
Definition at line 1990 of file gdbtypes.h.
#define TYPE_FN_FIELDLISTS | ( | thistype | ) | TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists |
Definition at line 1987 of file gdbtypes.h.
#define TYPE_GNAT_SPECIFIC | ( | thistype | ) | TYPE_MAIN_TYPE(thistype)->type_specific.gnat_stuff |
Definition at line 1941 of file gdbtypes.h.
#define TYPE_HAS_DYNAMIC_LENGTH | ( | t | ) | ((t)->dyn_prop (DYN_PROP_BYTE_SIZE) != nullptr) |
True if this type has a dynamic length.
Definition at line 151 of file gdbtypes.h.
#define TYPE_HAS_VARIANT_PARTS | ( | t | ) | ((t)->dyn_prop (DYN_PROP_VARIANT_PARTS) != nullptr) |
True if this type has variant parts.
Definition at line 147 of file gdbtypes.h.
#define TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1 | TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2) |
Definition at line 190 of file gdbtypes.h.
#define TYPE_IS_ALLOCATABLE | ( | t | ) | ((t)->dyn_prop (DYN_PROP_ALLOCATED) != NULL) |
True if this type is allocatable.
Definition at line 143 of file gdbtypes.h.
Definition at line 2049 of file gdbtypes.h.
#define TYPE_IS_REFERENCE | ( | t | ) | ((t)->code () == TYPE_CODE_REF || (t)->code () == TYPE_CODE_RVALUE_REF) |
True if this type represents either an lvalue or lvalue reference type.
Definition at line 139 of file gdbtypes.h.
Definition at line 1866 of file gdbtypes.h.
#define TYPE_N_BASECLASSES | ( | thistype | ) | TYPE_CPLUS_SPECIFIC(thistype)->n_baseclasses |
Definition at line 1947 of file gdbtypes.h.
#define TYPE_N_TEMPLATE_ARGUMENTS | ( | thistype | ) | TYPE_CPLUS_SPECIFIC (thistype)->n_template_arguments |
Definition at line 1993 of file gdbtypes.h.
#define TYPE_NESTED_TYPES_ARRAY | ( | thistype | ) | TYPE_CPLUS_SPECIFIC (thistype)->nested_types |
Definition at line 2034 of file gdbtypes.h.
#define TYPE_NESTED_TYPES_COUNT | ( | thistype | ) | TYPE_CPLUS_SPECIFIC (thistype)->nested_types_count |
Definition at line 2042 of file gdbtypes.h.
Definition at line 2036 of file gdbtypes.h.
Definition at line 2038 of file gdbtypes.h.
#define TYPE_NESTED_TYPES_FIELD_PRIVATE | ( | thistype, | |
n ) TYPE_NESTED_TYPES_FIELD (thistype, n).is_private |
Definition at line 2046 of file gdbtypes.h.
#define TYPE_NESTED_TYPES_FIELD_PROTECTED | ( | thistype, | |
n ) TYPE_NESTED_TYPES_FIELD (thistype, n).is_protected |
Definition at line 2044 of file gdbtypes.h.
Definition at line 2040 of file gdbtypes.h.
#define TYPE_NFN_FIELDS | ( | thistype | ) | TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields |
Definition at line 1925 of file gdbtypes.h.
#define TYPE_NO_RETURN | ( | thistype | ) | TYPE_MAIN_TYPE(thistype)->type_specific.func_stuff->is_noreturn |
Definition at line 1944 of file gdbtypes.h.
#define TYPE_NOTTEXT | ( | t | ) | (((t)->instance_flags ()) & TYPE_INSTANCE_FLAG_NOTTEXT) |
Not textual. By default, GDB treats all single byte integers as characters (or elements of strings) unless this flag is set.
Definition at line 112 of file gdbtypes.h.
Definition at line 1867 of file gdbtypes.h.
#define TYPE_RANK_PROP | ( | thistype | ) | ((thistype)->dyn_prop (DYN_PROP_RANK)) |
Definition at line 1908 of file gdbtypes.h.
#define TYPE_RAW_ALIGN | ( | thistype | ) | type_raw_align (thistype) |
Return the alignment of the type in target addressable memory units, or 0 if no alignment was specified.
Definition at line 1874 of file gdbtypes.h.
#define TYPE_RAW_CPLUS_SPECIFIC | ( | thistype | ) | TYPE_MAIN_TYPE(thistype)->type_specific.cplus_stuff |
Definition at line 1937 of file gdbtypes.h.
Definition at line 1868 of file gdbtypes.h.
#define TYPE_RESTRICT | ( | t | ) | ((((t)->instance_flags ()) & TYPE_INSTANCE_FLAG_RESTRICT) != 0) |
Restrict type. If this is set, the corresponding type has a restrict modifier.
Definition at line 128 of file gdbtypes.h.
Definition at line 1869 of file gdbtypes.h.
A helper macro that returns the name of a type or "unnamed type" if the type has no name.
Definition at line 2060 of file gdbtypes.h.
#define TYPE_SELF_TYPE | ( | thistype | ) | internal_type_self_type (thistype) |
Definition at line 1913 of file gdbtypes.h.
#define TYPE_SPECIFIC_FIELD | ( | thistype | ) | TYPE_MAIN_TYPE(thistype)->type_specific_field |
Definition at line 1926 of file gdbtypes.h.
#define TYPE_TAIL_CALL_LIST | ( | thistype | ) | TYPE_MAIN_TYPE(thistype)->type_specific.func_stuff->tail_call_list |
Definition at line 1945 of file gdbtypes.h.
#define TYPE_TEMPLATE_ARGUMENT | ( | thistype, | |
n ) TYPE_CPLUS_SPECIFIC (thistype)->template_arguments[n] |
Definition at line 1997 of file gdbtypes.h.
#define TYPE_TEMPLATE_ARGUMENTS | ( | thistype | ) | TYPE_CPLUS_SPECIFIC (thistype)->template_arguments |
Definition at line 1995 of file gdbtypes.h.
Definition at line 2021 of file gdbtypes.h.
#define TYPE_TYPEDEF_FIELD_ARRAY | ( | thistype | ) | TYPE_CPLUS_SPECIFIC (thistype)->typedef_field |
Definition at line 2019 of file gdbtypes.h.
#define TYPE_TYPEDEF_FIELD_COUNT | ( | thistype | ) | TYPE_CPLUS_SPECIFIC (thistype)->typedef_field_count |
Definition at line 2027 of file gdbtypes.h.
Definition at line 2023 of file gdbtypes.h.
Definition at line 2031 of file gdbtypes.h.
Definition at line 2029 of file gdbtypes.h.
Definition at line 2025 of file gdbtypes.h.
#define TYPE_VOLATILE | ( | t | ) | ((((t)->instance_flags ()) & TYPE_INSTANCE_FLAG_VOLATILE) != 0) |
Volatile type. If this is set, the corresponding type has a volatile modifier.
Definition at line 122 of file gdbtypes.h.
#define TYPE_VPTR_BASETYPE | ( | thistype | ) | internal_type_vptr_basetype (thistype) |
Definition at line 1923 of file gdbtypes.h.
#define TYPE_VPTR_FIELDNO | ( | thistype | ) | internal_type_vptr_fieldno (thistype) |
Definition at line 1922 of file gdbtypes.h.
Definition at line 2224 of file gdbtypes.h.
#define VOFFSET_STATIC 1 |
Definition at line 1598 of file gdbtypes.h.
Used for ranking a function for overload resolution.
Definition at line 1760 of file gdbtypes.h.
Enumerator | |
---|---|
PROP_UNDEFINED | |
PROP_CONST | |
PROP_ADDR_OFFSET | |
PROP_LOCEXPR | |
PROP_LOCLIST | |
PROP_VARIANT_PARTS | |
PROP_TYPE | |
PROP_VARIABLE_NAME |
Definition at line 273 of file gdbtypes.h.
Define a type's dynamic property node kind.
Enumerator | |
---|---|
DYN_PROP_DATA_LOCATION | |
DYN_PROP_ALLOCATED | |
DYN_PROP_ASSOCIATED | |
DYN_PROP_BYTE_STRIDE | |
DYN_PROP_VARIANT_PARTS | |
DYN_PROP_RANK | |
DYN_PROP_BYTE_SIZE |
Definition at line 435 of file gdbtypes.h.
Determine which field of the union main_type.fields[x].loc is used.
Enumerator | |
---|---|
FIELD_LOC_KIND_BITPOS | bitpos |
FIELD_LOC_KIND_ENUMVAL | enumval |
FIELD_LOC_KIND_PHYSADDR | physaddr |
FIELD_LOC_KIND_PHYSNAME | physname |
FIELD_LOC_KIND_DWARF_BLOCK | dwarf_block |
Definition at line 479 of file gdbtypes.h.
Different kinds of data types are distinguished by the ‘code’ field.
Enumerator | |
---|---|
TYPE_CODE_UNDEF | Not used; catches errors |
Definition at line 81 of file gdbtypes.h.
Some bits for the type's instance_flags word. See the macros below for documentation on each bit.
Definition at line 94 of file gdbtypes.h.
A discriminant to determine which field in the main_type.type_specific union is being used, if any.
For types such as TYPE_CODE_FLT, the use of this discriminant is really redundant, as we know from the type code which field is going to be used. As such, it would be possible to reduce the size of this enum in order to save a bit or two for other fields of struct main_type. But, since we still have extra room , and for the sake of clarity and consistency, we treat all fields of the union the same way.
Enumerator | |
---|---|
TYPE_SPECIFIC_NONE | |
TYPE_SPECIFIC_CPLUS_STUFF | |
TYPE_SPECIFIC_GNAT_STUFF | |
TYPE_SPECIFIC_FLOATFORMAT | |
TYPE_SPECIFIC_FUNC | |
TYPE_SPECIFIC_SELF_TYPE | |
TYPE_SPECIFIC_INT | |
TYPE_SPECIFIC_FIXED_POINT |
Definition at line 499 of file gdbtypes.h.
|
extern |
|
extern |
|
extern |
struct field * append_composite_type_field_raw | ( | struct type * | t, |
const char * | name, | ||
struct type * | field ) |
|
extern |
|
extern |
Return the type table for the specified architecture.
Return the type table for the specified objfile.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
DEF_ENUM_FLAGS_TYPE | ( | enum | type_instance_flag_value, |
type_instance_flags | ) |
|
extern |
|
extern |
|
extern |
This returns the target type (or NULL) of TYPE, also skipping past typedefs.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Predicate if the type has dynamic values, which are not resolved yet. See the caveat in 'resolve_dynamic_type' to understand a scenario where an apparently-resolved type may still be considered "dynamic".
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Resolve all dynamic values of a type e.g. array bounds to static values. ADDR specifies the location of the variable the type is bound to. If TYPE has no dynamic properties return TYPE; otherwise a new type with static properties is returned.
If FRAME is given, it is used when evaluating dynamic properties. This can be important when a static link is seen. If not given, the selected frame is used.
For an array type, if the element type is dynamic, then that will not be resolved. This is done because each individual element may have a different type when resolved (depending on the contents of memory). In this situation, 'is_dynamic_type' will still return true for the return value of this function.
Set the alignment of the type. The alignment must be a power of
|
extern |
Return the alignment of the type in target addressable memory units. Return 0 if the alignment cannot be determined; but note that this makes an effort to compute the alignment even it it was not specified in the debug info.
|
extern |
When the type includes explicit byte ordering, return that. Otherwise, the byte ordering from gdbarch_byte_order for the type's arch is returned.
Return the alignment of the type in target addressable memory units, or 0 if no alignment was specified.
Badness of converting a derived class pointer to a base class pointer.
|
extern |
The default value of TYPE_CPLUS_SPECIFIC(T) points to this shared static structure.
Badness of cv-conversion. Subrank is a flag describing the conversions being done.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Badness if parameter list length doesn't match arg list length.
Badness of converting a (non-zero) integer constant to a pointer.
Converting a pointer to an int is usually OK.
Badness of converting from non-reference to reference. Subrank is the type of reference conversion being done.
Dummy badness value for nonexistent parameter positions.