Home | History | Annotate | Line # | Download | only in gdb
      1 /* Type codes for GDB.
      2 
      3    Copyright (C) 1992-2024 Free Software Foundation, Inc.
      4 
      5    This file is part of GDB.
      6 
      7    This program is free software; you can redistribute it and/or modify
      8    it under the terms of the GNU General Public License as published by
      9    the Free Software Foundation; either version 3 of the License, or
     10    (at your option) any later version.
     11 
     12    This program is distributed in the hope that it will be useful,
     13    but WITHOUT ANY WARRANTY; without even the implied warranty of
     14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15    GNU General Public License for more details.
     16 
     17    You should have received a copy of the GNU General Public License
     18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
     19 
     20 OP (TYPE_CODE_PTR)		/**< Pointer type */
     21 
     22 /* * Array type with lower & upper bounds.
     23 
     24    Regardless of the language, GDB represents multidimensional
     25    array types the way C does: as arrays of arrays.  So an
     26    instance of a GDB array type T can always be seen as a series
     27    of instances of T->target_type () laid out sequentially in
     28    memory.
     29 
     30    Row-major languages like C lay out multi-dimensional arrays so
     31    that incrementing the rightmost index in a subscripting
     32    expression results in the smallest change in the address of the
     33    element referred to.  Column-major languages like Fortran lay
     34    them out so that incrementing the leftmost index results in the
     35    smallest change.
     36 
     37    This means that, in column-major languages, working our way
     38    from type to target type corresponds to working through indices
     39    from right to left, not left to right.  */
     40 OP (TYPE_CODE_ARRAY)
     41 
     42 OP (TYPE_CODE_STRUCT)		/**< C struct or Pascal record */
     43 OP (TYPE_CODE_UNION)		/**< C union or Pascal variant part */
     44 OP (TYPE_CODE_ENUM)		/**< Enumeration type */
     45 OP (TYPE_CODE_FLAGS)		/**< Bit flags type */
     46 OP (TYPE_CODE_FUNC)		/**< Function type */
     47 OP (TYPE_CODE_INT)		/**< Integer type */
     48 
     49 /* * Floating type.  This is *NOT* a complex type.  */
     50 OP (TYPE_CODE_FLT)
     51 
     52 /* * Void type.  The length field specifies the length (probably
     53    always one) which is used in pointer arithmetic involving
     54    pointers to this type, but actually dereferencing such a
     55    pointer is invalid; a void type has no length and no actual
     56    representation in memory or registers.  A pointer to a void
     57    type is a generic pointer.  */
     58 OP (TYPE_CODE_VOID)
     59 
     60 OP (TYPE_CODE_SET)		/**< Pascal sets */
     61 OP (TYPE_CODE_RANGE)		/**< Range (integers within spec'd bounds).  */
     62 
     63 /* * A string type which is like an array of character but prints
     64    differently.  It does not contain a length field as Pascal
     65    strings (for many Pascals, anyway) do; if we want to deal with
     66    such strings, we should use a new type code.  */
     67 OP (TYPE_CODE_STRING)
     68 
     69 /* * Unknown type.  The length field is valid if we were able to
     70    deduce that much about the type, or 0 if we don't even know
     71    that.  */
     72 OP (TYPE_CODE_ERROR)
     73 
     74 /* C++ */
     75 OP (TYPE_CODE_METHOD)		/**< Method type */
     76 
     77 /* * Pointer-to-member-function type.  This describes how to access a
     78    particular member function of a class (possibly a virtual
     79    member function).  The representation may vary between different
     80    C++ ABIs.  */
     81 OP (TYPE_CODE_METHODPTR)
     82 
     83 /* * Pointer-to-member type.  This is the offset within a class to
     84    some particular data member.  The only currently supported
     85    representation uses an unbiased offset, with -1 representing
     86    NULL; this is used by the Itanium C++ ABI (used by GCC on all
     87    platforms).  */
     88 OP (TYPE_CODE_MEMBERPTR)
     89 
     90 OP (TYPE_CODE_REF)		/**< C++ Reference types */
     91 
     92 OP (TYPE_CODE_RVALUE_REF)	/**< C++ rvalue reference types */
     93 
     94 OP (TYPE_CODE_CHAR)		/**< *real* character type */
     95 
     96 /* * Boolean type.  0 is false, 1 is true, and other values are
     97    non-boolean (e.g. FORTRAN "logical" used as unsigned int).  */
     98 OP (TYPE_CODE_BOOL)
     99 
    100 /* Fortran */
    101 OP (TYPE_CODE_COMPLEX)		/**< Complex float */
    102 
    103 OP (TYPE_CODE_TYPEDEF)
    104 
    105 OP (TYPE_CODE_NAMESPACE)	/**< C++ namespace.  */
    106 
    107 OP (TYPE_CODE_DECFLOAT)		/**< Decimal floating point.  */
    108 
    109 OP (TYPE_CODE_MODULE)		/**< Fortran module.  */
    110 
    111 /* * Internal function type.  */
    112 OP (TYPE_CODE_INTERNAL_FUNCTION)
    113 
    114 /* * Methods implemented in extension languages.  */
    115 OP (TYPE_CODE_XMETHOD)
    116 
    117 /* * Fixed Point type.  */
    118 OP (TYPE_CODE_FIXED_POINT)
    119 
    120 /* * Fortran namelist is a group of variables or arrays that can be
    121    read or written.
    122 
    123    Namelist syntax: NAMELIST / groupname / namelist_items ...
    124    NAMELIST statement assign a group name to a collection of variables
    125    called as namelist items. The namelist items can be of any data type
    126    and can be variables or arrays.
    127 
    128    Compiler emit DW_TAG_namelist for group name and DW_TAG_namelist_item
    129    for each of the namelist items. GDB process these namelist dies
    130    and print namelist variables during print and ptype commands.  */
    131 OP (TYPE_CODE_NAMELIST)
    132