12159047fSniklas /* Definitions and structures for reading debug symbols from the 22159047fSniklas native HP C compiler. 32159047fSniklas 42159047fSniklas Written by the Center for Software Science at the University of Utah 52159047fSniklas and by Cygnus Support. 62159047fSniklas 7*007c2a45Smiod Copyright 1994, 1995, 1998, 1999, 2003 Free Software Foundation, Inc. 82159047fSniklas 92159047fSniklas This program is free software; you can redistribute it and/or modify 102159047fSniklas it under the terms of the GNU General Public License as published by 112159047fSniklas the Free Software Foundation; either version 2 of the License, or 122159047fSniklas (at your option) any later version. 132159047fSniklas 142159047fSniklas This program is distributed in the hope that it will be useful, 152159047fSniklas but WITHOUT ANY WARRANTY; without even the implied warranty of 162159047fSniklas MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 172159047fSniklas GNU General Public License for more details. 182159047fSniklas 192159047fSniklas You should have received a copy of the GNU General Public License 202159047fSniklas along with this program; if not, write to the Free Software 212159047fSniklas Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 222159047fSniklas 232159047fSniklas #ifndef HP_SYMTAB_INCLUDED 242159047fSniklas #define HP_SYMTAB_INCLUDED 252159047fSniklas 262159047fSniklas /* General information: 272159047fSniklas 28f7cc78ecSespie This header file defines and describes only the data structures 29f7cc78ecSespie necessary to read debug symbols produced by the HP C compiler, 30f7cc78ecSespie HP ANSI C++ compiler, and HP FORTRAN 90 compiler using the 31f7cc78ecSespie SOM object file format. 322159047fSniklas (For a full description of the debug format, ftp hpux-symtab.h from 332159047fSniklas jaguar.cs.utah.edu:/dist). 342159047fSniklas 35f7cc78ecSespie Additional notes (Rich Title) 36f7cc78ecSespie This file is a reverse-engineered version of a file called 37f7cc78ecSespie "symtab.h" which exists internal to HP's Computer Languages Organization 38f7cc78ecSespie in /CLO/Components/DDE/obj/som/symtab.h. Because HP's version of 39f7cc78ecSespie the file is copyrighted and not distributed, it is necessary for 40f7cc78ecSespie GDB to use the reverse-engineered version that follows. 41f7cc78ecSespie Work was done by Cygnus to reverse-engineer the C subset of symtab.h. 42f7cc78ecSespie The WDB project has extended this to also contain the C++ 43f7cc78ecSespie symbol definitions, the F90 symbol definitions, 44f7cc78ecSespie and the DOC (debugging-optimized-code) symbol definitions. 45f7cc78ecSespie In some cases (the C++ symbol definitions) 46f7cc78ecSespie I have added internal documentation here that 47f7cc78ecSespie goes beyond what is supplied in HP's symtab.h. If we someday 48f7cc78ecSespie unify these files again, the extra comments should be merged back 49f7cc78ecSespie into HP's symtab.h. 50f7cc78ecSespie 51f7cc78ecSespie ------------------------------------------------------------------- 522159047fSniklas 532159047fSniklas Debug symbols are contained entirely within an unloadable space called 542159047fSniklas $DEBUG$. $DEBUG$ contains several subspaces which group related 552159047fSniklas debug symbols. 562159047fSniklas 572159047fSniklas $GNTT$ contains information for global variables, types and contants. 582159047fSniklas 592159047fSniklas $LNTT$ contains information for procedures (including nesting), scoping 602159047fSniklas information, local variables, types, and constants. 612159047fSniklas 622159047fSniklas $SLT$ contains source line information so that code addresses may be 632159047fSniklas mapped to source lines. 642159047fSniklas 652159047fSniklas $VT$ contains various strings and constants for named objects (variables, 662159047fSniklas typedefs, functions, etc). Strings are stored as null-terminated character 672159047fSniklas lists. Constants always begin on word boundaries. The first byte of 682159047fSniklas the VT must be zero (a null string). 692159047fSniklas 702159047fSniklas $XT$ is not currently used by GDB. 712159047fSniklas 722159047fSniklas Many structures within the subspaces point to other structures within 732159047fSniklas the same subspace, or to structures within a different subspace. These 742159047fSniklas pointers are represented as a structure index from the beginning of 752159047fSniklas the appropriate subspace. */ 762159047fSniklas 772159047fSniklas /* Used to describe where a constant is stored. */ 782159047fSniklas enum location_type 792159047fSniklas { 802159047fSniklas LOCATION_IMMEDIATE, 812159047fSniklas LOCATION_PTR, 822159047fSniklas LOCATION_VT, 832159047fSniklas }; 842159047fSniklas 852159047fSniklas /* Languages supported by this debug format. Within the data structures 862159047fSniklas this type is limited to 4 bits for a maximum of 16 languages. */ 872159047fSniklas enum hp_language 882159047fSniklas { 892159047fSniklas HP_LANGUAGE_UNKNOWN, 902159047fSniklas HP_LANGUAGE_C, 91f7cc78ecSespie HP_LANGUAGE_FORTRAN, 92f7cc78ecSespie HP_LANGUAGE_F77 = HP_LANGUAGE_FORTRAN, 932159047fSniklas HP_LANGUAGE_PASCAL, 94f7cc78ecSespie HP_LANGUAGE_MODCAL, 952159047fSniklas HP_LANGUAGE_COBOL, 962159047fSniklas HP_LANGUAGE_BASIC, 972159047fSniklas HP_LANGUAGE_ADA, 982159047fSniklas HP_LANGUAGE_CPLUSPLUS, 99f7cc78ecSespie HP_LANGUAGE_DMPASCAL 1002159047fSniklas }; 1012159047fSniklas 1022159047fSniklas 1032159047fSniklas /* Basic data types available in this debug format. Within the data 1042159047fSniklas structures this type is limited to 5 bits for a maximum of 32 basic 1052159047fSniklas data types. */ 1062159047fSniklas enum hp_type 1072159047fSniklas { 108f7cc78ecSespie HP_TYPE_UNDEFINED, /* 0 */ 109f7cc78ecSespie HP_TYPE_BOOLEAN, /* 1 */ 110f7cc78ecSespie HP_TYPE_CHAR, /* 2 */ 111f7cc78ecSespie HP_TYPE_INT, /* 3 */ 112f7cc78ecSespie HP_TYPE_UNSIGNED_INT, /* 4 */ 113f7cc78ecSespie HP_TYPE_REAL, /* 5 */ 114f7cc78ecSespie HP_TYPE_COMPLEX, /* 6 */ 115f7cc78ecSespie HP_TYPE_STRING200, /* 7 */ 116f7cc78ecSespie HP_TYPE_LONGSTRING200, /* 8 */ 117f7cc78ecSespie HP_TYPE_TEXT, /* 9 */ 118f7cc78ecSespie HP_TYPE_FLABEL, /* 10 */ 119f7cc78ecSespie HP_TYPE_FTN_STRING_SPEC, /* 11 */ 120f7cc78ecSespie HP_TYPE_MOD_STRING_SPEC, /* 12 */ 121f7cc78ecSespie HP_TYPE_PACKED_DECIMAL, /* 13 */ 122f7cc78ecSespie HP_TYPE_REAL_3000, /* 14 */ 123f7cc78ecSespie HP_TYPE_MOD_STRING_3000, /* 15 */ 124f7cc78ecSespie HP_TYPE_ANYPOINTER, /* 16 */ 125f7cc78ecSespie HP_TYPE_GLOBAL_ANYPOINTER, /* 17 */ 126f7cc78ecSespie HP_TYPE_LOCAL_ANYPOINTER, /* 18 */ 127f7cc78ecSespie HP_TYPE_COMPLEXS3000, /* 19 */ 128f7cc78ecSespie HP_TYPE_FTN_STRING_S300_COMPAT, /* 20 */ 129f7cc78ecSespie HP_TYPE_FTN_STRING_VAX_COMPAT, /* 21 */ 130f7cc78ecSespie HP_TYPE_BOOLEAN_S300_COMPAT, /* 22 */ 131f7cc78ecSespie HP_TYPE_BOOLEAN_VAX_COMPAT, /* 23 */ 132f7cc78ecSespie HP_TYPE_WIDE_CHAR, /* 24 */ 133f7cc78ecSespie HP_TYPE_LONG, /* 25 */ 134f7cc78ecSespie HP_TYPE_UNSIGNED_LONG, /* 26 */ 135f7cc78ecSespie HP_TYPE_DOUBLE, /* 27 */ 136f7cc78ecSespie HP_TYPE_TEMPLATE_ARG, /* 28 */ 137f7cc78ecSespie HP_TYPE_VOID /* 29 */ 1382159047fSniklas }; 1392159047fSniklas 1402159047fSniklas /* An immediate name and type table entry. 1412159047fSniklas 1422159047fSniklas extension and immediate will always be one. 1432159047fSniklas global will always be zero. 1442159047fSniklas hp_type is the basic type this entry describes. 1452159047fSniklas bitlength is the length in bits for the basic type. */ 1462159047fSniklas struct dnttp_immediate 1472159047fSniklas { 1482159047fSniklas unsigned int extension: 1; 1492159047fSniklas unsigned int immediate: 1; 1502159047fSniklas unsigned int global: 1; 1512159047fSniklas unsigned int type: 5; 1522159047fSniklas unsigned int bitlength: 24; 1532159047fSniklas }; 1542159047fSniklas 1552159047fSniklas /* A nonimmediate name and type table entry. 1562159047fSniklas 1572159047fSniklas extension will always be one. 1582159047fSniklas immediate will always be zero. 1592159047fSniklas if global is zero, this entry points into the LNTT 1602159047fSniklas if global is one, this entry points into the GNTT 1612159047fSniklas index is the index within the GNTT or LNTT for this entry. */ 1622159047fSniklas struct dnttp_nonimmediate 1632159047fSniklas { 1642159047fSniklas unsigned int extension: 1; 1652159047fSniklas unsigned int immediate: 1; 1662159047fSniklas unsigned int global: 1; 1672159047fSniklas unsigned int index: 29; 1682159047fSniklas }; 1692159047fSniklas 1702159047fSniklas /* A pointer to an entry in the GNTT and LNTT tables. It has two 1712159047fSniklas forms depending on the type being described. 1722159047fSniklas 1732159047fSniklas The immediate form is used for simple entries and is one 1742159047fSniklas word. 1752159047fSniklas 1762159047fSniklas The nonimmediate form is used for complex entries and contains 1772159047fSniklas an index into the LNTT or GNTT which describes the entire type. 1782159047fSniklas 1792159047fSniklas If a dnttpointer is -1, then it is a NIL entry. */ 1802159047fSniklas 1812159047fSniklas #define DNTTNIL (-1) 1822159047fSniklas typedef union dnttpointer 1832159047fSniklas { 1842159047fSniklas struct dnttp_immediate dntti; 1852159047fSniklas struct dnttp_nonimmediate dnttp; 1862159047fSniklas int word; 1872159047fSniklas } dnttpointer; 1882159047fSniklas 1892159047fSniklas /* An index into the source line table. As with dnttpointers, a sltpointer 1902159047fSniklas of -1 indicates a NIL entry. */ 1912159047fSniklas #define SLTNIL (-1) 1922159047fSniklas typedef int sltpointer; 1932159047fSniklas 194*007c2a45Smiod /* Index into DOC (= "Debugging Optimized Code") line table. */ 195f7cc78ecSespie #define LTNIL (-1) 196f7cc78ecSespie typedef int ltpointer; 197f7cc78ecSespie 198*007c2a45Smiod /* Index into context table. */ 199f7cc78ecSespie #define CTXTNIL (-1) 200f7cc78ecSespie typedef int ctxtpointer; 201f7cc78ecSespie 2022159047fSniklas /* Unsigned byte offset into the VT. */ 2032159047fSniklas typedef unsigned int vtpointer; 2042159047fSniklas 2052159047fSniklas /* A DNTT entry (used within the GNTT and LNTT). 2062159047fSniklas 2072159047fSniklas DNTT entries are variable sized objects, but are always a multiple 2082159047fSniklas of 3 words (we call each group of 3 words a "block"). 2092159047fSniklas 2102159047fSniklas The first bit in each block is an extension bit. This bit is zero 2112159047fSniklas for the first block of a DNTT entry. If the entry requires more 2122159047fSniklas than one block, then this bit is set to one in all blocks after 2132159047fSniklas the first one. */ 2142159047fSniklas 2152159047fSniklas /* Each DNTT entry describes a particular debug symbol (beginning of 2162159047fSniklas a source file, a function, variables, structures, etc. 2172159047fSniklas 2182159047fSniklas The type of the DNTT entry is stored in the "kind" field within the 2192159047fSniklas DNTT entry itself. */ 2202159047fSniklas 2212159047fSniklas enum dntt_entry_type 2222159047fSniklas { 2232159047fSniklas DNTT_TYPE_NIL = -1, 2242159047fSniklas DNTT_TYPE_SRCFILE, 2252159047fSniklas DNTT_TYPE_MODULE, 2262159047fSniklas DNTT_TYPE_FUNCTION, 2272159047fSniklas DNTT_TYPE_ENTRY, 2282159047fSniklas DNTT_TYPE_BEGIN, 2292159047fSniklas DNTT_TYPE_END, 2302159047fSniklas DNTT_TYPE_IMPORT, 2312159047fSniklas DNTT_TYPE_LABEL, 2322159047fSniklas DNTT_TYPE_FPARAM, 2332159047fSniklas DNTT_TYPE_SVAR, 2342159047fSniklas DNTT_TYPE_DVAR, 2352159047fSniklas DNTT_TYPE_HOLE1, 2362159047fSniklas DNTT_TYPE_CONST, 2372159047fSniklas DNTT_TYPE_TYPEDEF, 2382159047fSniklas DNTT_TYPE_TAGDEF, 2392159047fSniklas DNTT_TYPE_POINTER, 2402159047fSniklas DNTT_TYPE_ENUM, 2412159047fSniklas DNTT_TYPE_MEMENUM, 2422159047fSniklas DNTT_TYPE_SET, 2432159047fSniklas DNTT_TYPE_SUBRANGE, 2442159047fSniklas DNTT_TYPE_ARRAY, 2452159047fSniklas DNTT_TYPE_STRUCT, 2462159047fSniklas DNTT_TYPE_UNION, 2472159047fSniklas DNTT_TYPE_FIELD, 2482159047fSniklas DNTT_TYPE_VARIANT, 2492159047fSniklas DNTT_TYPE_FILE, 2502159047fSniklas DNTT_TYPE_FUNCTYPE, 2512159047fSniklas DNTT_TYPE_WITH, 2522159047fSniklas DNTT_TYPE_COMMON, 2532159047fSniklas DNTT_TYPE_COBSTRUCT, 2542159047fSniklas DNTT_TYPE_XREF, 2552159047fSniklas DNTT_TYPE_SA, 2562159047fSniklas DNTT_TYPE_MACRO, 2572159047fSniklas DNTT_TYPE_BLOCKDATA, 2582159047fSniklas DNTT_TYPE_CLASS_SCOPE, 2592159047fSniklas DNTT_TYPE_REFERENCE, 2602159047fSniklas DNTT_TYPE_PTRMEM, 2612159047fSniklas DNTT_TYPE_PTRMEMFUNC, 2622159047fSniklas DNTT_TYPE_CLASS, 2632159047fSniklas DNTT_TYPE_GENFIELD, 2642159047fSniklas DNTT_TYPE_VFUNC, 2652159047fSniklas DNTT_TYPE_MEMACCESS, 2662159047fSniklas DNTT_TYPE_INHERITANCE, 2672159047fSniklas DNTT_TYPE_FRIEND_CLASS, 2682159047fSniklas DNTT_TYPE_FRIEND_FUNC, 2692159047fSniklas DNTT_TYPE_MODIFIER, 2702159047fSniklas DNTT_TYPE_OBJECT_ID, 2712159047fSniklas DNTT_TYPE_MEMFUNC, 2722159047fSniklas DNTT_TYPE_TEMPLATE, 2732159047fSniklas DNTT_TYPE_TEMPLATE_ARG, 2742159047fSniklas DNTT_TYPE_FUNC_TEMPLATE, 2752159047fSniklas DNTT_TYPE_LINK, 276f7cc78ecSespie DNTT_TYPE_DYN_ARRAY_DESC, 277f7cc78ecSespie DNTT_TYPE_DESC_SUBRANGE, 278f7cc78ecSespie DNTT_TYPE_BEGIN_EXT, 279f7cc78ecSespie DNTT_TYPE_INLN, 280f7cc78ecSespie DNTT_TYPE_INLN_LIST, 281f7cc78ecSespie DNTT_TYPE_ALIAS, 282f7cc78ecSespie DNTT_TYPE_DOC_FUNCTION, 283f7cc78ecSespie DNTT_TYPE_DOC_MEMFUNC, 284f7cc78ecSespie DNTT_TYPE_MAX 2852159047fSniklas }; 2862159047fSniklas 2872159047fSniklas /* DNTT_TYPE_SRCFILE: 2882159047fSniklas 2892159047fSniklas One DNTT_TYPE_SRCFILE symbol is output for the start of each source 2902159047fSniklas file and at the begin and end of an included file. A DNTT_TYPE_SRCFILE 2912159047fSniklas entry is also output before each DNTT_TYPE_FUNC symbol so that debuggers 2922159047fSniklas can determine what file a function was defined in. 2932159047fSniklas 2942159047fSniklas LANGUAGE describes the source file's language. 2952159047fSniklas 2962159047fSniklas NAME points to an VT entry providing the source file's name. 2972159047fSniklas 2982159047fSniklas Note the name used for DNTT_TYPE_SRCFILE entries are exactly as seen 2992159047fSniklas by the compiler (ie they may be relative or absolute). C include files 3002159047fSniklas via <> inclusion must use absolute paths. 3012159047fSniklas 3022159047fSniklas ADDRESS points to an SLT entry from which line number and code locations 3032159047fSniklas may be determined. */ 3042159047fSniklas 3052159047fSniklas struct dntt_type_srcfile 3062159047fSniklas { 3072159047fSniklas unsigned int extension: 1; 308f7cc78ecSespie unsigned int kind: 10; /* DNTT_TYPE_SRCFILE */ 3092159047fSniklas unsigned int language: 4; 3102159047fSniklas unsigned int unused: 17; 3112159047fSniklas vtpointer name; 3122159047fSniklas sltpointer address; 3132159047fSniklas }; 3142159047fSniklas 3152159047fSniklas /* DNTT_TYPE_MODULE: 3162159047fSniklas 3172159047fSniklas A DNTT_TYPE_MODULE symbol is emitted for the start of a pascal 318f7cc78ecSespie module or C source file. A module indicates a compilation unit 319f7cc78ecSespie for name-scoping purposes; in that regard there should be 320f7cc78ecSespie a 1-1 correspondence between GDB "symtab"'s and MODULE symbol records. 3212159047fSniklas 3222159047fSniklas Each DNTT_TYPE_MODULE must have an associated DNTT_TYPE_END symbol. 3232159047fSniklas 3242159047fSniklas NAME points to a VT entry providing the module's name. Note C 3252159047fSniklas source files are considered nameless modules. 3262159047fSniklas 3272159047fSniklas ALIAS point to a VT entry providing a secondary name. 3282159047fSniklas 3292159047fSniklas ADDRESS points to an SLT entry from which line number and code locations 3302159047fSniklas may be determined. */ 3312159047fSniklas 3322159047fSniklas struct dntt_type_module 3332159047fSniklas { 3342159047fSniklas unsigned int extension: 1; 335f7cc78ecSespie unsigned int kind: 10; /* DNTT_TYPE_MODULE */ 3362159047fSniklas unsigned int unused: 21; 3372159047fSniklas vtpointer name; 3382159047fSniklas vtpointer alias; 3392159047fSniklas dnttpointer unused2; 3402159047fSniklas sltpointer address; 3412159047fSniklas }; 3422159047fSniklas 343f7cc78ecSespie /* DNTT_TYPE_FUNCTION, 344f7cc78ecSespie DNTT_TYPE_ENTRY, 345f7cc78ecSespie DNTT_TYPE_BLOCKDATA, 346f7cc78ecSespie DNTT_TYPE_MEMFUNC: 3472159047fSniklas 3482159047fSniklas A DNTT_TYPE_FUNCTION symbol is emitted for each function definition; 3492159047fSniklas a DNTT_TYPE_ENTRY symbols is used for secondary entry points. Both 3502159047fSniklas symbols used the dntt_type_function structure. 351f7cc78ecSespie A DNTT_TYPE_BLOCKDATA symbol is emitted ...? 352f7cc78ecSespie A DNTT_TYPE_MEMFUNC symbol is emitted for inlined member functions (C++). 3532159047fSniklas 354f7cc78ecSespie Each of DNTT_TYPE_FUNCTION must have a matching DNTT_TYPE_END. 3552159047fSniklas 3562159047fSniklas GLOBAL is nonzero if the function has global scope. 3572159047fSniklas 3582159047fSniklas LANGUAGE describes the function's source language. 3592159047fSniklas 3602159047fSniklas OPT_LEVEL describes the optimization level the function was compiled 3612159047fSniklas with. 3622159047fSniklas 3632159047fSniklas VARARGS is nonzero if the function uses varargs. 3642159047fSniklas 3652159047fSniklas NAME points to a VT entry providing the function's name. 3662159047fSniklas 3672159047fSniklas ALIAS points to a VT entry providing a secondary name for the function. 3682159047fSniklas 3692159047fSniklas FIRSTPARAM points to a LNTT entry which describes the parameter list. 3702159047fSniklas 3712159047fSniklas ADDRESS points to an SLT entry from which line number and code locations 3722159047fSniklas may be determined. 3732159047fSniklas 374*007c2a45Smiod ENTRYADDR is the memory address corresponding the function's entry point 3752159047fSniklas 3762159047fSniklas RETVAL points to a LNTT entry describing the function's return value. 3772159047fSniklas 3782159047fSniklas LOWADDR is the lowest memory address associated with this function. 3792159047fSniklas 3802159047fSniklas HIADDR is the highest memory address associated with this function. */ 3812159047fSniklas 3822159047fSniklas struct dntt_type_function 3832159047fSniklas { 3842159047fSniklas unsigned int extension: 1; 385f7cc78ecSespie unsigned int kind: 10; /* DNTT_TYPE_FUNCTION, 386f7cc78ecSespie DNTT_TYPE_ENTRY, 387f7cc78ecSespie DNTT_TYPE_BLOCKDATA 388f7cc78ecSespie or DNTT_TYPE_MEMFUNC */ 3892159047fSniklas unsigned int global: 1; 3902159047fSniklas unsigned int language: 4; 3912159047fSniklas unsigned int nest_level: 5; 3922159047fSniklas unsigned int opt_level: 2; 3932159047fSniklas unsigned int varargs: 1; 3942159047fSniklas unsigned int lang_info: 4; 3952159047fSniklas unsigned int inlined: 1; 3962159047fSniklas unsigned int localalloc: 1; 3972159047fSniklas unsigned int expansion: 1; 3982159047fSniklas unsigned int unused: 1; 3992159047fSniklas vtpointer name; 4002159047fSniklas vtpointer alias; 4012159047fSniklas dnttpointer firstparam; 4022159047fSniklas sltpointer address; 4032159047fSniklas CORE_ADDR entryaddr; 4042159047fSniklas dnttpointer retval; 4052159047fSniklas CORE_ADDR lowaddr; 4062159047fSniklas CORE_ADDR hiaddr; 4072159047fSniklas }; 4082159047fSniklas 4092159047fSniklas /* DNTT_TYPE_BEGIN: 4102159047fSniklas 4112159047fSniklas A DNTT_TYPE_BEGIN symbol is emitted to begin a new nested scope. 4122159047fSniklas Every DNTT_TYPE_BEGIN symbol must have a matching DNTT_TYPE_END symbol. 4132159047fSniklas 4142159047fSniklas CLASSFLAG is nonzero if this is the beginning of a c++ class definition. 4152159047fSniklas 4162159047fSniklas ADDRESS points to an SLT entry from which line number and code locations 4172159047fSniklas may be determined. */ 4182159047fSniklas 4192159047fSniklas struct dntt_type_begin 4202159047fSniklas { 4212159047fSniklas unsigned int extension: 1; 4222159047fSniklas unsigned int kind: 10; 4232159047fSniklas unsigned int classflag: 1; 4242159047fSniklas unsigned int unused: 20; 4252159047fSniklas sltpointer address; 4262159047fSniklas }; 4272159047fSniklas 4282159047fSniklas /* DNTT_TYPE_END: 4292159047fSniklas 4302159047fSniklas A DNTT_TYPE_END symbol is emitted when closing a scope started by 431f7cc78ecSespie a DNTT_TYPE_MODULE, DNTT_TYPE_FUNCTION, DNTT_TYPE_WITH, 432f7cc78ecSespie DNTT_TYPE_COMMON, DNTT_TYPE_BEGIN, and DNTT_TYPE_CLASS_SCOPE symbols. 4332159047fSniklas 4342159047fSniklas ENDKIND describes what type of scope the DNTT_TYPE_END is closing 435f7cc78ecSespie (one of the above 6 kinds). 4362159047fSniklas 4372159047fSniklas CLASSFLAG is nonzero if this is the end of a c++ class definition. 4382159047fSniklas 4392159047fSniklas ADDRESS points to an SLT entry from which line number and code locations 4402159047fSniklas may be determined. 4412159047fSniklas 4422159047fSniklas BEGINSCOPE points to the LNTT entry which opened the scope. */ 4432159047fSniklas 4442159047fSniklas struct dntt_type_end 4452159047fSniklas { 4462159047fSniklas unsigned int extension: 1; 4472159047fSniklas unsigned int kind: 10; 4482159047fSniklas unsigned int endkind: 10; 4492159047fSniklas unsigned int classflag: 1; 4502159047fSniklas unsigned int unused: 10; 4512159047fSniklas sltpointer address; 4522159047fSniklas dnttpointer beginscope; 4532159047fSniklas }; 4542159047fSniklas 4552159047fSniklas /* DNTT_TYPE_IMPORT is unused by GDB. */ 4562159047fSniklas /* DNTT_TYPE_LABEL is unused by GDB. */ 4572159047fSniklas 4582159047fSniklas /* DNTT_TYPE_FPARAM: 4592159047fSniklas 4602159047fSniklas A DNTT_TYPE_FPARAM symbol is emitted for a function argument. When 4612159047fSniklas chained together the symbols represent an argument list for a function. 4622159047fSniklas 4632159047fSniklas REGPARAM is nonzero if this parameter was passed in a register. 4642159047fSniklas 4652159047fSniklas INDIRECT is nonzero if this parameter is a pointer to the parameter 4662159047fSniklas (pass by reference or pass by value for large items). 4672159047fSniklas 4682159047fSniklas LONGADDR is nonzero if the parameter is a 64bit pointer. 4692159047fSniklas 4702159047fSniklas NAME is a pointer into the VT for the parameter's name. 4712159047fSniklas 4722159047fSniklas LOCATION describes where the parameter is stored. Depending on the 4732159047fSniklas parameter type LOCATION could be a register number, or an offset 4742159047fSniklas from the stack pointer. 4752159047fSniklas 4762159047fSniklas TYPE points to a NTT entry describing the type of this parameter. 4772159047fSniklas 4782159047fSniklas NEXTPARAM points to the LNTT entry describing the next parameter. */ 4792159047fSniklas 4802159047fSniklas struct dntt_type_fparam 4812159047fSniklas { 4822159047fSniklas unsigned int extension: 1; 4832159047fSniklas unsigned int kind: 10; 4842159047fSniklas unsigned int regparam: 1; 4852159047fSniklas unsigned int indirect: 1; 4862159047fSniklas unsigned int longaddr: 1; 4872159047fSniklas unsigned int copyparam: 1; 4882159047fSniklas unsigned int dflt: 1; 489f7cc78ecSespie unsigned int doc_ranges: 1; 490f7cc78ecSespie unsigned int misc_kind: 1; 491f7cc78ecSespie unsigned int unused: 14; 4922159047fSniklas vtpointer name; 493f7cc78ecSespie CORE_ADDR location; 4942159047fSniklas dnttpointer type; 4952159047fSniklas dnttpointer nextparam; 4962159047fSniklas int misc; 4972159047fSniklas }; 4982159047fSniklas 4992159047fSniklas /* DNTT_TYPE_SVAR: 5002159047fSniklas 5012159047fSniklas A DNTT_TYPE_SVAR is emitted to describe a variable in static storage. 5022159047fSniklas 5032159047fSniklas GLOBAL is nonzero if the variable has global scope. 5042159047fSniklas 5052159047fSniklas INDIRECT is nonzero if the variable is a pointer to an object. 5062159047fSniklas 5072159047fSniklas LONGADDR is nonzero if the variable is in long pointer space. 5082159047fSniklas 5092159047fSniklas STATICMEM is nonzero if the variable is a member of a class. 5102159047fSniklas 5112159047fSniklas A_UNION is nonzero if the variable is an anonymous union member. 5122159047fSniklas 5132159047fSniklas NAME is a pointer into the VT for the variable's name. 5142159047fSniklas 5152159047fSniklas LOCATION provides the memory address for the variable. 5162159047fSniklas 5172159047fSniklas TYPE is a pointer into either the GNTT or LNTT which describes 5182159047fSniklas the type of this variable. */ 5192159047fSniklas 5202159047fSniklas struct dntt_type_svar 5212159047fSniklas { 5222159047fSniklas unsigned int extension: 1; 5232159047fSniklas unsigned int kind: 10; 5242159047fSniklas unsigned int global: 1; 5252159047fSniklas unsigned int indirect: 1; 5262159047fSniklas unsigned int longaddr: 1; 5272159047fSniklas unsigned int staticmem: 1; 5282159047fSniklas unsigned int a_union: 1; 529f7cc78ecSespie unsigned int unused1: 1; 530f7cc78ecSespie unsigned int thread_specific: 1; 531f7cc78ecSespie unsigned int unused2: 14; 5322159047fSniklas vtpointer name; 5332159047fSniklas CORE_ADDR location; 5342159047fSniklas dnttpointer type; 5352159047fSniklas unsigned int offset; 5362159047fSniklas unsigned int displacement; 5372159047fSniklas }; 5382159047fSniklas 5392159047fSniklas /* DNTT_TYPE_DVAR: 5402159047fSniklas 5412159047fSniklas A DNTT_TYPE_DVAR is emitted to describe automatic variables and variables 5422159047fSniklas held in registers. 5432159047fSniklas 5442159047fSniklas GLOBAL is nonzero if the variable has global scope. 5452159047fSniklas 5462159047fSniklas INDIRECT is nonzero if the variable is a pointer to an object. 5472159047fSniklas 5482159047fSniklas REGVAR is nonzero if the variable is in a register. 5492159047fSniklas 5502159047fSniklas A_UNION is nonzero if the variable is an anonymous union member. 5512159047fSniklas 5522159047fSniklas NAME is a pointer into the VT for the variable's name. 5532159047fSniklas 5542159047fSniklas LOCATION provides the memory address or register number for the variable. 5552159047fSniklas 5562159047fSniklas TYPE is a pointer into either the GNTT or LNTT which describes 5572159047fSniklas the type of this variable. */ 5582159047fSniklas 5592159047fSniklas struct dntt_type_dvar 5602159047fSniklas { 5612159047fSniklas unsigned int extension: 1; 5622159047fSniklas unsigned int kind: 10; 5632159047fSniklas unsigned int global: 1; 5642159047fSniklas unsigned int indirect: 1; 5652159047fSniklas unsigned int regvar: 1; 5662159047fSniklas unsigned int a_union: 1; 5672159047fSniklas unsigned int unused: 17; 5682159047fSniklas vtpointer name; 5692159047fSniklas int location; 5702159047fSniklas dnttpointer type; 5712159047fSniklas unsigned int offset; 5722159047fSniklas }; 5732159047fSniklas 5742159047fSniklas /* DNTT_TYPE_CONST: 5752159047fSniklas 5762159047fSniklas A DNTT_TYPE_CONST symbol is emitted for program constants. 5772159047fSniklas 5782159047fSniklas GLOBAL is nonzero if the constant has global scope. 5792159047fSniklas 5802159047fSniklas INDIRECT is nonzero if the constant is a pointer to an object. 5812159047fSniklas 5822159047fSniklas LOCATION_TYPE describes where to find the constant's value 5832159047fSniklas (in the VT, memory, or embedded in an instruction). 5842159047fSniklas 5852159047fSniklas CLASSMEM is nonzero if the constant is a member of a class. 5862159047fSniklas 5872159047fSniklas NAME is a pointer into the VT for the constant's name. 5882159047fSniklas 5892159047fSniklas LOCATION provides the memory address, register number or pointer 5902159047fSniklas into the VT for the constant's value. 5912159047fSniklas 5922159047fSniklas TYPE is a pointer into either the GNTT or LNTT which describes 5932159047fSniklas the type of this variable. */ 5942159047fSniklas 5952159047fSniklas struct dntt_type_const 5962159047fSniklas { 5972159047fSniklas unsigned int extension: 1; 5982159047fSniklas unsigned int kind: 10; 5992159047fSniklas unsigned int global: 1; 6002159047fSniklas unsigned int indirect: 1; 601f7cc78ecSespie unsigned int location_type: 3; 6022159047fSniklas unsigned int classmem: 1; 6032159047fSniklas unsigned int unused: 15; 6042159047fSniklas vtpointer name; 6052159047fSniklas CORE_ADDR location; 6062159047fSniklas dnttpointer type; 6072159047fSniklas unsigned int offset; 6082159047fSniklas unsigned int displacement; 6092159047fSniklas }; 6102159047fSniklas 6112159047fSniklas /* DNTT_TYPE_TYPEDEF and DNTT_TYPE_TAGDEF: 6122159047fSniklas 6132159047fSniklas The same structure is used to describe typedefs and tagdefs. 6142159047fSniklas 6152159047fSniklas DNTT_TYPE_TYPEDEFS are associated with C "typedefs". 6162159047fSniklas 6172159047fSniklas DNTT_TYPE_TAGDEFs are associated with C "struct", "union", and "enum" 6182159047fSniklas tags, which may have the same name as a typedef in the same scope. 619f7cc78ecSespie Also they are associated with C++ "class" tags, which implicitly have 620f7cc78ecSespie the same name as the class type. 6212159047fSniklas 6222159047fSniklas GLOBAL is nonzero if the typedef/tagdef has global scope. 6232159047fSniklas 6242159047fSniklas TYPEINFO is used to determine if full type information is available 6252159047fSniklas for a tag. (usually 1, but can be zero for opaque types in C). 6262159047fSniklas 6272159047fSniklas NAME is a pointer into the VT for the constant's name. 6282159047fSniklas 6292159047fSniklas TYPE points to the underlying type for the typedef/tagdef in the 6302159047fSniklas GNTT or LNTT. */ 6312159047fSniklas 6322159047fSniklas struct dntt_type_type 6332159047fSniklas { 6342159047fSniklas unsigned int extension: 1; 635f7cc78ecSespie unsigned int kind: 10; /* DNTT_TYPE_TYPEDEF or 636*007c2a45Smiod DNTT_TYPE_TAGDEF. */ 6372159047fSniklas unsigned int global: 1; 6382159047fSniklas unsigned int typeinfo: 1; 6392159047fSniklas unsigned int unused: 19; 6402159047fSniklas vtpointer name; 641f7cc78ecSespie dnttpointer type; /* Underlying type, which for TAGDEF's may be 642*007c2a45Smiod DNTT_TYPE_STRUCT, DNTT_TYPE_UNION, 643*007c2a45Smiod DNTT_TYPE_ENUM, or DNTT_TYPE_CLASS. 644*007c2a45Smiod For TYPEDEF's other underlying types 645*007c2a45Smiod are also possible. */ 6462159047fSniklas }; 6472159047fSniklas 6482159047fSniklas /* DNTT_TYPE_POINTER: 6492159047fSniklas 6502159047fSniklas Used to describe a pointer to an underlying type. 6512159047fSniklas 6522159047fSniklas POINTSTO is a pointer into the GNTT or LNTT for the type which this 6532159047fSniklas pointer points to. 6542159047fSniklas 6552159047fSniklas BITLENGTH is the length of the pointer (not the underlying type). */ 6562159047fSniklas 6572159047fSniklas struct dntt_type_pointer 6582159047fSniklas { 6592159047fSniklas unsigned int extension: 1; 6602159047fSniklas unsigned int kind: 10; 6612159047fSniklas unsigned int unused: 21; 6622159047fSniklas dnttpointer pointsto; 6632159047fSniklas unsigned int bitlength; 6642159047fSniklas }; 6652159047fSniklas 6662159047fSniklas 6672159047fSniklas /* DNTT_TYPE_ENUM: 6682159047fSniklas 6692159047fSniklas Used to describe enumerated types. 6702159047fSniklas 6712159047fSniklas FIRSTMEM is a pointer to a DNTT_TYPE_MEMENUM in the GNTT/LNTT which 6722159047fSniklas describes the first member (and contains a pointer to the chain of 6732159047fSniklas members). 6742159047fSniklas 6752159047fSniklas BITLENGTH is the number of bits used to hold the values of the enum's 6762159047fSniklas members. */ 6772159047fSniklas 6782159047fSniklas struct dntt_type_enum 6792159047fSniklas { 6802159047fSniklas unsigned int extension: 1; 6812159047fSniklas unsigned int kind: 10; 6822159047fSniklas unsigned int unused: 21; 6832159047fSniklas dnttpointer firstmem; 6842159047fSniklas unsigned int bitlength; 6852159047fSniklas }; 6862159047fSniklas 6872159047fSniklas /* DNTT_TYPE_MEMENUM 6882159047fSniklas 6892159047fSniklas Used to describe members of an enumerated type. 6902159047fSniklas 6912159047fSniklas CLASSMEM is nonzero if this member is part of a class. 6922159047fSniklas 6932159047fSniklas NAME points into the VT for the name of this member. 6942159047fSniklas 6952159047fSniklas VALUE is the value of this enumeration member. 6962159047fSniklas 6972159047fSniklas NEXTMEM points to the next DNTT_TYPE_MEMENUM in the chain. */ 6982159047fSniklas 6992159047fSniklas struct dntt_type_memenum 7002159047fSniklas { 7012159047fSniklas unsigned int extension: 1; 7022159047fSniklas unsigned int kind: 10; 7032159047fSniklas unsigned int classmem: 1; 7042159047fSniklas unsigned int unused: 20; 7052159047fSniklas vtpointer name; 7062159047fSniklas unsigned int value; 7072159047fSniklas dnttpointer nextmem; 7082159047fSniklas }; 7092159047fSniklas 7102159047fSniklas /* DNTT_TYPE_SET 7112159047fSniklas 712f7cc78ecSespie Used to describe PASCAL "set" type. 713f7cc78ecSespie 7142159047fSniklas DECLARATION describes the bitpacking of the set. 7152159047fSniklas 7162159047fSniklas SUBTYPE points to a DNTT entry describing the type of the members. 7172159047fSniklas 7182159047fSniklas BITLENGTH is the size of the set. */ 7192159047fSniklas 7202159047fSniklas struct dntt_type_set 7212159047fSniklas { 7222159047fSniklas unsigned int extension: 1; 7232159047fSniklas unsigned int kind: 10; 7242159047fSniklas unsigned int declaration: 2; 7252159047fSniklas unsigned int unused: 19; 7262159047fSniklas dnttpointer subtype; 7272159047fSniklas unsigned int bitlength; 7282159047fSniklas }; 7292159047fSniklas 7302159047fSniklas /* DNTT_TYPE_SUBRANGE 7312159047fSniklas 732f7cc78ecSespie Used to describe subrange type. 733f7cc78ecSespie 7342159047fSniklas DYN_LOW describes the lower bound of the subrange: 7352159047fSniklas 7362159047fSniklas 00 for a constant lower bound (found in LOWBOUND). 7372159047fSniklas 738*007c2a45Smiod 01 for a dynamic lower bound with the lower bound found in the 7392159047fSniklas memory address pointed to by LOWBOUND. 7402159047fSniklas 7412159047fSniklas 10 for a dynamic lower bound described by an variable found in the 7422159047fSniklas DNTT/LNTT (LOWBOUND would be a pointer into the DNTT/LNTT). 7432159047fSniklas 7442159047fSniklas DYN_HIGH is similar to DYN_LOW, except it describes the upper bound. 7452159047fSniklas 7462159047fSniklas SUBTYPE points to the type of the subrange. 7472159047fSniklas 7482159047fSniklas BITLENGTH is the length in bits needed to describe the subrange's 7492159047fSniklas values. */ 7502159047fSniklas 7512159047fSniklas struct dntt_type_subrange 7522159047fSniklas { 7532159047fSniklas unsigned int extension: 1; 7542159047fSniklas unsigned int kind: 10; 7552159047fSniklas unsigned int dyn_low: 2; 7562159047fSniklas unsigned int dyn_high: 2; 7572159047fSniklas unsigned int unused: 17; 7582159047fSniklas int lowbound; 7592159047fSniklas int highbound; 7602159047fSniklas dnttpointer subtype; 7612159047fSniklas unsigned int bitlength; 7622159047fSniklas }; 7632159047fSniklas 7642159047fSniklas /* DNTT_TYPE_ARRAY 7652159047fSniklas 766f7cc78ecSespie Used to describe an array type. 767f7cc78ecSespie 7682159047fSniklas DECLARATION describes the bit packing used in the array. 7692159047fSniklas 7702159047fSniklas ARRAYISBYTES is nonzero if the field in arraylength describes the 7712159047fSniklas length in bytes rather than in bits. A value of zero is used to 7722159047fSniklas describe an array with size 2**32. 7732159047fSniklas 7742159047fSniklas ELEMISBYTES is nonzero if the length if each element in the array 7752159047fSniklas is describes in bytes rather than bits. A value of zero is used 7762159047fSniklas to an element with size 2**32. 7772159047fSniklas 7782159047fSniklas ELEMORDER is nonzero if the elements are indexed in increasing order. 7792159047fSniklas 7802159047fSniklas JUSTIFIED if the elements are left justified to index zero. 7812159047fSniklas 7822159047fSniklas ARRAYLENGTH is the length of the array. 7832159047fSniklas 7842159047fSniklas INDEXTYPE is a DNTT pointer to the type used to index the array. 7852159047fSniklas 7862159047fSniklas ELEMTYPE is a DNTT pointer to the type for the array elements. 7872159047fSniklas 7882159047fSniklas ELEMLENGTH is the length of each element in the array (including 7892159047fSniklas any padding). 7902159047fSniklas 7912159047fSniklas Multi-dimensional arrays are represented by ELEMTYPE pointing to 7922159047fSniklas another DNTT_TYPE_ARRAY. */ 7932159047fSniklas 7942159047fSniklas struct dntt_type_array 7952159047fSniklas { 7962159047fSniklas unsigned int extension: 1; 7972159047fSniklas unsigned int kind: 10; 7982159047fSniklas unsigned int declaration: 2; 7992159047fSniklas unsigned int dyn_low: 2; 8002159047fSniklas unsigned int dyn_high: 2; 8012159047fSniklas unsigned int arrayisbytes: 1; 8022159047fSniklas unsigned int elemisbytes: 1; 8032159047fSniklas unsigned int elemorder: 1; 8042159047fSniklas unsigned int justified: 1; 8052159047fSniklas unsigned int unused: 11; 8062159047fSniklas unsigned int arraylength; 8072159047fSniklas dnttpointer indextype; 8082159047fSniklas dnttpointer elemtype; 8092159047fSniklas unsigned int elemlength; 8102159047fSniklas }; 8112159047fSniklas 8122159047fSniklas /* DNTT_TYPE_STRUCT 8132159047fSniklas 8142159047fSniklas DNTT_TYPE_STRUCT is used to describe a C structure. 8152159047fSniklas 8162159047fSniklas DECLARATION describes the bitpacking used. 8172159047fSniklas 8182159047fSniklas FIRSTFIELD is a DNTT pointer to the first field of the structure 8192159047fSniklas (each field contains a pointer to the next field, walk the list 8202159047fSniklas to access all fields of the structure). 8212159047fSniklas 8222159047fSniklas VARTAGFIELD and VARLIST are used for Pascal variant records. 8232159047fSniklas 8242159047fSniklas BITLENGTH is the size of the structure in bits. */ 8252159047fSniklas 8262159047fSniklas struct dntt_type_struct 8272159047fSniklas { 8282159047fSniklas unsigned int extension: 1; 8292159047fSniklas unsigned int kind: 10; 8302159047fSniklas unsigned int declaration: 2; 8312159047fSniklas unsigned int unused: 19; 8322159047fSniklas dnttpointer firstfield; 8332159047fSniklas dnttpointer vartagfield; 8342159047fSniklas dnttpointer varlist; 8352159047fSniklas unsigned int bitlength; 8362159047fSniklas }; 8372159047fSniklas 8382159047fSniklas /* DNTT_TYPE_UNION 8392159047fSniklas 8402159047fSniklas DNTT_TYPE_UNION is used to describe a C union. 8412159047fSniklas 8422159047fSniklas FIRSTFIELD is a DNTT pointer to the beginning of the field chain. 8432159047fSniklas 8442159047fSniklas BITLENGTH is the size of the union in bits. */ 8452159047fSniklas 8462159047fSniklas struct dntt_type_union 8472159047fSniklas { 8482159047fSniklas unsigned int extension: 1; 8492159047fSniklas unsigned int kind: 10; 8502159047fSniklas unsigned int unused: 21; 8512159047fSniklas dnttpointer firstfield; 8522159047fSniklas unsigned int bitlength; 8532159047fSniklas }; 8542159047fSniklas 8552159047fSniklas /* DNTT_TYPE_FIELD 8562159047fSniklas 857f7cc78ecSespie DNTT_TYPE_FIELD describes one field in a structure or union 858f7cc78ecSespie or C++ class. 8592159047fSniklas 8602159047fSniklas VISIBILITY is used to describe the visibility of the field 8612159047fSniklas (for c++. public = 0, protected = 1, private = 2). 8622159047fSniklas 8632159047fSniklas A_UNION is nonzero if this field is a member of an anonymous union. 8642159047fSniklas 8652159047fSniklas STATICMEM is nonzero if this field is a static member of a template. 8662159047fSniklas 8672159047fSniklas NAME is a pointer into the VT for the name of the field. 8682159047fSniklas 8692159047fSniklas BITOFFSET gives the offset of this field in bits from the beginning 8702159047fSniklas of the structure or union this field is a member of. 8712159047fSniklas 8722159047fSniklas TYPE is a DNTT pointer to the type describing this field. 8732159047fSniklas 8742159047fSniklas BITLENGTH is the size of the entry in bits. 8752159047fSniklas 8762159047fSniklas NEXTFIELD is a DNTT pointer to the next field in the chain. */ 8772159047fSniklas 8782159047fSniklas struct dntt_type_field 8792159047fSniklas { 8802159047fSniklas unsigned int extension: 1; 8812159047fSniklas unsigned int kind: 10; 8822159047fSniklas unsigned int visibility: 2; 8832159047fSniklas unsigned int a_union: 1; 8842159047fSniklas unsigned int staticmem: 1; 8852159047fSniklas unsigned int unused: 17; 8862159047fSniklas vtpointer name; 8872159047fSniklas unsigned int bitoffset; 8882159047fSniklas dnttpointer type; 8892159047fSniklas unsigned int bitlength; 8902159047fSniklas dnttpointer nextfield; 8912159047fSniklas }; 8922159047fSniklas 8932159047fSniklas /* DNTT_TYPE_VARIANT is unused by GDB. */ 8942159047fSniklas /* DNTT_TYPE_FILE is unused by GDB. */ 8952159047fSniklas 8962159047fSniklas /* DNTT_TYPE_FUNCTYPE 8972159047fSniklas 898f7cc78ecSespie I think this is used to describe a function type (e.g., would 899f7cc78ecSespie be emitted as part of a function-pointer description). 900f7cc78ecSespie 9012159047fSniklas VARARGS is nonzero if this function uses varargs. 9022159047fSniklas 9032159047fSniklas FIRSTPARAM is a DNTT pointer to the first entry in the parameter 9042159047fSniklas chain. 9052159047fSniklas 9062159047fSniklas RETVAL is a DNTT pointer to the type of the return value. */ 9072159047fSniklas 9082159047fSniklas struct dntt_type_functype 9092159047fSniklas { 9102159047fSniklas unsigned int extension: 1; 9112159047fSniklas unsigned int kind: 10; 9122159047fSniklas unsigned int varargs: 1; 9132159047fSniklas unsigned int info: 4; 9142159047fSniklas unsigned int unused: 16; 9152159047fSniklas unsigned int bitlength; 9162159047fSniklas dnttpointer firstparam; 9172159047fSniklas dnttpointer retval; 9182159047fSniklas }; 9192159047fSniklas 920f7cc78ecSespie /* DNTT_TYPE_WITH is emitted by C++ to indicate "with" scoping semantics. 921f7cc78ecSespie (Probably also emitted by PASCAL to support "with"...). 922f7cc78ecSespie 923f7cc78ecSespie C++ example: Say "memfunc" is a method of class "c", and say 924f7cc78ecSespie "m" is a data member of class "c". Then from within "memfunc", 925f7cc78ecSespie it is legal to reference "m" directly (e.g. you don't have to 926f7cc78ecSespie say "this->m". The symbol table indicates 927f7cc78ecSespie this by emitting a DNTT_TYPE_WITH symbol within the function "memfunc", 928f7cc78ecSespie pointing to the type symbol for class "c". 929f7cc78ecSespie 930f7cc78ecSespie In GDB, this symbol record is unnecessary, 931f7cc78ecSespie because GDB's symbol lookup algorithm 932f7cc78ecSespie infers the "with" semantics when it sees a "this" argument to the member 933f7cc78ecSespie function. So GDB can safely ignore the DNTT_TYPE_WITH record. 934f7cc78ecSespie 935*007c2a45Smiod A DNTT_TYPE_WITH has a matching DNTT_TYPE_END symbol. */ 936f7cc78ecSespie 937*007c2a45Smiod struct dntt_type_with 938*007c2a45Smiod { 939f7cc78ecSespie unsigned int extension: 1; /* always zero */ 940f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_WITH */ 941f7cc78ecSespie unsigned int addrtype: 2; /* 0 => STATTYPE */ 942f7cc78ecSespie /* 1 => DYNTYPE */ 943f7cc78ecSespie /* 2 => REGTYPE */ 944f7cc78ecSespie unsigned int indirect: 1; /* 1 => pointer to object */ 945f7cc78ecSespie unsigned int longaddr: 1; /* 1 => in long pointer space */ 946f7cc78ecSespie unsigned int nestlevel: 6; /* # of nesting levels back */ 947f7cc78ecSespie unsigned int doc_ranges: 1; /* 1 => location is range list */ 948f7cc78ecSespie unsigned int unused: 10; 949f7cc78ecSespie long location; /* where stored (allocated) */ 950f7cc78ecSespie sltpointer address; 951f7cc78ecSespie dnttpointer type; /* type of with expression */ 952f7cc78ecSespie vtpointer name; /* name of with expression */ 953f7cc78ecSespie unsigned long offset; /* byte offset from location */ 954f7cc78ecSespie }; 955f7cc78ecSespie 956f7cc78ecSespie /* DNTT_TYPE_COMMON is unsupported by GDB. */ 957f7cc78ecSespie /* A DNTT_TYPE_COMMON symbol must have a matching DNTT_TYPE_END symbol */ 958f7cc78ecSespie 959f7cc78ecSespie /* DNTT_TYPE_COBSTRUCT is unsupported by GDB. */ 960f7cc78ecSespie /* DNTT_TYPE_XREF is unsupported by GDB. */ 961f7cc78ecSespie /* DNTT_TYPE_SA is unsupported by GDB. */ 962f7cc78ecSespie /* DNTT_TYPE_MACRO is unsupported by GDB */ 963f7cc78ecSespie 964f7cc78ecSespie /* DNTT_TYPE_BLOCKDATA has the same structure as DNTT_TYPE_FUNCTION */ 965f7cc78ecSespie 966f7cc78ecSespie /* The following are the C++ specific SOM records */ 967f7cc78ecSespie 968f7cc78ecSespie /* The purpose of the DNTT_TYPE_CLASS_SCOPE is to bracket C++ methods 969f7cc78ecSespie and indicate the method name belongs in the "class scope" rather 970f7cc78ecSespie than in the module they are being defined in. For example: 971f7cc78ecSespie 972f7cc78ecSespie class c { 973f7cc78ecSespie ... 974f7cc78ecSespie void memfunc(); // member function 975f7cc78ecSespie }; 976f7cc78ecSespie 977f7cc78ecSespie void c::memfunc() // definition of class c's "memfunc" 978f7cc78ecSespie { 979f7cc78ecSespie ... 980f7cc78ecSespie } 981f7cc78ecSespie 982f7cc78ecSespie main() 983f7cc78ecSespie { 984f7cc78ecSespie ... 985f7cc78ecSespie } 986f7cc78ecSespie 987f7cc78ecSespie In the above, the name "memfunc" is not directly visible from "main". 988f7cc78ecSespie I.e., you have to say "break c::memfunc". 989f7cc78ecSespie If it were a normal function (not a method), it would be visible 990f7cc78ecSespie via the simple "break memfunc". Since "memfunc" otherwise looks 991f7cc78ecSespie like a normal FUNCTION in the symbol table, the bracketing 992f7cc78ecSespie CLASS_SCOPE is what is used to indicate it is really a method. 993f7cc78ecSespie 994f7cc78ecSespie 995*007c2a45Smiod A DNTT_TYPE_CLASS_SCOPE symbol must have a matching DNTT_TYPE_END symbol. */ 996f7cc78ecSespie 997*007c2a45Smiod struct dntt_type_class_scope 998*007c2a45Smiod { 999*007c2a45Smiod unsigned int extension: 1; /* Always zero. */ 1000*007c2a45Smiod unsigned int kind: 10; /* Always DNTT_TYPE_CLASS_SCOPE. */ 1001f7cc78ecSespie unsigned int unused: 21; 1002*007c2a45Smiod sltpointer address ; /* Pointer to SLT entry. */ 1003*007c2a45Smiod dnttpointer type ; /* Pointer to class type DNTT. */ 1004f7cc78ecSespie }; 1005f7cc78ecSespie 1006f7cc78ecSespie /* C++ reference parameter. 1007f7cc78ecSespie The structure of this record is the same as DNTT_TYPE_POINTER - 1008*007c2a45Smiod refer to struct dntt_type_pointer. */ 1009f7cc78ecSespie 1010f7cc78ecSespie /* The next two describe C++ pointer-to-data-member type, and 1011f7cc78ecSespie pointer-to-member-function type, respectively. 1012*007c2a45Smiod DNTT_TYPE_PTRMEM and DNTT_TYPE_PTRMEMFUNC have the same structure. */ 1013f7cc78ecSespie 1014*007c2a45Smiod struct dntt_type_ptrmem 1015*007c2a45Smiod { 1016*007c2a45Smiod unsigned int extension: 1; /* Always zero. */ 1017*007c2a45Smiod unsigned int kind: 10; /* Always DNTT_TYPE_PTRMEM. */ 1018f7cc78ecSespie unsigned int unused: 21; 1019*007c2a45Smiod dnttpointer pointsto ; /* Pointer to class DNTT. */ 1020*007c2a45Smiod dnttpointer memtype ; /* Type of member. */ 1021f7cc78ecSespie }; 1022f7cc78ecSespie 1023*007c2a45Smiod struct dntt_type_ptrmemfunc 1024*007c2a45Smiod { 1025*007c2a45Smiod unsigned int extension: 1; /* Always zero. */ 1026*007c2a45Smiod unsigned int kind: 10; /* Always DNTT_TYPE_PTRMEMFUNC. */ 1027f7cc78ecSespie unsigned int unused: 21; 1028*007c2a45Smiod dnttpointer pointsto ; /* Pointer to class DNTT. */ 1029*007c2a45Smiod dnttpointer memtype ; /* Type of member. */ 1030f7cc78ecSespie }; 1031f7cc78ecSespie 1032f7cc78ecSespie /* The DNTT_TYPE_CLASS symbol is emitted to describe a class type. 1033*007c2a45Smiod "memberlist" points to a chained list of FIELD or GENFIELD records 1034*007c2a45Smiod indicating the class members. "parentlist" points to a chained list 1035*007c2a45Smiod of INHERITANCE records indicating classes from which we inherit 1036*007c2a45Smiod fields. */ 1037f7cc78ecSespie 1038f7cc78ecSespie struct dntt_type_class 1039f7cc78ecSespie { 1040*007c2a45Smiod unsigned int extension: 1; /* Always zero. */ 1041*007c2a45Smiod unsigned int kind: 10; /* Always DNTT_TYPE_CLASS. */ 1042*007c2a45Smiod unsigned int abstract: 1; /* Is this an abstract class? */ 1043*007c2a45Smiod unsigned int class_decl: 2; /* 0=class,1=union,2=struct. */ 1044*007c2a45Smiod unsigned int expansion: 1; /* 1=template expansion. */ 1045f7cc78ecSespie unsigned int unused: 17; 1046*007c2a45Smiod dnttpointer memberlist ; /* Ptr to chain of [GEN]FIELDs. */ 1047*007c2a45Smiod unsigned long vtbl_loc ; /* Offset in obj of ptr to vtbl. */ 1048*007c2a45Smiod dnttpointer parentlist ; /* Ptr to K_INHERITANCE list. */ 1049*007c2a45Smiod unsigned long bitlength ; /* Total at this level. */ 1050*007c2a45Smiod dnttpointer identlist ; /* Ptr to chain of class ident's. */ 1051*007c2a45Smiod dnttpointer friendlist ; /* Ptr to K_FRIEND list. */ 1052*007c2a45Smiod dnttpointer templateptr ; /* Ptr to template. */ 1053*007c2a45Smiod dnttpointer nextexp ; /* Ptr to next expansion. */ 1054f7cc78ecSespie }; 1055f7cc78ecSespie 1056f7cc78ecSespie /* Class members are indicated via either the FIELD record (for 1057f7cc78ecSespie data members, same as for C struct fields), or by the GENFIELD record 1058*007c2a45Smiod (for member functions). */ 1059f7cc78ecSespie 1060*007c2a45Smiod struct dntt_type_genfield 1061*007c2a45Smiod { 1062*007c2a45Smiod unsigned int extension: 1; /* Always zero. */ 1063*007c2a45Smiod unsigned int kind: 10; /* Always DNTT_TYPE_GENFIELD. */ 1064*007c2a45Smiod unsigned int visibility: 2; /* Pub = 0, prot = 1, priv = 2. */ 1065*007c2a45Smiod unsigned int a_union: 1; /* 1 => anonymous union member. */ 1066f7cc78ecSespie unsigned int unused: 18; 1067*007c2a45Smiod dnttpointer field ; /* Pointer to field or qualifier. */ 1068*007c2a45Smiod dnttpointer nextfield ; /* Pointer to next field. */ 1069f7cc78ecSespie }; 1070f7cc78ecSespie 1071*007c2a45Smiod /* C++ virtual functions. */ 1072f7cc78ecSespie 1073*007c2a45Smiod struct dntt_type_vfunc 1074*007c2a45Smiod { 1075f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1076f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_VFUNC */ 1077f7cc78ecSespie unsigned int pure: 1; /* pure virtual function ? */ 1078f7cc78ecSespie unsigned int unused: 20; 1079f7cc78ecSespie dnttpointer funcptr ; /* points to FUNCTION symbol */ 1080f7cc78ecSespie unsigned long vtbl_offset ; /* offset into vtbl for virtual */ 1081f7cc78ecSespie }; 1082f7cc78ecSespie 1083*007c2a45Smiod /* Not precisely sure what this is intended for - DDE ignores it. */ 1084f7cc78ecSespie 1085*007c2a45Smiod struct dntt_type_memaccess 1086*007c2a45Smiod { 1087f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1088f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_MEMACCESS */ 1089f7cc78ecSespie unsigned int unused: 21; 1090f7cc78ecSespie dnttpointer classptr ; /* pointer to base class */ 1091f7cc78ecSespie dnttpointer field ; /* pointer field */ 1092f7cc78ecSespie }; 1093f7cc78ecSespie 1094f7cc78ecSespie /* The DNTT_TYPE_INHERITANCE record describes derived classes. 1095*007c2a45Smiod In particular, the "parentlist" field of the CLASS record points 1096*007c2a45Smiod to a list of INHERITANCE records for classes from which we 1097*007c2a45Smiod inherit members. */ 1098f7cc78ecSespie 1099*007c2a45Smiod struct dntt_type_inheritance 1100*007c2a45Smiod { 1101f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1102f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_INHERITANCE */ 1103f7cc78ecSespie unsigned int Virtual: 1; /* virtual base class ? */ 1104f7cc78ecSespie unsigned int visibility: 2; /* pub = 0, prot = 1, priv = 2 */ 1105f7cc78ecSespie unsigned int unused: 18; 1106f7cc78ecSespie dnttpointer classname ; /* first parent class, if any */ 1107f7cc78ecSespie unsigned long offset ; /* offset to start of base class */ 1108f7cc78ecSespie dnttpointer next ; /* pointer to next K_INHERITANCE */ 1109f7cc78ecSespie unsigned long future[2] ; /* padding to 3-word block end */ 1110f7cc78ecSespie }; 1111f7cc78ecSespie 1112f7cc78ecSespie /* C++ "friend" classes ... */ 1113f7cc78ecSespie 1114*007c2a45Smiod struct dntt_type_friend_class 1115*007c2a45Smiod { 1116f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1117f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_FRIEND_CLASS */ 1118f7cc78ecSespie unsigned int unused: 21; 1119f7cc78ecSespie dnttpointer classptr ; /* pointer to class DNTT */ 1120f7cc78ecSespie dnttpointer next ; /* next DNTT_FRIEND */ 1121f7cc78ecSespie }; 1122f7cc78ecSespie 1123*007c2a45Smiod struct dntt_type_friend_func 1124*007c2a45Smiod { 1125f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1126f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_FRIEND_FUNC */ 1127f7cc78ecSespie unsigned int unused: 21; 1128f7cc78ecSespie dnttpointer funcptr ; /* pointer to function */ 1129f7cc78ecSespie dnttpointer classptr ; /* pointer to class DNTT */ 1130f7cc78ecSespie dnttpointer next ; /* next DNTT_FRIEND */ 1131f7cc78ecSespie unsigned long future[2] ; /* padding to 3-word block end */ 1132f7cc78ecSespie }; 1133f7cc78ecSespie 1134f7cc78ecSespie /* DDE appears to ignore the DNTT_TYPE_MODIFIER record. 1135*007c2a45Smiod It could perhaps be used to give better "ptype" output in GDB; 1136*007c2a45Smiod otherwise it is probably safe for GDB to ignore it also. */ 1137f7cc78ecSespie 1138*007c2a45Smiod struct dntt_type_modifier 1139*007c2a45Smiod { 1140f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1141f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_MODIFIER */ 1142f7cc78ecSespie unsigned int m_const: 1; /* const */ 1143f7cc78ecSespie unsigned int m_static: 1; /* static */ 1144f7cc78ecSespie unsigned int m_void: 1; /* void */ 1145f7cc78ecSespie unsigned int m_volatile: 1; /* volatile */ 1146f7cc78ecSespie unsigned int m_duplicate: 1; /* duplicate */ 1147f7cc78ecSespie unsigned int unused: 16; 1148f7cc78ecSespie dnttpointer type ; /* subtype */ 1149f7cc78ecSespie unsigned long future ; /* padding to 3-word block end */ 1150f7cc78ecSespie }; 1151f7cc78ecSespie 1152*007c2a45Smiod /* I'm not sure what this was intended for - DDE ignores it. */ 1153f7cc78ecSespie 1154*007c2a45Smiod struct dntt_type_object_id 1155*007c2a45Smiod { 1156f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1157f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_OBJECT_ID */ 1158f7cc78ecSespie unsigned int indirect: 1; /* Is object_ident addr of addr? */ 1159f7cc78ecSespie unsigned int unused: 20; 1160f7cc78ecSespie unsigned long object_ident ; /* object identifier */ 1161f7cc78ecSespie unsigned long offset ; /* offset to start of base class */ 1162f7cc78ecSespie dnttpointer next ; /* pointer to next K_OBJECT_ID */ 1163f7cc78ecSespie unsigned long segoffset ; /* for linker fixup */ 1164f7cc78ecSespie unsigned long future ; /* padding to 3-word block end */ 1165f7cc78ecSespie }; 1166f7cc78ecSespie 1167f7cc78ecSespie /* No separate dntt_type_memfunc; same as dntt_type_func */ 1168f7cc78ecSespie 1169f7cc78ecSespie /* Symbol records to support templates. These only get used 1170*007c2a45Smiod in DDE's "describe" output (like GDB's "ptype"). */ 1171f7cc78ecSespie 1172f7cc78ecSespie /* The TEMPLATE record is the header for a template-class. 1173*007c2a45Smiod Like the CLASS record, a TEMPLATE record has a memberlist that 1174*007c2a45Smiod points to a list of template members. It also has an arglist 1175*007c2a45Smiod pointing to a list of TEMPLATE_ARG records. */ 1176f7cc78ecSespie 1177*007c2a45Smiod struct dntt_type_template 1178*007c2a45Smiod { 1179f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1180f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_TEMPLATE */ 1181f7cc78ecSespie unsigned int abstract: 1; /* is this an abstract class? */ 1182f7cc78ecSespie unsigned int class_decl: 2; /* 0=class,1=union,2=struct */ 1183f7cc78ecSespie unsigned int unused: 18; 1184f7cc78ecSespie dnttpointer memberlist ; /* ptr to chain of K_[GEN]FIELDs */ 1185f7cc78ecSespie long unused2 ; /* offset in obj of ptr to vtbl */ 1186f7cc78ecSespie dnttpointer parentlist ; /* ptr to K_INHERITANCE list */ 1187f7cc78ecSespie unsigned long bitlength ; /* total at this level */ 1188f7cc78ecSespie dnttpointer identlist ; /* ptr to chain of class ident's */ 1189f7cc78ecSespie dnttpointer friendlist ; /* ptr to K_FRIEND list */ 1190f7cc78ecSespie dnttpointer arglist ; /* ptr to argument list */ 1191f7cc78ecSespie dnttpointer expansions ; /* ptr to expansion list */ 1192f7cc78ecSespie }; 1193f7cc78ecSespie 1194f7cc78ecSespie /* Template-class arguments are a list of TEMPL_ARG records 1195*007c2a45Smiod chained together. The "name" field is the name of the formal. 1196*007c2a45Smiod E.g.: 1197*007c2a45Smiod 1198*007c2a45Smiod template <class T> class q { ... }; 1199*007c2a45Smiod 1200*007c2a45Smiod Then "T" is the name of the formal argument. */ 1201*007c2a45Smiod 1202*007c2a45Smiod struct dntt_type_templ_arg 1203*007c2a45Smiod { 1204f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1205f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_TEMPL_ARG */ 1206f7cc78ecSespie unsigned int usagetype: 1; /* 0 type-name 1 expression */ 1207f7cc78ecSespie unsigned int unused: 20; 1208f7cc78ecSespie vtpointer name ; /* name of argument */ 1209f7cc78ecSespie dnttpointer type ; /* for non type arguments */ 1210f7cc78ecSespie dnttpointer nextarg ; /* Next argument if any */ 1211f7cc78ecSespie long future[2] ; /* padding to 3-word block end */ 1212f7cc78ecSespie }; 1213f7cc78ecSespie 1214f7cc78ecSespie /* FUNC_TEMPLATE records are sort of like FUNCTION, but are emitted 1215*007c2a45Smiod for template member functions. E.g., 1216*007c2a45Smiod 1217*007c2a45Smiod template <class T> class q 1218*007c2a45Smiod { 1219f7cc78ecSespie ... 1220f7cc78ecSespie void f(); 1221f7cc78ecSespie ... 1222f7cc78ecSespie }; 1223f7cc78ecSespie 1224*007c2a45Smiod Within the list of FIELDs/GENFIELDs defining the member list 1225*007c2a45Smiod of the template "q", "f" would appear as a FUNC_TEMPLATE. 1226*007c2a45Smiod We'll also see instances of FUNCTION "f" records for each 1227*007c2a45Smiod instantiation of the template. */ 1228*007c2a45Smiod 1229*007c2a45Smiod struct dntt_type_func_template 1230*007c2a45Smiod { 1231f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1232f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_FUNC_TEMPLATE */ 1233f7cc78ecSespie unsigned int public: 1; /* 1 => globally visible */ 1234f7cc78ecSespie unsigned int language: 4; /* type of language */ 1235f7cc78ecSespie unsigned int level: 5; /* nesting level (top level = 0)*/ 1236f7cc78ecSespie unsigned int optimize: 2; /* level of optimization */ 1237f7cc78ecSespie unsigned int varargs: 1; /* ellipses. Pascal/800 later */ 1238f7cc78ecSespie unsigned int info: 4; /* lang-specific stuff; F_xxxx */ 1239f7cc78ecSespie unsigned int inlined: 1; 1240f7cc78ecSespie unsigned int localloc: 1; /* 0 at top, 1 at end of block */ 1241f7cc78ecSespie unsigned int unused: 2; 1242f7cc78ecSespie vtpointer name ; /* name of function */ 1243f7cc78ecSespie vtpointer alias ; /* alternate name, if any */ 1244f7cc78ecSespie dnttpointer firstparam ; /* first FPARAM, if any */ 1245f7cc78ecSespie dnttpointer retval ; /* return type, if any */ 1246f7cc78ecSespie dnttpointer arglist ; /* ptr to argument list */ 1247f7cc78ecSespie }; 1248f7cc78ecSespie 1249f7cc78ecSespie /* LINK is apparently intended to link together function template 1250*007c2a45Smiod definitions with their instantiations. However, it is not clear 1251*007c2a45Smiod why this would be needed, except to provide the information on 1252*007c2a45Smiod a "ptype" command. And as far as I can tell, aCC does not 1253*007c2a45Smiod generate this record. */ 1254f7cc78ecSespie 1255*007c2a45Smiod struct dntt_type_link 1256*007c2a45Smiod { 1257f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1258f7cc78ecSespie unsigned int kind: 10; /* always DNTT_TYPE_LINK */ 1259f7cc78ecSespie unsigned int linkKind: 4; /* always LINK_UNKNOWN */ 1260f7cc78ecSespie unsigned int unused: 17; 1261f7cc78ecSespie long future1 ; /* expansion */ 1262f7cc78ecSespie dnttpointer ptr1 ; /* link from template */ 1263f7cc78ecSespie dnttpointer ptr2 ; /* to expansion */ 1264f7cc78ecSespie long future[2] ; /* padding to 3-word block end */ 1265f7cc78ecSespie }; 1266f7cc78ecSespie 1267*007c2a45Smiod /* end of C++ specific SOM's. */ 1268f7cc78ecSespie 1269f7cc78ecSespie /* DNTT_TYPE_DYN_ARRAY_DESC is unused by GDB */ 1270f7cc78ecSespie /* DNTT_TYPE_DESC_SUBRANGE is unused by GDB */ 1271f7cc78ecSespie /* DNTT_TYPE_BEGIN_EXT is unused by GDB */ 1272f7cc78ecSespie /* DNTT_TYPE_INLN is unused by GDB */ 1273f7cc78ecSespie /* DNTT_TYPE_INLN_LIST is unused by GDB */ 1274f7cc78ecSespie /* DNTT_TYPE_ALIAS is unused by GDB */ 1275f7cc78ecSespie 1276*007c2a45Smiod struct dntt_type_doc_function 1277*007c2a45Smiod { 1278f7cc78ecSespie unsigned int extension: 1; /* always zero */ 1279f7cc78ecSespie unsigned int kind: 10; /* K_DOC_FUNCTION or */ 1280f7cc78ecSespie /* K_DOC_MEMFUNC */ 1281f7cc78ecSespie unsigned int global: 1; /* 1 => globally visible */ 1282f7cc78ecSespie unsigned int language: 4; /* type of language */ 1283f7cc78ecSespie unsigned int level: 5; /* nesting level (top level = 0)*/ 1284f7cc78ecSespie unsigned int optimize: 2; /* level of optimization */ 1285f7cc78ecSespie unsigned int varargs: 1; /* ellipses. Pascal/800 later */ 1286f7cc78ecSespie unsigned int info: 4; /* lang-specific stuff; F_xxxx */ 1287f7cc78ecSespie unsigned int inlined: 1; 1288f7cc78ecSespie unsigned int localloc: 1; /* 0 at top, 1 at end of block */ 1289f7cc78ecSespie unsigned int expansion: 1; /* 1 = function expansion */ 1290f7cc78ecSespie unsigned int doc_clone: 1; 1291f7cc78ecSespie vtpointer name; /* name of function */ 1292f7cc78ecSespie vtpointer alias; /* alternate name, if any */ 1293f7cc78ecSespie dnttpointer firstparam; /* first FPARAM, if any */ 1294f7cc78ecSespie sltpointer address; /* code and text locations */ 1295f7cc78ecSespie CORE_ADDR entryaddr; /* address of entry point */ 1296f7cc78ecSespie dnttpointer retval; /* return type, if any */ 1297f7cc78ecSespie CORE_ADDR lowaddr; /* lowest address of function */ 1298f7cc78ecSespie CORE_ADDR hiaddr; /* highest address of function */ 1299f7cc78ecSespie dnttpointer inline_list; /* pointer to first inline */ 1300f7cc78ecSespie ltpointer lt_offset; /* start of frag/cp line table */ 1301f7cc78ecSespie ctxtpointer ctxt_offset; /* start of context table for this routine */ 1302f7cc78ecSespie }; 1303f7cc78ecSespie 1304f7cc78ecSespie /* DNTT_TYPE_DOC_MEMFUNC is unused by GDB */ 13052159047fSniklas 13062159047fSniklas /* DNTT_TYPE_GENERIC and DNTT_TYPE_BLOCK are convience structures 13072159047fSniklas so we can examine a DNTT entry in a generic fashion. */ 13082159047fSniklas struct dntt_type_generic 13092159047fSniklas { 13102159047fSniklas unsigned int word[9]; 13112159047fSniklas }; 13122159047fSniklas 13132159047fSniklas struct dntt_type_block 13142159047fSniklas { 13152159047fSniklas unsigned int extension: 1; 13162159047fSniklas unsigned int kind: 10; 13172159047fSniklas unsigned int unused: 21; 13182159047fSniklas unsigned int word[2]; 13192159047fSniklas }; 13202159047fSniklas 1321f7cc78ecSespie /* One entry in a DNTT (either the LNTT or GNTT). 1322*007c2a45Smiod This is a union of the above 60 or so structure definitions. */ 1323*007c2a45Smiod 13242159047fSniklas union dnttentry 13252159047fSniklas { 13262159047fSniklas struct dntt_type_srcfile dsfile; 13272159047fSniklas struct dntt_type_module dmodule; 13282159047fSniklas struct dntt_type_function dfunc; 13292159047fSniklas struct dntt_type_function dentry; 13302159047fSniklas struct dntt_type_begin dbegin; 13312159047fSniklas struct dntt_type_end dend; 13322159047fSniklas struct dntt_type_fparam dfparam; 13332159047fSniklas struct dntt_type_svar dsvar; 13342159047fSniklas struct dntt_type_dvar ddvar; 13352159047fSniklas struct dntt_type_const dconst; 13362159047fSniklas struct dntt_type_type dtype; 13372159047fSniklas struct dntt_type_type dtag; 13382159047fSniklas struct dntt_type_pointer dptr; 13392159047fSniklas struct dntt_type_enum denum; 13402159047fSniklas struct dntt_type_memenum dmember; 13412159047fSniklas struct dntt_type_set dset; 13422159047fSniklas struct dntt_type_subrange dsubr; 13432159047fSniklas struct dntt_type_array darray; 13442159047fSniklas struct dntt_type_struct dstruct; 13452159047fSniklas struct dntt_type_union dunion; 13462159047fSniklas struct dntt_type_field dfield; 13472159047fSniklas struct dntt_type_functype dfunctype; 1348f7cc78ecSespie struct dntt_type_with dwith; 1349f7cc78ecSespie struct dntt_type_function dblockdata; 1350f7cc78ecSespie struct dntt_type_class_scope dclass_scope; 1351f7cc78ecSespie struct dntt_type_pointer dreference; 1352f7cc78ecSespie struct dntt_type_ptrmem dptrmem; 1353f7cc78ecSespie struct dntt_type_ptrmemfunc dptrmemfunc; 1354f7cc78ecSespie struct dntt_type_class dclass; 1355f7cc78ecSespie struct dntt_type_genfield dgenfield; 1356f7cc78ecSespie struct dntt_type_vfunc dvfunc; 1357f7cc78ecSespie struct dntt_type_memaccess dmemaccess; 1358f7cc78ecSespie struct dntt_type_inheritance dinheritance; 1359f7cc78ecSespie struct dntt_type_friend_class dfriend_class; 1360f7cc78ecSespie struct dntt_type_friend_func dfriend_func; 1361f7cc78ecSespie struct dntt_type_modifier dmodifier; 1362f7cc78ecSespie struct dntt_type_object_id dobject_id; 1363f7cc78ecSespie struct dntt_type_template dtemplate; 1364f7cc78ecSespie struct dntt_type_templ_arg dtempl_arg; 1365f7cc78ecSespie struct dntt_type_func_template dfunc_template; 1366f7cc78ecSespie struct dntt_type_link dlink; 1367f7cc78ecSespie struct dntt_type_doc_function ddocfunc; 13682159047fSniklas struct dntt_type_generic dgeneric; 13692159047fSniklas struct dntt_type_block dblock; 13702159047fSniklas }; 13712159047fSniklas 13722159047fSniklas /* Source line entry types. */ 13732159047fSniklas enum slttype 13742159047fSniklas { 13752159047fSniklas SLT_NORMAL, 13762159047fSniklas SLT_SRCFILE, 13772159047fSniklas SLT_MODULE, 13782159047fSniklas SLT_FUNCTION, 13792159047fSniklas SLT_ENTRY, 13802159047fSniklas SLT_BEGIN, 13812159047fSniklas SLT_END, 13822159047fSniklas SLT_WITH, 13832159047fSniklas SLT_EXIT, 13842159047fSniklas SLT_ASSIST, 13852159047fSniklas SLT_MARKER, 1386f7cc78ecSespie SLT_CLASS_SCOPE, 1387f7cc78ecSespie SLT_INLN, 1388f7cc78ecSespie SLT_NORMAL_OFFSET, 13892159047fSniklas }; 13902159047fSniklas 13912159047fSniklas /* A normal source line entry. Simply provides a mapping of a source 13922159047fSniklas line number to a code address. 13932159047fSniklas 13942159047fSniklas SLTDESC will always be SLT_NORMAL or SLT_EXIT. */ 13952159047fSniklas 13962159047fSniklas struct slt_normal 13972159047fSniklas { 13982159047fSniklas unsigned int sltdesc: 4; 13992159047fSniklas unsigned int line: 28; 14002159047fSniklas CORE_ADDR address; 14012159047fSniklas }; 14022159047fSniklas 1403f7cc78ecSespie struct slt_normal_off 1404f7cc78ecSespie { 1405f7cc78ecSespie unsigned int sltdesc: 4; 1406f7cc78ecSespie unsigned int offset: 6; 1407f7cc78ecSespie unsigned int line: 22; 1408f7cc78ecSespie CORE_ADDR address; 1409f7cc78ecSespie }; 1410f7cc78ecSespie 14112159047fSniklas /* A special source line entry. Provides a mapping of a declaration 14122159047fSniklas to a line number. These entries point back into the DNTT which 14132159047fSniklas references them. */ 14142159047fSniklas 14152159047fSniklas struct slt_special 14162159047fSniklas { 14172159047fSniklas unsigned int sltdesc: 4; 14182159047fSniklas unsigned int line: 28; 14192159047fSniklas dnttpointer backptr; 14202159047fSniklas }; 14212159047fSniklas 14222159047fSniklas /* Used to describe nesting. 14232159047fSniklas 14242159047fSniklas For nested languages, an slt_assist entry must follow each SLT_FUNC 14252159047fSniklas entry in the SLT. The address field will point forward to the 14262159047fSniklas first slt_normal entry within the function's scope. */ 14272159047fSniklas 14282159047fSniklas struct slt_assist 14292159047fSniklas { 14302159047fSniklas unsigned int sltdesc: 4; 14312159047fSniklas unsigned int unused: 28; 14322159047fSniklas sltpointer address; 14332159047fSniklas }; 14342159047fSniklas 14352159047fSniklas struct slt_generic 14362159047fSniklas { 14372159047fSniklas unsigned int word[2]; 14382159047fSniklas }; 14392159047fSniklas 14402159047fSniklas union sltentry 14412159047fSniklas { 14422159047fSniklas struct slt_normal snorm; 1443f7cc78ecSespie struct slt_normal_off snormoff; 14442159047fSniklas struct slt_special sspec; 14452159047fSniklas struct slt_assist sasst; 14462159047fSniklas struct slt_generic sgeneric; 14472159047fSniklas }; 14482159047fSniklas 1449f7cc78ecSespie /* $LINES$ declarations 1450*007c2a45Smiod This is the line table used for optimized code, which is only present 1451*007c2a45Smiod in the new $PROGRAM_INFO$ debug space. */ 1452f7cc78ecSespie 1453f7cc78ecSespie #define DST_LN_ESCAPE_FLAG1 15 1454f7cc78ecSespie #define DST_LN_ESCAPE_FLAG2 14 1455f7cc78ecSespie #define DST_LN_CTX_SPEC1 13 1456f7cc78ecSespie #define DST_LN_CTX_SPEC2 12 1457f7cc78ecSespie 1458*007c2a45Smiod /* Escape function codes: */ 1459*007c2a45Smiod 1460f7cc78ecSespie typedef enum 1461f7cc78ecSespie { 1462f7cc78ecSespie dst_ln_pad, /* pad byte */ 1463f7cc78ecSespie dst_ln_escape_1, /* reserved */ 1464f7cc78ecSespie dst_ln_dpc1_dln1, /* 1 byte line delta, 1 byte pc delta */ 1465f7cc78ecSespie dst_ln_dpc2_dln2, /* 2 bytes line delta, 2 bytes pc delta */ 1466f7cc78ecSespie dst_ln_pc4_ln4, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ 1467f7cc78ecSespie dst_ln_dpc0_dln1, /* 1 byte line delta, pc delta = 0 */ 1468f7cc78ecSespie dst_ln_ln_off_1, /* statement escape, stmt # = 1 (2nd stmt on line) */ 1469f7cc78ecSespie dst_ln_ln_off, /* statement escape, stmt # = next byte */ 1470f7cc78ecSespie dst_ln_entry, /* entry escape, next byte is entry number */ 1471f7cc78ecSespie dst_ln_exit, /* exit escape */ 1472f7cc78ecSespie dst_ln_stmt_end, /* gap escape, 4 bytes pc delta */ 1473f7cc78ecSespie dst_ln_stmt_cp, /* current stmt is a critical point */ 1474f7cc78ecSespie dst_ln_escape_12, /* reserved */ 1475f7cc78ecSespie dst_ln_escape_13, /* this is an exception site record */ 1476f7cc78ecSespie dst_ln_nxt_byte, /* next byte contains the real escape code */ 1477f7cc78ecSespie dst_ln_end, /* end escape, final entry follows */ 1478f7cc78ecSespie dst_ln_escape1_END_OF_ENUM 1479f7cc78ecSespie } 1480f7cc78ecSespie dst_ln_escape1_t; 1481f7cc78ecSespie 1482f7cc78ecSespie typedef enum 1483f7cc78ecSespie { 1484f7cc78ecSespie dst_ln_ctx_1, /* next byte describes context switch with 5-bit */ 1485f7cc78ecSespie /* index into the image table and 3-bit run length. */ 1486f7cc78ecSespie /* If run length is 0, end with another cxt specifier or ctx_end */ 1487f7cc78ecSespie dst_ln_ctx_2, /* next 2 bytes switch context: 13 bit index, 3 bit run length */ 1488f7cc78ecSespie dst_ln_ctx_4, /* next 4 bytes switch context: 29 bit index, 3 bit run length */ 1489f7cc78ecSespie dst_ln_ctx_end, /* end current context */ 1490f7cc78ecSespie dst_ln_col_run_1, /* next byte is column position of start of next statement, */ 1491f7cc78ecSespie /* following byte is length of statement */ 1492f7cc78ecSespie dst_ln_col_run_2, /* next 2 bytes is column position of start of next statement, */ 1493f7cc78ecSespie /* following 2 bytes is length of statement */ 1494f7cc78ecSespie dst_ln_init_base1, /* next 4 bytes are absolute PC, followed by 1 byte of line number */ 1495f7cc78ecSespie dst_ln_init_base2, /* next 4 bytes are absolute PC, followed by 2 bytes of line number */ 1496f7cc78ecSespie dst_ln_init_base3, /* next 4 bytes are absolute PC, followed by 3 bytes of line number */ 1497f7cc78ecSespie dst_ln_escape2_END_OF_ENUM 1498f7cc78ecSespie } 1499f7cc78ecSespie dst_ln_escape2_t; 1500f7cc78ecSespie 1501f7cc78ecSespie typedef union 1502f7cc78ecSespie { 1503f7cc78ecSespie struct 1504f7cc78ecSespie { 1505f7cc78ecSespie unsigned int pc_delta : 4; /* 4 bit pc delta */ 1506f7cc78ecSespie int ln_delta : 4; /* 4 bit line number delta */ 1507f7cc78ecSespie } 1508f7cc78ecSespie delta; 1509f7cc78ecSespie 1510f7cc78ecSespie struct 1511f7cc78ecSespie { 1512f7cc78ecSespie unsigned int esc_flag : 4; /* alias for pc_delta */ 1513f7cc78ecSespie unsigned int esc_code : 4; /* escape function code (dst_ln_escape1_t, or ...2_t */ 1514f7cc78ecSespie } 1515f7cc78ecSespie esc; 1516f7cc78ecSespie 1517f7cc78ecSespie struct 1518f7cc78ecSespie { 1519f7cc78ecSespie unsigned int esc_flag : 4; /* dst_ln_ctx_spec1, or dst_ln_ctx_spec2 */ 1520f7cc78ecSespie unsigned int run_length : 2; 1521f7cc78ecSespie unsigned int ctx_index : 2; /* ...spec2 contains index; ...spec1, index - 4 */ 1522f7cc78ecSespie } 1523f7cc78ecSespie ctx_spec; 1524f7cc78ecSespie 1525f7cc78ecSespie char sdata; /* signed data byte */ 1526f7cc78ecSespie unsigned char udata; /* unsigned data byte */ 1527f7cc78ecSespie } 1528f7cc78ecSespie dst_ln_entry_t, 1529f7cc78ecSespie * dst_ln_entry_ptr_t; 1530f7cc78ecSespie 1531f7cc78ecSespie /* Warning: although the above union occupies only 1 byte the compiler treats 1532*007c2a45Smiod it as having size 2 (the minimum size of a struct). Therefore a sequence of 1533*007c2a45Smiod dst_ln_entry_t's cannot be described as an array, and walking through such a 1534*007c2a45Smiod sequence requires convoluted code such as 1535*007c2a45Smiod ln_ptr = (dst_ln_entry_ptr_t) (char*) ln_ptr + 1 1536*007c2a45Smiod We regret the inconvenience. */ 1537f7cc78ecSespie 1538*007c2a45Smiod /* Structure for interpreting the byte following a dst_ln_ctx1 entry. */ 1539*007c2a45Smiod typedef struct 1540*007c2a45Smiod { 1541f7cc78ecSespie unsigned int ctx1_index : 5; /* 5 bit index into context table */ 1542f7cc78ecSespie unsigned int ctx1_run_length : 3; /* 3 bit run length */ 1543f7cc78ecSespie } dst_ln_ctx1_t, 1544f7cc78ecSespie *dst_ln_ctx1_ptr_t; 1545f7cc78ecSespie 1546*007c2a45Smiod /* Structure for interpreting the bytes following a dst_ln_ctx2 entry. */ 1547*007c2a45Smiod typedef struct 1548*007c2a45Smiod { 1549f7cc78ecSespie unsigned int ctx2_index : 13; /* 13 bit index into context table */ 1550f7cc78ecSespie unsigned int ctx2_run_length : 3; /* 3 bit run length */ 1551f7cc78ecSespie } dst_ln_ctx2_t, 1552f7cc78ecSespie *dst_ln_ctx2_ptr_t; 1553f7cc78ecSespie 1554*007c2a45Smiod /* Structure for interpreting the bytes following a dst_ln_ctx4 entry. */ 1555*007c2a45Smiod typedef struct 1556*007c2a45Smiod { 1557f7cc78ecSespie unsigned int ctx4_index : 29; /* 29 bit index into context table */ 1558f7cc78ecSespie unsigned int ctx4_run_length : 3; /* 3 bit run length */ 1559f7cc78ecSespie } dst_ln_ctx4_t, 1560f7cc78ecSespie *dst_ln_ctx4_ptr_t; 1561f7cc78ecSespie 1562f7cc78ecSespie 1563f7cc78ecSespie /* PXDB definitions. 1564f7cc78ecSespie 1565*007c2a45Smiod PXDB is a post-processor which takes the executable file 1566*007c2a45Smiod and massages the debug information so that the debugger may 1567*007c2a45Smiod start up and run more efficiently. Some of the tasks 1568*007c2a45Smiod performed by PXDB are: 1569*007c2a45Smiod 1570*007c2a45Smiod o Remove duplicate global type and variable information 1571*007c2a45Smiod from the GNTT, 1572*007c2a45Smiod 1573*007c2a45Smiod o Append the GNTT onto the end of the LNTT and place both 1574*007c2a45Smiod back in the LNTT section, 1575*007c2a45Smiod 1576*007c2a45Smiod o Build quick look-up tables (description follows) for 1577*007c2a45Smiod files, procedures, modules, and paragraphs (for Cobol), 1578*007c2a45Smiod placing these in the GNTT section, 1579*007c2a45Smiod 1580*007c2a45Smiod o Reconstruct the header appearing in the header section 1581*007c2a45Smiod to access this information. 1582*007c2a45Smiod 1583*007c2a45Smiod The "quick look-up" tables are in the $GNTT$ sub-space, in 1584*007c2a45Smiod the following order: 1585*007c2a45Smiod 1586*007c2a45Smiod Procedures -sorted by address 1587*007c2a45Smiod Source files -sorted by address (of the 1588*007c2a45Smiod generated code from routines) 1589*007c2a45Smiod Modules -sorted by address 1590*007c2a45Smiod Classes -<unsorted?> 1591*007c2a45Smiod Address Alias -sorted by index <?> 1592*007c2a45Smiod Object IDs -sorted by object identifier 1593*007c2a45Smiod 1594*007c2a45Smiod Most quick entries have (0-based) indices into the LNTT tables to 1595*007c2a45Smiod the full entries for the item it describes. 1596*007c2a45Smiod 1597*007c2a45Smiod The post-PXDB header is in the $HEADER$ sub-space. Alas, it 1598*007c2a45Smiod occurs in different forms, depending on the optimization level 1599*007c2a45Smiod in the compilation step and whether PXDB was run or not. The 1600*007c2a45Smiod worst part is the forms aren't self-describing, so we'll have 1601*007c2a45Smiod to grovel in the bits to figure out what kind we're looking at 1602*007c2a45Smiod (see hp_get_header in hp-psymtab-read.c). */ 1603*007c2a45Smiod 1604*007c2a45Smiod /* PXDB versions. */ 1605*007c2a45Smiod 1606f7cc78ecSespie #define PXDB_VERSION_CPLUSPLUS 1 1607f7cc78ecSespie #define PXDB_VERSION_7_4 2 1608f7cc78ecSespie #define PXDB_VERSION_CPP_30 3 1609f7cc78ecSespie #define PXDB_VERSION_DDE_3_2A 4 1610f7cc78ecSespie #define PXDB_VERSION_DDE_3_2 5 1611f7cc78ecSespie #define PXDB_VERSION_DDE_4_0 6 1612f7cc78ecSespie 1613f7cc78ecSespie #define PXDB_VERSION_2_1 1 1614f7cc78ecSespie 1615f7cc78ecSespie /* Header version for the case that there is no DOC info 1616*007c2a45Smiod but the executable has been processed by pxdb (the easy 1617*007c2a45Smiod case, from "cc -g"). */ 1618*007c2a45Smiod 1619*007c2a45Smiod typedef struct PXDB_struct 1620*007c2a45Smiod { 1621f7cc78ecSespie int pd_entries; /* # of entries in function look-up table */ 1622f7cc78ecSespie int fd_entries; /* # of entries in file look-up table */ 1623f7cc78ecSespie int md_entries; /* # of entries in module look-up table */ 1624f7cc78ecSespie unsigned int pxdbed : 1; /* 1 => file has been preprocessed */ 1625f7cc78ecSespie unsigned int bighdr : 1; /* 1 => this header contains 'time' word */ 1626f7cc78ecSespie unsigned int sa_header : 1;/* 1 => created by SA version of pxdb */ 1627f7cc78ecSespie /* used for version check in xdb */ 1628f7cc78ecSespie unsigned int inlined: 1; /* one or more functions have been inlined */ 1629f7cc78ecSespie unsigned int spare:12; 1630f7cc78ecSespie short version; /* pxdb header version */ 1631f7cc78ecSespie int globals; /* index into the DNTT where GNTT begins */ 1632f7cc78ecSespie unsigned int time; /* modify time of file before being pxdbed */ 1633f7cc78ecSespie int pg_entries; /* # of entries in label look-up table */ 1634f7cc78ecSespie int functions; /* actual number of functions */ 1635f7cc78ecSespie int files; /* actual number of files */ 1636f7cc78ecSespie int cd_entries; /* # of entries in class look-up table */ 1637f7cc78ecSespie int aa_entries; /* # of entries in addr alias look-up table */ 1638f7cc78ecSespie int oi_entries; /* # of entries in object id look-up table */ 1639f7cc78ecSespie } PXDB_header, *PXDB_header_ptr; 1640f7cc78ecSespie 1641f7cc78ecSespie /* Header version for the case that there is no DOC info and the 1642*007c2a45Smiod executable has NOT been processed by pxdb. */ 1643*007c2a45Smiod 1644*007c2a45Smiod typedef struct XDB_header_struct 1645*007c2a45Smiod { 1646f7cc78ecSespie long gntt_length; 1647f7cc78ecSespie long lntt_length; 1648f7cc78ecSespie long slt_length; 1649f7cc78ecSespie long vt_length; 1650f7cc78ecSespie long xt_length; 1651f7cc78ecSespie } XDB_header; 1652f7cc78ecSespie 1653f7cc78ecSespie /* Header version for the case that there is DOC info and the 1654*007c2a45Smiod executable has been processed by pxdb. */ 1655*007c2a45Smiod 1656*007c2a45Smiod typedef struct DOC_info_PXDB_header_struct 1657*007c2a45Smiod { 1658f7cc78ecSespie unsigned int xdb_header: 1; /* bit set if this is post-3.1 xdb */ 1659f7cc78ecSespie unsigned int doc_header: 1; /* bit set if this is doc-style header */ 1660f7cc78ecSespie unsigned int version: 8; /* version of pxdb see defines 1661*007c2a45Smiod PXDB_VERSION_* in this file. */ 1662f7cc78ecSespie unsigned int reserved_for_flags: 16;/* for future use; -- must be 1663*007c2a45Smiod set to zero. */ 1664f7cc78ecSespie unsigned int has_aux_pd_table: 1; /* $GNTT$ has aux PD table */ 1665f7cc78ecSespie unsigned int has_expr_table: 1; /* space has $EXPR$ */ 1666f7cc78ecSespie unsigned int has_range_table: 1; /* space has $RANGE$ */ 1667f7cc78ecSespie unsigned int has_context_table: 1; /* space has $SRC_CTXT$ */ 1668f7cc78ecSespie unsigned int has_lines_table: 1; /* space contains a $LINES$ 1669*007c2a45Smiod subspace for line tables. */ 1670f7cc78ecSespie unsigned int has_lt_offset_map: 1; /* space contains an lt_offset 1671*007c2a45Smiod subspace for line table mapping. */ 1672*007c2a45Smiod /* The following fields are the same as those in the PXDB_header in $DEBUG$ */ 1673f7cc78ecSespie int pd_entries; /* # of entries in function look-up table */ 1674f7cc78ecSespie int fd_entries; /* # of entries in file look-up table */ 1675f7cc78ecSespie int md_entries; /* # of entries in module look-up table */ 1676f7cc78ecSespie unsigned int pxdbed : 1; /* 1 => file has been preprocessed */ 1677f7cc78ecSespie unsigned int bighdr : 1; /* 1 => this header contains 'time' word */ 1678f7cc78ecSespie unsigned int sa_header : 1;/* 1 => created by SA version of pxdb */ 1679f7cc78ecSespie /* used for version check in xdb */ 1680f7cc78ecSespie unsigned int inlined: 1; /* one or more functions have been inlined */ 1681f7cc78ecSespie unsigned int spare : 28; 1682f7cc78ecSespie int globals; /* index into the DNTT where GNTT begins */ 1683f7cc78ecSespie unsigned int time; /* modify time of file before being pxdbed */ 1684f7cc78ecSespie int pg_entries; /* # of entries in label look-up table */ 1685f7cc78ecSespie int functions; /* actual number of functions */ 1686f7cc78ecSespie int files; /* actual number of files */ 1687f7cc78ecSespie int cd_entries; /* # of entries in class look-up table */ 1688f7cc78ecSespie int aa_entries; /* # of entries in addr alias look-up table */ 1689f7cc78ecSespie int oi_entries; /* # of entries in object id look-up table */ 1690f7cc78ecSespie } DOC_info_PXDB_header; 1691f7cc78ecSespie 1692f7cc78ecSespie /* Header version for the case that there is DOC info and the 1693*007c2a45Smiod executable has NOT been processed by pxdb. */ 1694*007c2a45Smiod 1695*007c2a45Smiod typedef struct DOC_info_header_struct 1696*007c2a45Smiod { 1697f7cc78ecSespie unsigned int xdb_header: 1; /* bit set if this is post-3.1 xdb */ 1698f7cc78ecSespie unsigned int doc_header: 1; /* bit set if this is doc-style header*/ 1699f7cc78ecSespie unsigned int version: 8; /* version of debug/header 1700f7cc78ecSespie format. For 10.0 the value 1701*007c2a45Smiod will be 1. For "Davis" the value is 2. */ 1702*007c2a45Smiod unsigned int reserved_for_flags: 18; /* for future use; -- must be set to zero. */ 1703*007c2a45Smiod unsigned int has_range_table: 1; /* space contains a $RANGE$ subspace for variable ranges. */ 1704*007c2a45Smiod unsigned int has_context_table: 1; /* space contains a $CTXT$ subspace for context/inline table. */ 1705*007c2a45Smiod unsigned int has_lines_table: 1; /* space contains a $LINES$ subspace for line tables. */ 1706*007c2a45Smiod unsigned int has_lt_offset_map: 1; /* space contains an lt_offset subspace for line table mapping. */ 1707f7cc78ecSespie 1708f7cc78ecSespie long gntt_length; /* same as old header */ 1709f7cc78ecSespie long lntt_length; /* same as old header */ 1710f7cc78ecSespie long slt_length; /* same as old header */ 1711f7cc78ecSespie long vt_length; /* same as old header */ 1712f7cc78ecSespie long xt_length; /* same as old header */ 1713f7cc78ecSespie long ctxt_length; /* present only if version >= 2 */ 1714f7cc78ecSespie long range_length; /* present only if version >= 2 */ 1715f7cc78ecSespie long expr_length; /* present only if version >= 2 */ 1716f7cc78ecSespie 1717f7cc78ecSespie } DOC_info_header; 1718f7cc78ecSespie 1719f7cc78ecSespie typedef union GenericDebugHeader_union 1720f7cc78ecSespie { 1721f7cc78ecSespie PXDB_header no_doc; 1722f7cc78ecSespie DOC_info_PXDB_header doc; 1723f7cc78ecSespie XDB_header no_pxdb_no_doc; 1724f7cc78ecSespie DOC_info_header no_pxdb_doc; 1725f7cc78ecSespie } GenericDebugHeader; 1726f7cc78ecSespie 1727f7cc78ecSespie 1728f7cc78ecSespie /* Procedure Descriptor: 1729*007c2a45Smiod An element of the procedure quick look-up table. */ 1730*007c2a45Smiod 1731*007c2a45Smiod typedef struct quick_procedure 1732*007c2a45Smiod { 1733*007c2a45Smiod long isym; /* 0-based index of first symbol 1734*007c2a45Smiod for procedure in $LNTT$, 1735*007c2a45Smiod i.e. the procedure itself. */ 1736f7cc78ecSespie CORE_ADDR adrStart; /* memory adr of start of proc */ 1737f7cc78ecSespie CORE_ADDR adrEnd; /* memory adr of end of proc */ 1738f7cc78ecSespie char *sbAlias; /* alias name of procedure */ 1739f7cc78ecSespie char *sbProc; /* real name of procedure */ 1740f7cc78ecSespie CORE_ADDR adrBp; /* address of entry breakpoint */ 1741f7cc78ecSespie CORE_ADDR adrExitBp; /* address of exit breakpoint */ 1742f7cc78ecSespie int icd; /* member of this class (index) */ 1743f7cc78ecSespie unsigned int ipd; /* index of template for this */ 1744f7cc78ecSespie /* function (index) */ 1745f7cc78ecSespie unsigned int unused: 5; 1746f7cc78ecSespie unsigned int no_lt_offset: 1;/* no entry in lt_offset table */ 1747f7cc78ecSespie unsigned int fTemplate: 1; /* function template */ 1748f7cc78ecSespie unsigned int fExpansion: 1; /* function expansion */ 1749f7cc78ecSespie unsigned int linked : 1; /* linked with other expansions */ 1750f7cc78ecSespie unsigned int duplicate: 1; /* clone of another procedure */ 1751f7cc78ecSespie unsigned int overloaded:1; /* overloaded function */ 1752f7cc78ecSespie unsigned int member: 1; /* class member function */ 1753f7cc78ecSespie unsigned int constructor:1; /* constructor function */ 1754f7cc78ecSespie unsigned int destructor:1; /* destructor function */ 1755f7cc78ecSespie unsigned int Static: 1; /* static function */ 1756f7cc78ecSespie unsigned int Virtual: 1; /* virtual function */ 1757f7cc78ecSespie unsigned int constant: 1; /* constant function */ 1758f7cc78ecSespie unsigned int pure: 1; /* pure (virtual) function */ 1759f7cc78ecSespie unsigned int language: 4; /* procedure's language */ 1760f7cc78ecSespie unsigned int inlined: 1; /* function has been inlined */ 1761f7cc78ecSespie unsigned int Operator: 1; /* operator function */ 1762f7cc78ecSespie unsigned int stub: 1; /* bodyless function */ 1763f7cc78ecSespie unsigned int optimize: 2; /* optimization level */ 1764f7cc78ecSespie unsigned int level: 5; /* nesting level (top=0) */ 1765f7cc78ecSespie } quick_procedure_entry, *quick_procedure_entry_ptr; 1766f7cc78ecSespie 1767f7cc78ecSespie /* Source File Descriptor: 1768*007c2a45Smiod An element of the source file quick look-up table. */ 1769*007c2a45Smiod 1770*007c2a45Smiod typedef struct quick_source 1771*007c2a45Smiod { 1772*007c2a45Smiod long isym; /* 0-based index in $LNTT$ of 1773*007c2a45Smiod first symbol for this file. */ 1774f7cc78ecSespie CORE_ADDR adrStart; /* mem adr of start of file's code */ 1775f7cc78ecSespie CORE_ADDR adrEnd; /* mem adr of end of file's code */ 1776f7cc78ecSespie char *sbFile; /* name of source file */ 1777f7cc78ecSespie unsigned int fHasDecl: 1; /* do we have a .d file? */ 1778f7cc78ecSespie unsigned int fWarned: 1; /* have warned about age problems? */ 1779f7cc78ecSespie unsigned int fSrcfile: 1; /* 0 => include 1=> source */ 1780f7cc78ecSespie unsigned short ilnMac; /* lines in file (0 if don't know) */ 1781*007c2a45Smiod int ipd; /* 0-based index of first procedure 1782*007c2a45Smiod in this file, in the quick 1783*007c2a45Smiod look-up table of procedures. */ 1784f7cc78ecSespie unsigned int *rgLn; /* line pointer array, if any */ 1785f7cc78ecSespie } quick_file_entry, *quick_file_entry_ptr; 1786f7cc78ecSespie 1787f7cc78ecSespie /* Module Descriptor: 1788*007c2a45Smiod An element of the module quick reference table. */ 1789*007c2a45Smiod 1790*007c2a45Smiod typedef struct quick_module 1791*007c2a45Smiod { 1792*007c2a45Smiod long isym; /* 0-based index of first 1793*007c2a45Smiod symbol for module. */ 1794f7cc78ecSespie CORE_ADDR adrStart; /* adr of start of mod. */ 1795f7cc78ecSespie CORE_ADDR adrEnd; /* adr of end of mod. */ 1796f7cc78ecSespie char *sbAlias; /* alias name of module */ 1797f7cc78ecSespie char *sbMod; /* real name of module */ 1798f7cc78ecSespie unsigned int imports: 1; /* module have any imports? */ 1799f7cc78ecSespie unsigned int vars_in_front: 1; /* module globals in front? */ 1800f7cc78ecSespie unsigned int vars_in_gaps: 1; /* module globals in gaps? */ 1801f7cc78ecSespie unsigned int language: 4; /* type of language */ 1802f7cc78ecSespie unsigned int unused : 25; 1803f7cc78ecSespie unsigned int unused2; /* space for future stuff */ 1804f7cc78ecSespie } quick_module_entry, *quick_module_entry_ptr; 1805f7cc78ecSespie 1806f7cc78ecSespie /* Auxiliary Procedure Descriptor: 1807*007c2a45Smiod An element of the auxiliary procedure quick look-up table. */ 1808*007c2a45Smiod 1809*007c2a45Smiod typedef struct quick_aux_procedure 1810*007c2a45Smiod { 1811f7cc78ecSespie long isym_inln; /* start on inline list for proc */ 1812f7cc78ecSespie long spare; 1813f7cc78ecSespie } quick_aux_procedure_entry, *quick_aux_procedure_entry_ptr; 1814f7cc78ecSespie 1815f7cc78ecSespie /* Paragraph Descriptor: 1816*007c2a45Smiod An element of the paragraph quick look-up table. */ 1817*007c2a45Smiod 1818*007c2a45Smiod typedef struct quick_paragraph 1819*007c2a45Smiod { 1820f7cc78ecSespie long isym; /* first symbol for label (index) */ 1821f7cc78ecSespie CORE_ADDR adrStart; /* memory adr of start of label */ 1822f7cc78ecSespie CORE_ADDR adrEnd; /* memory adr of end of label */ 1823f7cc78ecSespie char *sbLab; /* name of label */ 1824f7cc78ecSespie unsigned int inst; /* Used in xdb to store inst @ bp */ 1825f7cc78ecSespie unsigned int sect: 1; /* true = section, false = parag. */ 1826f7cc78ecSespie unsigned int unused: 31; /* future use */ 1827f7cc78ecSespie } quick_paragraph_entry, *quick_paragraph_entry_ptr; 1828f7cc78ecSespie 1829*007c2a45Smiod /* Class Descriptor: 1830*007c2a45Smiod An element of the class quick look-up table. */ 1831*007c2a45Smiod 1832*007c2a45Smiod typedef struct quick_class 1833*007c2a45Smiod { 1834f7cc78ecSespie char *sbClass; /* name of class */ 1835f7cc78ecSespie long isym; /* class symbol (tag) */ 1836f7cc78ecSespie unsigned int type : 2; /* 0=class, 1=union, 2=struct */ 1837f7cc78ecSespie unsigned int fTemplate : 1;/* class template */ 1838f7cc78ecSespie unsigned int expansion : 1;/* template expansion */ 1839f7cc78ecSespie unsigned int unused :28; 1840f7cc78ecSespie sltpointer lowscope; /* beginning of defined scope */ 1841f7cc78ecSespie sltpointer hiscope; /* end of defined scope */ 1842f7cc78ecSespie } quick_class_entry, *quick_class_entry_ptr; 1843f7cc78ecSespie 1844f7cc78ecSespie /* Address Alias Entry 1845*007c2a45Smiod An element of the address alias quick look-up table. */ 1846*007c2a45Smiod 1847*007c2a45Smiod typedef struct quick_alias 1848*007c2a45Smiod { 1849f7cc78ecSespie CORE_ADDR low; 1850f7cc78ecSespie CORE_ADDR high; 1851f7cc78ecSespie int index; 1852f7cc78ecSespie unsigned int unused : 31; 1853f7cc78ecSespie unsigned int alternate : 1; /* alternate unnamed aliases? */ 1854f7cc78ecSespie } quick_alias_entry, *quick_alias_entry_ptr; 1855f7cc78ecSespie 1856f7cc78ecSespie /* Object Identification Entry 1857*007c2a45Smiod An element of the object identification quick look-up table. */ 1858f7cc78ecSespie 1859*007c2a45Smiod typedef struct quick_obj_ID 1860*007c2a45Smiod { 1861f7cc78ecSespie CORE_ADDR obj_ident; /* class identifier */ 1862f7cc78ecSespie long isym; /* class symbol */ 1863f7cc78ecSespie long offset; /* offset to object start */ 1864f7cc78ecSespie } quick_obj_ID_entry, *quick_obj_ID_entry_ptr; 1865f7cc78ecSespie 18662159047fSniklas #endif /* HP_SYMTAB_INCLUDED */ 1867