198b9484cSchristos /* Definitions and structures for reading debug symbols from the 298b9484cSchristos native HP C compiler. 398b9484cSchristos 498b9484cSchristos Written by the Center for Software Science at the University of Utah 598b9484cSchristos and by Cygnus Support. 698b9484cSchristos 7*e663ba6eSchristos Copyright (C) 1994-2024 Free Software Foundation, Inc. 898b9484cSchristos 998b9484cSchristos This program is free software; you can redistribute it and/or modify 1098b9484cSchristos it under the terms of the GNU General Public License as published by 1198b9484cSchristos the Free Software Foundation; either version 3 of the License, or 1298b9484cSchristos (at your option) any later version. 1398b9484cSchristos 1498b9484cSchristos This program is distributed in the hope that it will be useful, 1598b9484cSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 1698b9484cSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1798b9484cSchristos GNU General Public License for more details. 1898b9484cSchristos 1998b9484cSchristos You should have received a copy of the GNU General Public License 2098b9484cSchristos along with this program; if not, write to the Free Software 2198b9484cSchristos Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 2298b9484cSchristos MA 02110-1301, USA. */ 2398b9484cSchristos 2498b9484cSchristos #ifndef HP_SYMTAB_INCLUDED 2598b9484cSchristos #define HP_SYMTAB_INCLUDED 2698b9484cSchristos 2798b9484cSchristos /* General information: 2898b9484cSchristos 2998b9484cSchristos This header file defines and describes only the data structures 3098b9484cSchristos necessary to read debug symbols produced by the HP C compiler, 3198b9484cSchristos HP ANSI C++ compiler, and HP FORTRAN 90 compiler using the 3298b9484cSchristos SOM object file format. 3398b9484cSchristos (For a full description of the debug format, ftp hpux-symtab.h from 3498b9484cSchristos jaguar.cs.utah.edu:/dist). 3598b9484cSchristos 3698b9484cSchristos Additional notes (Rich Title) 3798b9484cSchristos This file is a reverse-engineered version of a file called 3898b9484cSchristos "symtab.h" which exists internal to HP's Computer Languages Organization 3998b9484cSchristos in /CLO/Components/DDE/obj/som/symtab.h. Because HP's version of 4098b9484cSchristos the file is copyrighted and not distributed, it is necessary for 4198b9484cSchristos GDB to use the reverse-engineered version that follows. 4298b9484cSchristos Work was done by Cygnus to reverse-engineer the C subset of symtab.h. 4398b9484cSchristos The WDB project has extended this to also contain the C++ 4498b9484cSchristos symbol definitions, the F90 symbol definitions, 4598b9484cSchristos and the DOC (debugging-optimized-code) symbol definitions. 4698b9484cSchristos In some cases (the C++ symbol definitions) 4798b9484cSchristos I have added internal documentation here that 4898b9484cSchristos goes beyond what is supplied in HP's symtab.h. If we someday 4998b9484cSchristos unify these files again, the extra comments should be merged back 5098b9484cSchristos into HP's symtab.h. 5198b9484cSchristos 5298b9484cSchristos ------------------------------------------------------------------- 5398b9484cSchristos 5498b9484cSchristos Debug symbols are contained entirely within an unloadable space called 5598b9484cSchristos $DEBUG$. $DEBUG$ contains several subspaces which group related 5698b9484cSchristos debug symbols. 5798b9484cSchristos 5898b9484cSchristos $GNTT$ contains information for global variables, types and contants. 5998b9484cSchristos 6098b9484cSchristos $LNTT$ contains information for procedures (including nesting), scoping 6198b9484cSchristos information, local variables, types, and constants. 6298b9484cSchristos 6398b9484cSchristos $SLT$ contains source line information so that code addresses may be 6498b9484cSchristos mapped to source lines. 6598b9484cSchristos 6698b9484cSchristos $VT$ contains various strings and constants for named objects (variables, 6798b9484cSchristos typedefs, functions, etc). Strings are stored as null-terminated character 6898b9484cSchristos lists. Constants always begin on word boundaries. The first byte of 6998b9484cSchristos the VT must be zero (a null string). 7098b9484cSchristos 7198b9484cSchristos $XT$ is not currently used by GDB. 7298b9484cSchristos 7398b9484cSchristos Many structures within the subspaces point to other structures within 7498b9484cSchristos the same subspace, or to structures within a different subspace. These 7598b9484cSchristos pointers are represented as a structure index from the beginning of 7698b9484cSchristos the appropriate subspace. */ 7798b9484cSchristos 7898b9484cSchristos /* Used to describe where a constant is stored. */ 7998b9484cSchristos enum location_type 8098b9484cSchristos { 8198b9484cSchristos LOCATION_IMMEDIATE, 8298b9484cSchristos LOCATION_PTR, 8398b9484cSchristos LOCATION_VT, 8498b9484cSchristos }; 8598b9484cSchristos 8698b9484cSchristos /* Languages supported by this debug format. Within the data structures 8798b9484cSchristos this type is limited to 4 bits for a maximum of 16 languages. */ 8898b9484cSchristos enum hp_language 8998b9484cSchristos { 9098b9484cSchristos HP_LANGUAGE_UNKNOWN, 9198b9484cSchristos HP_LANGUAGE_C, 9298b9484cSchristos HP_LANGUAGE_FORTRAN, 9398b9484cSchristos HP_LANGUAGE_F77 = HP_LANGUAGE_FORTRAN, 9498b9484cSchristos HP_LANGUAGE_PASCAL, 9598b9484cSchristos HP_LANGUAGE_MODCAL, 9698b9484cSchristos HP_LANGUAGE_COBOL, 9798b9484cSchristos HP_LANGUAGE_BASIC, 9898b9484cSchristos HP_LANGUAGE_ADA, 9998b9484cSchristos HP_LANGUAGE_CPLUSPLUS, 10098b9484cSchristos HP_LANGUAGE_DMPASCAL 10198b9484cSchristos }; 10298b9484cSchristos 10398b9484cSchristos 10498b9484cSchristos /* Basic data types available in this debug format. Within the data 10598b9484cSchristos structures this type is limited to 5 bits for a maximum of 32 basic 10698b9484cSchristos data types. */ 10798b9484cSchristos enum hp_type 10898b9484cSchristos { 10998b9484cSchristos HP_TYPE_UNDEFINED, /* 0 */ 11098b9484cSchristos HP_TYPE_BOOLEAN, /* 1 */ 11198b9484cSchristos HP_TYPE_CHAR, /* 2 */ 11298b9484cSchristos HP_TYPE_INT, /* 3 */ 11398b9484cSchristos HP_TYPE_UNSIGNED_INT, /* 4 */ 11498b9484cSchristos HP_TYPE_REAL, /* 5 */ 11598b9484cSchristos HP_TYPE_COMPLEX, /* 6 */ 11698b9484cSchristos HP_TYPE_STRING200, /* 7 */ 11798b9484cSchristos HP_TYPE_LONGSTRING200, /* 8 */ 11898b9484cSchristos HP_TYPE_TEXT, /* 9 */ 11998b9484cSchristos HP_TYPE_FLABEL, /* 10 */ 12098b9484cSchristos HP_TYPE_FTN_STRING_SPEC, /* 11 */ 12198b9484cSchristos HP_TYPE_MOD_STRING_SPEC, /* 12 */ 12298b9484cSchristos HP_TYPE_PACKED_DECIMAL, /* 13 */ 12398b9484cSchristos HP_TYPE_REAL_3000, /* 14 */ 12498b9484cSchristos HP_TYPE_MOD_STRING_3000, /* 15 */ 12598b9484cSchristos HP_TYPE_ANYPOINTER, /* 16 */ 12698b9484cSchristos HP_TYPE_GLOBAL_ANYPOINTER, /* 17 */ 12798b9484cSchristos HP_TYPE_LOCAL_ANYPOINTER, /* 18 */ 12898b9484cSchristos HP_TYPE_COMPLEXS3000, /* 19 */ 12998b9484cSchristos HP_TYPE_FTN_STRING_S300_COMPAT, /* 20 */ 13098b9484cSchristos HP_TYPE_FTN_STRING_VAX_COMPAT, /* 21 */ 13198b9484cSchristos HP_TYPE_BOOLEAN_S300_COMPAT, /* 22 */ 13298b9484cSchristos HP_TYPE_BOOLEAN_VAX_COMPAT, /* 23 */ 13398b9484cSchristos HP_TYPE_WIDE_CHAR, /* 24 */ 13498b9484cSchristos HP_TYPE_LONG, /* 25 */ 13598b9484cSchristos HP_TYPE_UNSIGNED_LONG, /* 26 */ 13698b9484cSchristos HP_TYPE_DOUBLE, /* 27 */ 13798b9484cSchristos HP_TYPE_TEMPLATE_ARG, /* 28 */ 13898b9484cSchristos HP_TYPE_VOID /* 29 */ 13998b9484cSchristos }; 14098b9484cSchristos 14198b9484cSchristos /* An immediate name and type table entry. 14298b9484cSchristos 14398b9484cSchristos extension and immediate will always be one. 14498b9484cSchristos global will always be zero. 14598b9484cSchristos hp_type is the basic type this entry describes. 14698b9484cSchristos bitlength is the length in bits for the basic type. */ 14798b9484cSchristos struct dnttp_immediate 14898b9484cSchristos { 14998b9484cSchristos unsigned int extension: 1; 15098b9484cSchristos unsigned int immediate: 1; 15198b9484cSchristos unsigned int global: 1; 15298b9484cSchristos unsigned int type: 5; 15398b9484cSchristos unsigned int bitlength: 24; 15498b9484cSchristos }; 15598b9484cSchristos 15698b9484cSchristos /* A nonimmediate name and type table entry. 15798b9484cSchristos 15898b9484cSchristos extension will always be one. 15998b9484cSchristos immediate will always be zero. 16098b9484cSchristos if global is zero, this entry points into the LNTT 16198b9484cSchristos if global is one, this entry points into the GNTT 16298b9484cSchristos index is the index within the GNTT or LNTT for this entry. */ 16398b9484cSchristos struct dnttp_nonimmediate 16498b9484cSchristos { 16598b9484cSchristos unsigned int extension: 1; 16698b9484cSchristos unsigned int immediate: 1; 16798b9484cSchristos unsigned int global: 1; 16898b9484cSchristos unsigned int index: 29; 16998b9484cSchristos }; 17098b9484cSchristos 17198b9484cSchristos /* A pointer to an entry in the GNTT and LNTT tables. It has two 17298b9484cSchristos forms depending on the type being described. 17398b9484cSchristos 17498b9484cSchristos The immediate form is used for simple entries and is one 17598b9484cSchristos word. 17698b9484cSchristos 17798b9484cSchristos The nonimmediate form is used for complex entries and contains 17898b9484cSchristos an index into the LNTT or GNTT which describes the entire type. 17998b9484cSchristos 18098b9484cSchristos If a dnttpointer is -1, then it is a NIL entry. */ 18198b9484cSchristos 18298b9484cSchristos #define DNTTNIL (-1) 18398b9484cSchristos typedef union dnttpointer 18498b9484cSchristos { 18598b9484cSchristos struct dnttp_immediate dntti; 18698b9484cSchristos struct dnttp_nonimmediate dnttp; 18798b9484cSchristos int word; 18898b9484cSchristos } dnttpointer; 18998b9484cSchristos 19098b9484cSchristos /* An index into the source line table. As with dnttpointers, a sltpointer 19198b9484cSchristos of -1 indicates a NIL entry. */ 19298b9484cSchristos #define SLTNIL (-1) 19398b9484cSchristos typedef int sltpointer; 19498b9484cSchristos 19598b9484cSchristos /* Index into DOC (= "Debugging Optimized Code") line table. */ 19698b9484cSchristos #define LTNIL (-1) 19798b9484cSchristos typedef int ltpointer; 19898b9484cSchristos 19998b9484cSchristos /* Index into context table. */ 20098b9484cSchristos #define CTXTNIL (-1) 20198b9484cSchristos typedef int ctxtpointer; 20298b9484cSchristos 20398b9484cSchristos /* Unsigned byte offset into the VT. */ 20498b9484cSchristos typedef unsigned int vtpointer; 20598b9484cSchristos 20698b9484cSchristos /* A DNTT entry (used within the GNTT and LNTT). 20798b9484cSchristos 20898b9484cSchristos DNTT entries are variable sized objects, but are always a multiple 20998b9484cSchristos of 3 words (we call each group of 3 words a "block"). 21098b9484cSchristos 21198b9484cSchristos The first bit in each block is an extension bit. This bit is zero 21298b9484cSchristos for the first block of a DNTT entry. If the entry requires more 21398b9484cSchristos than one block, then this bit is set to one in all blocks after 21498b9484cSchristos the first one. */ 21598b9484cSchristos 21698b9484cSchristos /* Each DNTT entry describes a particular debug symbol (beginning of 21798b9484cSchristos a source file, a function, variables, structures, etc. 21898b9484cSchristos 21998b9484cSchristos The type of the DNTT entry is stored in the "kind" field within the 22098b9484cSchristos DNTT entry itself. */ 22198b9484cSchristos 22298b9484cSchristos enum dntt_entry_type 22398b9484cSchristos { 22498b9484cSchristos DNTT_TYPE_NIL = -1, 22598b9484cSchristos DNTT_TYPE_SRCFILE, 22698b9484cSchristos DNTT_TYPE_MODULE, 22798b9484cSchristos DNTT_TYPE_FUNCTION, 22898b9484cSchristos DNTT_TYPE_ENTRY, 22998b9484cSchristos DNTT_TYPE_BEGIN, 23098b9484cSchristos DNTT_TYPE_END, 23198b9484cSchristos DNTT_TYPE_IMPORT, 23298b9484cSchristos DNTT_TYPE_LABEL, 23398b9484cSchristos DNTT_TYPE_FPARAM, 23498b9484cSchristos DNTT_TYPE_SVAR, 23598b9484cSchristos DNTT_TYPE_DVAR, 23698b9484cSchristos DNTT_TYPE_HOLE1, 23798b9484cSchristos DNTT_TYPE_CONST, 23898b9484cSchristos DNTT_TYPE_TYPEDEF, 23998b9484cSchristos DNTT_TYPE_TAGDEF, 24098b9484cSchristos DNTT_TYPE_POINTER, 24198b9484cSchristos DNTT_TYPE_ENUM, 24298b9484cSchristos DNTT_TYPE_MEMENUM, 24398b9484cSchristos DNTT_TYPE_SET, 24498b9484cSchristos DNTT_TYPE_SUBRANGE, 24598b9484cSchristos DNTT_TYPE_ARRAY, 24698b9484cSchristos DNTT_TYPE_STRUCT, 24798b9484cSchristos DNTT_TYPE_UNION, 24898b9484cSchristos DNTT_TYPE_FIELD, 24998b9484cSchristos DNTT_TYPE_VARIANT, 25098b9484cSchristos DNTT_TYPE_FILE, 25198b9484cSchristos DNTT_TYPE_FUNCTYPE, 25298b9484cSchristos DNTT_TYPE_WITH, 25398b9484cSchristos DNTT_TYPE_COMMON, 25498b9484cSchristos DNTT_TYPE_COBSTRUCT, 25598b9484cSchristos DNTT_TYPE_XREF, 25698b9484cSchristos DNTT_TYPE_SA, 25798b9484cSchristos DNTT_TYPE_MACRO, 25898b9484cSchristos DNTT_TYPE_BLOCKDATA, 25998b9484cSchristos DNTT_TYPE_CLASS_SCOPE, 26098b9484cSchristos DNTT_TYPE_REFERENCE, 26198b9484cSchristos DNTT_TYPE_PTRMEM, 26298b9484cSchristos DNTT_TYPE_PTRMEMFUNC, 26398b9484cSchristos DNTT_TYPE_CLASS, 26498b9484cSchristos DNTT_TYPE_GENFIELD, 26598b9484cSchristos DNTT_TYPE_VFUNC, 26698b9484cSchristos DNTT_TYPE_MEMACCESS, 26798b9484cSchristos DNTT_TYPE_INHERITANCE, 26898b9484cSchristos DNTT_TYPE_FRIEND_CLASS, 26998b9484cSchristos DNTT_TYPE_FRIEND_FUNC, 27098b9484cSchristos DNTT_TYPE_MODIFIER, 27198b9484cSchristos DNTT_TYPE_OBJECT_ID, 27298b9484cSchristos DNTT_TYPE_MEMFUNC, 27398b9484cSchristos DNTT_TYPE_TEMPLATE, 27498b9484cSchristos DNTT_TYPE_TEMPLATE_ARG, 27598b9484cSchristos DNTT_TYPE_FUNC_TEMPLATE, 27698b9484cSchristos DNTT_TYPE_LINK, 27798b9484cSchristos DNTT_TYPE_DYN_ARRAY_DESC, 27898b9484cSchristos DNTT_TYPE_DESC_SUBRANGE, 27998b9484cSchristos DNTT_TYPE_BEGIN_EXT, 28098b9484cSchristos DNTT_TYPE_INLN, 28198b9484cSchristos DNTT_TYPE_INLN_LIST, 28298b9484cSchristos DNTT_TYPE_ALIAS, 28398b9484cSchristos DNTT_TYPE_DOC_FUNCTION, 28498b9484cSchristos DNTT_TYPE_DOC_MEMFUNC, 28598b9484cSchristos DNTT_TYPE_MAX 28698b9484cSchristos }; 28798b9484cSchristos 28898b9484cSchristos /* DNTT_TYPE_SRCFILE: 28998b9484cSchristos 29098b9484cSchristos One DNTT_TYPE_SRCFILE symbol is output for the start of each source 29198b9484cSchristos file and at the begin and end of an included file. A DNTT_TYPE_SRCFILE 29298b9484cSchristos entry is also output before each DNTT_TYPE_FUNC symbol so that debuggers 29398b9484cSchristos can determine what file a function was defined in. 29498b9484cSchristos 29598b9484cSchristos LANGUAGE describes the source file's language. 29698b9484cSchristos 29798b9484cSchristos NAME points to an VT entry providing the source file's name. 29898b9484cSchristos 29998b9484cSchristos Note the name used for DNTT_TYPE_SRCFILE entries are exactly as seen 30098b9484cSchristos by the compiler (ie they may be relative or absolute). C include files 30198b9484cSchristos via <> inclusion must use absolute paths. 30298b9484cSchristos 30398b9484cSchristos ADDRESS points to an SLT entry from which line number and code locations 30498b9484cSchristos may be determined. */ 30598b9484cSchristos 30698b9484cSchristos struct dntt_type_srcfile 30798b9484cSchristos { 30898b9484cSchristos unsigned int extension: 1; 30998b9484cSchristos unsigned int kind: 10; /* DNTT_TYPE_SRCFILE */ 31098b9484cSchristos unsigned int language: 4; 31198b9484cSchristos unsigned int unused: 17; 31298b9484cSchristos vtpointer name; 31398b9484cSchristos sltpointer address; 31498b9484cSchristos }; 31598b9484cSchristos 31698b9484cSchristos /* DNTT_TYPE_MODULE: 31798b9484cSchristos 31898b9484cSchristos A DNTT_TYPE_MODULE symbol is emitted for the start of a pascal 31998b9484cSchristos module or C source file. A module indicates a compilation unit 32098b9484cSchristos for name-scoping purposes; in that regard there should be 32198b9484cSchristos a 1-1 correspondence between GDB "symtab"'s and MODULE symbol records. 32298b9484cSchristos 32398b9484cSchristos Each DNTT_TYPE_MODULE must have an associated DNTT_TYPE_END symbol. 32498b9484cSchristos 32598b9484cSchristos NAME points to a VT entry providing the module's name. Note C 32698b9484cSchristos source files are considered nameless modules. 32798b9484cSchristos 32898b9484cSchristos ALIAS point to a VT entry providing a secondary name. 32998b9484cSchristos 33098b9484cSchristos ADDRESS points to an SLT entry from which line number and code locations 33198b9484cSchristos may be determined. */ 33298b9484cSchristos 33398b9484cSchristos struct dntt_type_module 33498b9484cSchristos { 33598b9484cSchristos unsigned int extension: 1; 33698b9484cSchristos unsigned int kind: 10; /* DNTT_TYPE_MODULE */ 33798b9484cSchristos unsigned int unused: 21; 33898b9484cSchristos vtpointer name; 33998b9484cSchristos vtpointer alias; 34098b9484cSchristos dnttpointer unused2; 34198b9484cSchristos sltpointer address; 34298b9484cSchristos }; 34398b9484cSchristos 34498b9484cSchristos /* DNTT_TYPE_FUNCTION, 34598b9484cSchristos DNTT_TYPE_ENTRY, 34698b9484cSchristos DNTT_TYPE_BLOCKDATA, 34798b9484cSchristos DNTT_TYPE_MEMFUNC: 34898b9484cSchristos 34998b9484cSchristos A DNTT_TYPE_FUNCTION symbol is emitted for each function definition; 35098b9484cSchristos a DNTT_TYPE_ENTRY symbols is used for secondary entry points. Both 35198b9484cSchristos symbols used the dntt_type_function structure. 35298b9484cSchristos A DNTT_TYPE_BLOCKDATA symbol is emitted ...? 35398b9484cSchristos A DNTT_TYPE_MEMFUNC symbol is emitted for inlined member functions (C++). 35498b9484cSchristos 35598b9484cSchristos Each of DNTT_TYPE_FUNCTION must have a matching DNTT_TYPE_END. 35698b9484cSchristos 35798b9484cSchristos GLOBAL is nonzero if the function has global scope. 35898b9484cSchristos 35998b9484cSchristos LANGUAGE describes the function's source language. 36098b9484cSchristos 36198b9484cSchristos OPT_LEVEL describes the optimization level the function was compiled 36298b9484cSchristos with. 36398b9484cSchristos 36498b9484cSchristos VARARGS is nonzero if the function uses varargs. 36598b9484cSchristos 36698b9484cSchristos NAME points to a VT entry providing the function's name. 36798b9484cSchristos 36898b9484cSchristos ALIAS points to a VT entry providing a secondary name for the function. 36998b9484cSchristos 37098b9484cSchristos FIRSTPARAM points to a LNTT entry which describes the parameter list. 37198b9484cSchristos 37298b9484cSchristos ADDRESS points to an SLT entry from which line number and code locations 37398b9484cSchristos may be determined. 37498b9484cSchristos 37598b9484cSchristos ENTRYADDR is the memory address corresponding the function's entry point 37698b9484cSchristos 37798b9484cSchristos RETVAL points to a LNTT entry describing the function's return value. 37898b9484cSchristos 37998b9484cSchristos LOWADDR is the lowest memory address associated with this function. 38098b9484cSchristos 38198b9484cSchristos HIADDR is the highest memory address associated with this function. */ 38298b9484cSchristos 38398b9484cSchristos struct dntt_type_function 38498b9484cSchristos { 38598b9484cSchristos unsigned int extension: 1; 38698b9484cSchristos unsigned int kind: 10; /* DNTT_TYPE_FUNCTION, 38798b9484cSchristos DNTT_TYPE_ENTRY, 38898b9484cSchristos DNTT_TYPE_BLOCKDATA 38998b9484cSchristos or DNTT_TYPE_MEMFUNC */ 39098b9484cSchristos unsigned int global: 1; 39198b9484cSchristos unsigned int language: 4; 39298b9484cSchristos unsigned int nest_level: 5; 39398b9484cSchristos unsigned int opt_level: 2; 39498b9484cSchristos unsigned int varargs: 1; 39598b9484cSchristos unsigned int lang_info: 4; 39698b9484cSchristos unsigned int inlined: 1; 39798b9484cSchristos unsigned int localalloc: 1; 39898b9484cSchristos unsigned int expansion: 1; 39998b9484cSchristos unsigned int unused: 1; 40098b9484cSchristos vtpointer name; 40198b9484cSchristos vtpointer alias; 40298b9484cSchristos dnttpointer firstparam; 40398b9484cSchristos sltpointer address; 40498b9484cSchristos CORE_ADDR entryaddr; 40598b9484cSchristos dnttpointer retval; 40698b9484cSchristos CORE_ADDR lowaddr; 40798b9484cSchristos CORE_ADDR hiaddr; 40898b9484cSchristos }; 40998b9484cSchristos 41098b9484cSchristos /* DNTT_TYPE_BEGIN: 41198b9484cSchristos 41298b9484cSchristos A DNTT_TYPE_BEGIN symbol is emitted to begin a new nested scope. 41398b9484cSchristos Every DNTT_TYPE_BEGIN symbol must have a matching DNTT_TYPE_END symbol. 41498b9484cSchristos 41598b9484cSchristos CLASSFLAG is nonzero if this is the beginning of a c++ class definition. 41698b9484cSchristos 41798b9484cSchristos ADDRESS points to an SLT entry from which line number and code locations 41898b9484cSchristos may be determined. */ 41998b9484cSchristos 42098b9484cSchristos struct dntt_type_begin 42198b9484cSchristos { 42298b9484cSchristos unsigned int extension: 1; 42398b9484cSchristos unsigned int kind: 10; 42498b9484cSchristos unsigned int classflag: 1; 42598b9484cSchristos unsigned int unused: 20; 42698b9484cSchristos sltpointer address; 42798b9484cSchristos }; 42898b9484cSchristos 42998b9484cSchristos /* DNTT_TYPE_END: 43098b9484cSchristos 43198b9484cSchristos A DNTT_TYPE_END symbol is emitted when closing a scope started by 43298b9484cSchristos a DNTT_TYPE_MODULE, DNTT_TYPE_FUNCTION, DNTT_TYPE_WITH, 43398b9484cSchristos DNTT_TYPE_COMMON, DNTT_TYPE_BEGIN, and DNTT_TYPE_CLASS_SCOPE symbols. 43498b9484cSchristos 43598b9484cSchristos ENDKIND describes what type of scope the DNTT_TYPE_END is closing 43698b9484cSchristos (one of the above 6 kinds). 43798b9484cSchristos 43898b9484cSchristos CLASSFLAG is nonzero if this is the end of a c++ class definition. 43998b9484cSchristos 44098b9484cSchristos ADDRESS points to an SLT entry from which line number and code locations 44198b9484cSchristos may be determined. 44298b9484cSchristos 44398b9484cSchristos BEGINSCOPE points to the LNTT entry which opened the scope. */ 44498b9484cSchristos 44598b9484cSchristos struct dntt_type_end 44698b9484cSchristos { 44798b9484cSchristos unsigned int extension: 1; 44898b9484cSchristos unsigned int kind: 10; 44998b9484cSchristos unsigned int endkind: 10; 45098b9484cSchristos unsigned int classflag: 1; 45198b9484cSchristos unsigned int unused: 10; 45298b9484cSchristos sltpointer address; 45398b9484cSchristos dnttpointer beginscope; 45498b9484cSchristos }; 45598b9484cSchristos 45698b9484cSchristos /* DNTT_TYPE_IMPORT is unused by GDB. */ 45798b9484cSchristos /* DNTT_TYPE_LABEL is unused by GDB. */ 45898b9484cSchristos 45998b9484cSchristos /* DNTT_TYPE_FPARAM: 46098b9484cSchristos 46198b9484cSchristos A DNTT_TYPE_FPARAM symbol is emitted for a function argument. When 46298b9484cSchristos chained together the symbols represent an argument list for a function. 46398b9484cSchristos 46498b9484cSchristos REGPARAM is nonzero if this parameter was passed in a register. 46598b9484cSchristos 46698b9484cSchristos INDIRECT is nonzero if this parameter is a pointer to the parameter 46798b9484cSchristos (pass by reference or pass by value for large items). 46898b9484cSchristos 46998b9484cSchristos LONGADDR is nonzero if the parameter is a 64bit pointer. 47098b9484cSchristos 47198b9484cSchristos NAME is a pointer into the VT for the parameter's name. 47298b9484cSchristos 47398b9484cSchristos LOCATION describes where the parameter is stored. Depending on the 47498b9484cSchristos parameter type LOCATION could be a register number, or an offset 47598b9484cSchristos from the stack pointer. 47698b9484cSchristos 47798b9484cSchristos TYPE points to a NTT entry describing the type of this parameter. 47898b9484cSchristos 47998b9484cSchristos NEXTPARAM points to the LNTT entry describing the next parameter. */ 48098b9484cSchristos 48198b9484cSchristos struct dntt_type_fparam 48298b9484cSchristos { 48398b9484cSchristos unsigned int extension: 1; 48498b9484cSchristos unsigned int kind: 10; 48598b9484cSchristos unsigned int regparam: 1; 48698b9484cSchristos unsigned int indirect: 1; 48798b9484cSchristos unsigned int longaddr: 1; 48898b9484cSchristos unsigned int copyparam: 1; 48998b9484cSchristos unsigned int dflt: 1; 49098b9484cSchristos unsigned int doc_ranges: 1; 49198b9484cSchristos unsigned int misc_kind: 1; 49298b9484cSchristos unsigned int unused: 14; 49398b9484cSchristos vtpointer name; 49498b9484cSchristos CORE_ADDR location; 49598b9484cSchristos dnttpointer type; 49698b9484cSchristos dnttpointer nextparam; 49798b9484cSchristos int misc; 49898b9484cSchristos }; 49998b9484cSchristos 50098b9484cSchristos /* DNTT_TYPE_SVAR: 50198b9484cSchristos 50298b9484cSchristos A DNTT_TYPE_SVAR is emitted to describe a variable in static storage. 50398b9484cSchristos 50498b9484cSchristos GLOBAL is nonzero if the variable has global scope. 50598b9484cSchristos 50698b9484cSchristos INDIRECT is nonzero if the variable is a pointer to an object. 50798b9484cSchristos 50898b9484cSchristos LONGADDR is nonzero if the variable is in long pointer space. 50998b9484cSchristos 51098b9484cSchristos STATICMEM is nonzero if the variable is a member of a class. 51198b9484cSchristos 51298b9484cSchristos A_UNION is nonzero if the variable is an anonymous union member. 51398b9484cSchristos 51498b9484cSchristos NAME is a pointer into the VT for the variable's name. 51598b9484cSchristos 51698b9484cSchristos LOCATION provides the memory address for the variable. 51798b9484cSchristos 51898b9484cSchristos TYPE is a pointer into either the GNTT or LNTT which describes 51998b9484cSchristos the type of this variable. */ 52098b9484cSchristos 52198b9484cSchristos struct dntt_type_svar 52298b9484cSchristos { 52398b9484cSchristos unsigned int extension: 1; 52498b9484cSchristos unsigned int kind: 10; 52598b9484cSchristos unsigned int global: 1; 52698b9484cSchristos unsigned int indirect: 1; 52798b9484cSchristos unsigned int longaddr: 1; 52898b9484cSchristos unsigned int staticmem: 1; 52998b9484cSchristos unsigned int a_union: 1; 53098b9484cSchristos unsigned int unused1: 1; 53198b9484cSchristos unsigned int thread_specific: 1; 53298b9484cSchristos unsigned int unused2: 14; 53398b9484cSchristos vtpointer name; 53498b9484cSchristos CORE_ADDR location; 53598b9484cSchristos dnttpointer type; 53698b9484cSchristos unsigned int offset; 53798b9484cSchristos unsigned int displacement; 53898b9484cSchristos }; 53998b9484cSchristos 54098b9484cSchristos /* DNTT_TYPE_DVAR: 54198b9484cSchristos 54298b9484cSchristos A DNTT_TYPE_DVAR is emitted to describe automatic variables and variables 54398b9484cSchristos held in registers. 54498b9484cSchristos 54598b9484cSchristos GLOBAL is nonzero if the variable has global scope. 54698b9484cSchristos 54798b9484cSchristos INDIRECT is nonzero if the variable is a pointer to an object. 54898b9484cSchristos 54998b9484cSchristos REGVAR is nonzero if the variable is in a register. 55098b9484cSchristos 55198b9484cSchristos A_UNION is nonzero if the variable is an anonymous union member. 55298b9484cSchristos 55398b9484cSchristos NAME is a pointer into the VT for the variable's name. 55498b9484cSchristos 55598b9484cSchristos LOCATION provides the memory address or register number for the variable. 55698b9484cSchristos 55798b9484cSchristos TYPE is a pointer into either the GNTT or LNTT which describes 55898b9484cSchristos the type of this variable. */ 55998b9484cSchristos 56098b9484cSchristos struct dntt_type_dvar 56198b9484cSchristos { 56298b9484cSchristos unsigned int extension: 1; 56398b9484cSchristos unsigned int kind: 10; 56498b9484cSchristos unsigned int global: 1; 56598b9484cSchristos unsigned int indirect: 1; 56698b9484cSchristos unsigned int regvar: 1; 56798b9484cSchristos unsigned int a_union: 1; 56898b9484cSchristos unsigned int unused: 17; 56998b9484cSchristos vtpointer name; 57098b9484cSchristos int location; 57198b9484cSchristos dnttpointer type; 57298b9484cSchristos unsigned int offset; 57398b9484cSchristos }; 57498b9484cSchristos 57598b9484cSchristos /* DNTT_TYPE_CONST: 57698b9484cSchristos 57798b9484cSchristos A DNTT_TYPE_CONST symbol is emitted for program constants. 57898b9484cSchristos 57998b9484cSchristos GLOBAL is nonzero if the constant has global scope. 58098b9484cSchristos 58198b9484cSchristos INDIRECT is nonzero if the constant is a pointer to an object. 58298b9484cSchristos 58398b9484cSchristos LOCATION_TYPE describes where to find the constant's value 58498b9484cSchristos (in the VT, memory, or embedded in an instruction). 58598b9484cSchristos 58698b9484cSchristos CLASSMEM is nonzero if the constant is a member of a class. 58798b9484cSchristos 58898b9484cSchristos NAME is a pointer into the VT for the constant's name. 58998b9484cSchristos 59098b9484cSchristos LOCATION provides the memory address, register number or pointer 59198b9484cSchristos into the VT for the constant's value. 59298b9484cSchristos 59398b9484cSchristos TYPE is a pointer into either the GNTT or LNTT which describes 59498b9484cSchristos the type of this variable. */ 59598b9484cSchristos 59698b9484cSchristos struct dntt_type_const 59798b9484cSchristos { 59898b9484cSchristos unsigned int extension: 1; 59998b9484cSchristos unsigned int kind: 10; 60098b9484cSchristos unsigned int global: 1; 60198b9484cSchristos unsigned int indirect: 1; 60298b9484cSchristos unsigned int location_type: 3; 60398b9484cSchristos unsigned int classmem: 1; 60498b9484cSchristos unsigned int unused: 15; 60598b9484cSchristos vtpointer name; 60698b9484cSchristos CORE_ADDR location; 60798b9484cSchristos dnttpointer type; 60898b9484cSchristos unsigned int offset; 60998b9484cSchristos unsigned int displacement; 61098b9484cSchristos }; 61198b9484cSchristos 61298b9484cSchristos /* DNTT_TYPE_TYPEDEF and DNTT_TYPE_TAGDEF: 61398b9484cSchristos 61498b9484cSchristos The same structure is used to describe typedefs and tagdefs. 61598b9484cSchristos 61698b9484cSchristos DNTT_TYPE_TYPEDEFS are associated with C "typedefs". 61798b9484cSchristos 61898b9484cSchristos DNTT_TYPE_TAGDEFs are associated with C "struct", "union", and "enum" 61998b9484cSchristos tags, which may have the same name as a typedef in the same scope. 62098b9484cSchristos Also they are associated with C++ "class" tags, which implicitly have 62198b9484cSchristos the same name as the class type. 62298b9484cSchristos 62398b9484cSchristos GLOBAL is nonzero if the typedef/tagdef has global scope. 62498b9484cSchristos 62598b9484cSchristos TYPEINFO is used to determine if full type information is available 62698b9484cSchristos for a tag. (usually 1, but can be zero for opaque types in C). 62798b9484cSchristos 62898b9484cSchristos NAME is a pointer into the VT for the constant's name. 62998b9484cSchristos 63098b9484cSchristos TYPE points to the underlying type for the typedef/tagdef in the 63198b9484cSchristos GNTT or LNTT. */ 63298b9484cSchristos 63398b9484cSchristos struct dntt_type_type 63498b9484cSchristos { 63598b9484cSchristos unsigned int extension: 1; 63698b9484cSchristos unsigned int kind: 10; /* DNTT_TYPE_TYPEDEF or 63798b9484cSchristos DNTT_TYPE_TAGDEF. */ 63898b9484cSchristos unsigned int global: 1; 63998b9484cSchristos unsigned int typeinfo: 1; 64098b9484cSchristos unsigned int unused: 19; 64198b9484cSchristos vtpointer name; 64298b9484cSchristos dnttpointer type; /* Underlying type, which for TAGDEF's may be 64398b9484cSchristos DNTT_TYPE_STRUCT, DNTT_TYPE_UNION, 64498b9484cSchristos DNTT_TYPE_ENUM, or DNTT_TYPE_CLASS. 64598b9484cSchristos For TYPEDEF's other underlying types 64698b9484cSchristos are also possible. */ 64798b9484cSchristos }; 64898b9484cSchristos 64998b9484cSchristos /* DNTT_TYPE_POINTER: 65098b9484cSchristos 65198b9484cSchristos Used to describe a pointer to an underlying type. 65298b9484cSchristos 65398b9484cSchristos POINTSTO is a pointer into the GNTT or LNTT for the type which this 65498b9484cSchristos pointer points to. 65598b9484cSchristos 65698b9484cSchristos BITLENGTH is the length of the pointer (not the underlying type). */ 65798b9484cSchristos 65898b9484cSchristos struct dntt_type_pointer 65998b9484cSchristos { 66098b9484cSchristos unsigned int extension: 1; 66198b9484cSchristos unsigned int kind: 10; 66298b9484cSchristos unsigned int unused: 21; 66398b9484cSchristos dnttpointer pointsto; 66498b9484cSchristos unsigned int bitlength; 66598b9484cSchristos }; 66698b9484cSchristos 66798b9484cSchristos 66898b9484cSchristos /* DNTT_TYPE_ENUM: 66998b9484cSchristos 67098b9484cSchristos Used to describe enumerated types. 67198b9484cSchristos 67298b9484cSchristos FIRSTMEM is a pointer to a DNTT_TYPE_MEMENUM in the GNTT/LNTT which 67398b9484cSchristos describes the first member (and contains a pointer to the chain of 67498b9484cSchristos members). 67598b9484cSchristos 67698b9484cSchristos BITLENGTH is the number of bits used to hold the values of the enum's 67798b9484cSchristos members. */ 67898b9484cSchristos 67998b9484cSchristos struct dntt_type_enum 68098b9484cSchristos { 68198b9484cSchristos unsigned int extension: 1; 68298b9484cSchristos unsigned int kind: 10; 68398b9484cSchristos unsigned int unused: 21; 68498b9484cSchristos dnttpointer firstmem; 68598b9484cSchristos unsigned int bitlength; 68698b9484cSchristos }; 68798b9484cSchristos 68898b9484cSchristos /* DNTT_TYPE_MEMENUM 68998b9484cSchristos 69098b9484cSchristos Used to describe members of an enumerated type. 69198b9484cSchristos 69298b9484cSchristos CLASSMEM is nonzero if this member is part of a class. 69398b9484cSchristos 69498b9484cSchristos NAME points into the VT for the name of this member. 69598b9484cSchristos 69698b9484cSchristos VALUE is the value of this enumeration member. 69798b9484cSchristos 69898b9484cSchristos NEXTMEM points to the next DNTT_TYPE_MEMENUM in the chain. */ 69998b9484cSchristos 70098b9484cSchristos struct dntt_type_memenum 70198b9484cSchristos { 70298b9484cSchristos unsigned int extension: 1; 70398b9484cSchristos unsigned int kind: 10; 70498b9484cSchristos unsigned int classmem: 1; 70598b9484cSchristos unsigned int unused: 20; 70698b9484cSchristos vtpointer name; 70798b9484cSchristos unsigned int value; 70898b9484cSchristos dnttpointer nextmem; 70998b9484cSchristos }; 71098b9484cSchristos 71198b9484cSchristos /* DNTT_TYPE_SET 71298b9484cSchristos 71398b9484cSchristos Used to describe PASCAL "set" type. 71498b9484cSchristos 71598b9484cSchristos DECLARATION describes the bitpacking of the set. 71698b9484cSchristos 71798b9484cSchristos SUBTYPE points to a DNTT entry describing the type of the members. 71898b9484cSchristos 71998b9484cSchristos BITLENGTH is the size of the set. */ 72098b9484cSchristos 72198b9484cSchristos struct dntt_type_set 72298b9484cSchristos { 72398b9484cSchristos unsigned int extension: 1; 72498b9484cSchristos unsigned int kind: 10; 72598b9484cSchristos unsigned int declaration: 2; 72698b9484cSchristos unsigned int unused: 19; 72798b9484cSchristos dnttpointer subtype; 72898b9484cSchristos unsigned int bitlength; 72998b9484cSchristos }; 73098b9484cSchristos 73198b9484cSchristos /* DNTT_TYPE_SUBRANGE 73298b9484cSchristos 73398b9484cSchristos Used to describe subrange type. 73498b9484cSchristos 73598b9484cSchristos DYN_LOW describes the lower bound of the subrange: 73698b9484cSchristos 73798b9484cSchristos 00 for a constant lower bound (found in LOWBOUND). 73898b9484cSchristos 73998b9484cSchristos 01 for a dynamic lower bound with the lower bound found in the 74098b9484cSchristos memory address pointed to by LOWBOUND. 74198b9484cSchristos 74298b9484cSchristos 10 for a dynamic lower bound described by an variable found in the 74398b9484cSchristos DNTT/LNTT (LOWBOUND would be a pointer into the DNTT/LNTT). 74498b9484cSchristos 74598b9484cSchristos DYN_HIGH is similar to DYN_LOW, except it describes the upper bound. 74698b9484cSchristos 74798b9484cSchristos SUBTYPE points to the type of the subrange. 74898b9484cSchristos 74998b9484cSchristos BITLENGTH is the length in bits needed to describe the subrange's 75098b9484cSchristos values. */ 75198b9484cSchristos 75298b9484cSchristos struct dntt_type_subrange 75398b9484cSchristos { 75498b9484cSchristos unsigned int extension: 1; 75598b9484cSchristos unsigned int kind: 10; 75698b9484cSchristos unsigned int dyn_low: 2; 75798b9484cSchristos unsigned int dyn_high: 2; 75898b9484cSchristos unsigned int unused: 17; 75998b9484cSchristos int lowbound; 76098b9484cSchristos int highbound; 76198b9484cSchristos dnttpointer subtype; 76298b9484cSchristos unsigned int bitlength; 76398b9484cSchristos }; 76498b9484cSchristos 76598b9484cSchristos /* DNTT_TYPE_ARRAY 76698b9484cSchristos 76798b9484cSchristos Used to describe an array type. 76898b9484cSchristos 76998b9484cSchristos DECLARATION describes the bit packing used in the array. 77098b9484cSchristos 77198b9484cSchristos ARRAYISBYTES is nonzero if the field in arraylength describes the 77298b9484cSchristos length in bytes rather than in bits. A value of zero is used to 77398b9484cSchristos describe an array with size 2**32. 77498b9484cSchristos 77598b9484cSchristos ELEMISBYTES is nonzero if the length if each element in the array 77698b9484cSchristos is describes in bytes rather than bits. A value of zero is used 77798b9484cSchristos to an element with size 2**32. 77898b9484cSchristos 77998b9484cSchristos ELEMORDER is nonzero if the elements are indexed in increasing order. 78098b9484cSchristos 78198b9484cSchristos JUSTIFIED if the elements are left justified to index zero. 78298b9484cSchristos 78398b9484cSchristos ARRAYLENGTH is the length of the array. 78498b9484cSchristos 78598b9484cSchristos INDEXTYPE is a DNTT pointer to the type used to index the array. 78698b9484cSchristos 78798b9484cSchristos ELEMTYPE is a DNTT pointer to the type for the array elements. 78898b9484cSchristos 78998b9484cSchristos ELEMLENGTH is the length of each element in the array (including 79098b9484cSchristos any padding). 79198b9484cSchristos 79298b9484cSchristos Multi-dimensional arrays are represented by ELEMTYPE pointing to 79398b9484cSchristos another DNTT_TYPE_ARRAY. */ 79498b9484cSchristos 79598b9484cSchristos struct dntt_type_array 79698b9484cSchristos { 79798b9484cSchristos unsigned int extension: 1; 79898b9484cSchristos unsigned int kind: 10; 79998b9484cSchristos unsigned int declaration: 2; 80098b9484cSchristos unsigned int dyn_low: 2; 80198b9484cSchristos unsigned int dyn_high: 2; 80298b9484cSchristos unsigned int arrayisbytes: 1; 80398b9484cSchristos unsigned int elemisbytes: 1; 80498b9484cSchristos unsigned int elemorder: 1; 80598b9484cSchristos unsigned int justified: 1; 80698b9484cSchristos unsigned int unused: 11; 80798b9484cSchristos unsigned int arraylength; 80898b9484cSchristos dnttpointer indextype; 80998b9484cSchristos dnttpointer elemtype; 81098b9484cSchristos unsigned int elemlength; 81198b9484cSchristos }; 81298b9484cSchristos 81398b9484cSchristos /* DNTT_TYPE_STRUCT 81498b9484cSchristos 81598b9484cSchristos DNTT_TYPE_STRUCT is used to describe a C structure. 81698b9484cSchristos 81798b9484cSchristos DECLARATION describes the bitpacking used. 81898b9484cSchristos 81998b9484cSchristos FIRSTFIELD is a DNTT pointer to the first field of the structure 82098b9484cSchristos (each field contains a pointer to the next field, walk the list 82198b9484cSchristos to access all fields of the structure). 82298b9484cSchristos 82398b9484cSchristos VARTAGFIELD and VARLIST are used for Pascal variant records. 82498b9484cSchristos 82598b9484cSchristos BITLENGTH is the size of the structure in bits. */ 82698b9484cSchristos 82798b9484cSchristos struct dntt_type_struct 82898b9484cSchristos { 82998b9484cSchristos unsigned int extension: 1; 83098b9484cSchristos unsigned int kind: 10; 83198b9484cSchristos unsigned int declaration: 2; 83298b9484cSchristos unsigned int unused: 19; 83398b9484cSchristos dnttpointer firstfield; 83498b9484cSchristos dnttpointer vartagfield; 83598b9484cSchristos dnttpointer varlist; 83698b9484cSchristos unsigned int bitlength; 83798b9484cSchristos }; 83898b9484cSchristos 83998b9484cSchristos /* DNTT_TYPE_UNION 84098b9484cSchristos 84198b9484cSchristos DNTT_TYPE_UNION is used to describe a C union. 84298b9484cSchristos 84398b9484cSchristos FIRSTFIELD is a DNTT pointer to the beginning of the field chain. 84498b9484cSchristos 84598b9484cSchristos BITLENGTH is the size of the union in bits. */ 84698b9484cSchristos 84798b9484cSchristos struct dntt_type_union 84898b9484cSchristos { 84998b9484cSchristos unsigned int extension: 1; 85098b9484cSchristos unsigned int kind: 10; 85198b9484cSchristos unsigned int unused: 21; 85298b9484cSchristos dnttpointer firstfield; 85398b9484cSchristos unsigned int bitlength; 85498b9484cSchristos }; 85598b9484cSchristos 85698b9484cSchristos /* DNTT_TYPE_FIELD 85798b9484cSchristos 85898b9484cSchristos DNTT_TYPE_FIELD describes one field in a structure or union 85998b9484cSchristos or C++ class. 86098b9484cSchristos 86198b9484cSchristos VISIBILITY is used to describe the visibility of the field 86298b9484cSchristos (for c++. public = 0, protected = 1, private = 2). 86398b9484cSchristos 86498b9484cSchristos A_UNION is nonzero if this field is a member of an anonymous union. 86598b9484cSchristos 86698b9484cSchristos STATICMEM is nonzero if this field is a static member of a template. 86798b9484cSchristos 86898b9484cSchristos NAME is a pointer into the VT for the name of the field. 86998b9484cSchristos 87098b9484cSchristos BITOFFSET gives the offset of this field in bits from the beginning 87198b9484cSchristos of the structure or union this field is a member of. 87298b9484cSchristos 87398b9484cSchristos TYPE is a DNTT pointer to the type describing this field. 87498b9484cSchristos 87598b9484cSchristos BITLENGTH is the size of the entry in bits. 87698b9484cSchristos 87798b9484cSchristos NEXTFIELD is a DNTT pointer to the next field in the chain. */ 87898b9484cSchristos 87998b9484cSchristos struct dntt_type_field 88098b9484cSchristos { 88198b9484cSchristos unsigned int extension: 1; 88298b9484cSchristos unsigned int kind: 10; 88398b9484cSchristos unsigned int visibility: 2; 88498b9484cSchristos unsigned int a_union: 1; 88598b9484cSchristos unsigned int staticmem: 1; 88698b9484cSchristos unsigned int unused: 17; 88798b9484cSchristos vtpointer name; 88898b9484cSchristos unsigned int bitoffset; 88998b9484cSchristos dnttpointer type; 89098b9484cSchristos unsigned int bitlength; 89198b9484cSchristos dnttpointer nextfield; 89298b9484cSchristos }; 89398b9484cSchristos 89498b9484cSchristos /* DNTT_TYPE_VARIANT is unused by GDB. */ 89598b9484cSchristos /* DNTT_TYPE_FILE is unused by GDB. */ 89698b9484cSchristos 89798b9484cSchristos /* DNTT_TYPE_FUNCTYPE 89898b9484cSchristos 89998b9484cSchristos I think this is used to describe a function type (e.g., would 90098b9484cSchristos be emitted as part of a function-pointer description). 90198b9484cSchristos 90298b9484cSchristos VARARGS is nonzero if this function uses varargs. 90398b9484cSchristos 90498b9484cSchristos FIRSTPARAM is a DNTT pointer to the first entry in the parameter 90598b9484cSchristos chain. 90698b9484cSchristos 90798b9484cSchristos RETVAL is a DNTT pointer to the type of the return value. */ 90898b9484cSchristos 90998b9484cSchristos struct dntt_type_functype 91098b9484cSchristos { 91198b9484cSchristos unsigned int extension: 1; 91298b9484cSchristos unsigned int kind: 10; 91398b9484cSchristos unsigned int varargs: 1; 91498b9484cSchristos unsigned int info: 4; 91598b9484cSchristos unsigned int unused: 16; 91698b9484cSchristos unsigned int bitlength; 91798b9484cSchristos dnttpointer firstparam; 91898b9484cSchristos dnttpointer retval; 91998b9484cSchristos }; 92098b9484cSchristos 92198b9484cSchristos /* DNTT_TYPE_WITH is emitted by C++ to indicate "with" scoping semantics. 92298b9484cSchristos (Probably also emitted by PASCAL to support "with"...). 92398b9484cSchristos 92498b9484cSchristos C++ example: Say "memfunc" is a method of class "c", and say 92598b9484cSchristos "m" is a data member of class "c". Then from within "memfunc", 92698b9484cSchristos it is legal to reference "m" directly (e.g. you don't have to 92798b9484cSchristos say "this->m". The symbol table indicates 92898b9484cSchristos this by emitting a DNTT_TYPE_WITH symbol within the function "memfunc", 92998b9484cSchristos pointing to the type symbol for class "c". 93098b9484cSchristos 93198b9484cSchristos In GDB, this symbol record is unnecessary, 93298b9484cSchristos because GDB's symbol lookup algorithm 93398b9484cSchristos infers the "with" semantics when it sees a "this" argument to the member 93498b9484cSchristos function. So GDB can safely ignore the DNTT_TYPE_WITH record. 93598b9484cSchristos 93698b9484cSchristos A DNTT_TYPE_WITH has a matching DNTT_TYPE_END symbol. */ 93798b9484cSchristos 93898b9484cSchristos struct dntt_type_with 93998b9484cSchristos { 94098b9484cSchristos unsigned int extension: 1; /* always zero */ 94198b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_WITH */ 94298b9484cSchristos unsigned int addrtype: 2; /* 0 => STATTYPE */ 94398b9484cSchristos /* 1 => DYNTYPE */ 94498b9484cSchristos /* 2 => REGTYPE */ 94598b9484cSchristos unsigned int indirect: 1; /* 1 => pointer to object */ 94698b9484cSchristos unsigned int longaddr: 1; /* 1 => in long pointer space */ 94798b9484cSchristos unsigned int nestlevel: 6; /* # of nesting levels back */ 94898b9484cSchristos unsigned int doc_ranges: 1; /* 1 => location is range list */ 94998b9484cSchristos unsigned int unused: 10; 95098b9484cSchristos long location; /* where stored (allocated) */ 95198b9484cSchristos sltpointer address; 95298b9484cSchristos dnttpointer type; /* type of with expression */ 95398b9484cSchristos vtpointer name; /* name of with expression */ 95498b9484cSchristos unsigned long offset; /* byte offset from location */ 95598b9484cSchristos }; 95698b9484cSchristos 95798b9484cSchristos /* DNTT_TYPE_COMMON is unsupported by GDB. */ 95898b9484cSchristos /* A DNTT_TYPE_COMMON symbol must have a matching DNTT_TYPE_END symbol */ 95998b9484cSchristos 96098b9484cSchristos /* DNTT_TYPE_COBSTRUCT is unsupported by GDB. */ 96198b9484cSchristos /* DNTT_TYPE_XREF is unsupported by GDB. */ 96298b9484cSchristos /* DNTT_TYPE_SA is unsupported by GDB. */ 96398b9484cSchristos /* DNTT_TYPE_MACRO is unsupported by GDB */ 96498b9484cSchristos 96598b9484cSchristos /* DNTT_TYPE_BLOCKDATA has the same structure as DNTT_TYPE_FUNCTION */ 96698b9484cSchristos 96798b9484cSchristos /* The following are the C++ specific SOM records */ 96898b9484cSchristos 96998b9484cSchristos /* The purpose of the DNTT_TYPE_CLASS_SCOPE is to bracket C++ methods 97098b9484cSchristos and indicate the method name belongs in the "class scope" rather 97198b9484cSchristos than in the module they are being defined in. For example: 97298b9484cSchristos 97398b9484cSchristos class c { 97498b9484cSchristos ... 97598b9484cSchristos void memfunc(); // member function 97698b9484cSchristos }; 97798b9484cSchristos 97898b9484cSchristos void c::memfunc() // definition of class c's "memfunc" 97998b9484cSchristos { 98098b9484cSchristos ... 98198b9484cSchristos } 98298b9484cSchristos 98398b9484cSchristos main() 98498b9484cSchristos { 98598b9484cSchristos ... 98698b9484cSchristos } 98798b9484cSchristos 98898b9484cSchristos In the above, the name "memfunc" is not directly visible from "main". 98998b9484cSchristos I.e., you have to say "break c::memfunc". 99098b9484cSchristos If it were a normal function (not a method), it would be visible 99198b9484cSchristos via the simple "break memfunc". Since "memfunc" otherwise looks 99298b9484cSchristos like a normal FUNCTION in the symbol table, the bracketing 99398b9484cSchristos CLASS_SCOPE is what is used to indicate it is really a method. 99498b9484cSchristos 99598b9484cSchristos 99698b9484cSchristos A DNTT_TYPE_CLASS_SCOPE symbol must have a matching DNTT_TYPE_END symbol. */ 99798b9484cSchristos 99898b9484cSchristos struct dntt_type_class_scope 99998b9484cSchristos { 100098b9484cSchristos unsigned int extension: 1; /* Always zero. */ 100198b9484cSchristos unsigned int kind: 10; /* Always DNTT_TYPE_CLASS_SCOPE. */ 100298b9484cSchristos unsigned int unused: 21; 100398b9484cSchristos sltpointer address ; /* Pointer to SLT entry. */ 100498b9484cSchristos dnttpointer type ; /* Pointer to class type DNTT. */ 100598b9484cSchristos }; 100698b9484cSchristos 100798b9484cSchristos /* C++ reference parameter. 100898b9484cSchristos The structure of this record is the same as DNTT_TYPE_POINTER - 100998b9484cSchristos refer to struct dntt_type_pointer. */ 101098b9484cSchristos 101198b9484cSchristos /* The next two describe C++ pointer-to-data-member type, and 101298b9484cSchristos pointer-to-member-function type, respectively. 101398b9484cSchristos DNTT_TYPE_PTRMEM and DNTT_TYPE_PTRMEMFUNC have the same structure. */ 101498b9484cSchristos 101598b9484cSchristos struct dntt_type_ptrmem 101698b9484cSchristos { 101798b9484cSchristos unsigned int extension: 1; /* Always zero. */ 101898b9484cSchristos unsigned int kind: 10; /* Always DNTT_TYPE_PTRMEM. */ 101998b9484cSchristos unsigned int unused: 21; 102098b9484cSchristos dnttpointer pointsto ; /* Pointer to class DNTT. */ 102198b9484cSchristos dnttpointer memtype ; /* Type of member. */ 102298b9484cSchristos }; 102398b9484cSchristos 102498b9484cSchristos struct dntt_type_ptrmemfunc 102598b9484cSchristos { 102698b9484cSchristos unsigned int extension: 1; /* Always zero. */ 102798b9484cSchristos unsigned int kind: 10; /* Always DNTT_TYPE_PTRMEMFUNC. */ 102898b9484cSchristos unsigned int unused: 21; 102998b9484cSchristos dnttpointer pointsto ; /* Pointer to class DNTT. */ 103098b9484cSchristos dnttpointer memtype ; /* Type of member. */ 103198b9484cSchristos }; 103298b9484cSchristos 103398b9484cSchristos /* The DNTT_TYPE_CLASS symbol is emitted to describe a class type. 103498b9484cSchristos "memberlist" points to a chained list of FIELD or GENFIELD records 103598b9484cSchristos indicating the class members. "parentlist" points to a chained list 103698b9484cSchristos of INHERITANCE records indicating classes from which we inherit 103798b9484cSchristos fields. */ 103898b9484cSchristos 103998b9484cSchristos struct dntt_type_class 104098b9484cSchristos { 104198b9484cSchristos unsigned int extension: 1; /* Always zero. */ 104298b9484cSchristos unsigned int kind: 10; /* Always DNTT_TYPE_CLASS. */ 104398b9484cSchristos unsigned int abstract: 1; /* Is this an abstract class? */ 104498b9484cSchristos unsigned int class_decl: 2; /* 0=class,1=union,2=struct. */ 104598b9484cSchristos unsigned int expansion: 1; /* 1=template expansion. */ 104698b9484cSchristos unsigned int unused: 17; 104798b9484cSchristos dnttpointer memberlist ; /* Ptr to chain of [GEN]FIELDs. */ 104898b9484cSchristos unsigned long vtbl_loc ; /* Offset in obj of ptr to vtbl. */ 104998b9484cSchristos dnttpointer parentlist ; /* Ptr to K_INHERITANCE list. */ 105098b9484cSchristos unsigned long bitlength ; /* Total at this level. */ 105198b9484cSchristos dnttpointer identlist ; /* Ptr to chain of class ident's. */ 105298b9484cSchristos dnttpointer friendlist ; /* Ptr to K_FRIEND list. */ 105398b9484cSchristos dnttpointer templateptr ; /* Ptr to template. */ 105498b9484cSchristos dnttpointer nextexp ; /* Ptr to next expansion. */ 105598b9484cSchristos }; 105698b9484cSchristos 105798b9484cSchristos /* Class members are indicated via either the FIELD record (for 105898b9484cSchristos data members, same as for C struct fields), or by the GENFIELD record 105998b9484cSchristos (for member functions). */ 106098b9484cSchristos 106198b9484cSchristos struct dntt_type_genfield 106298b9484cSchristos { 106398b9484cSchristos unsigned int extension: 1; /* Always zero. */ 106498b9484cSchristos unsigned int kind: 10; /* Always DNTT_TYPE_GENFIELD. */ 106598b9484cSchristos unsigned int visibility: 2; /* Pub = 0, prot = 1, priv = 2. */ 106698b9484cSchristos unsigned int a_union: 1; /* 1 => anonymous union member. */ 106798b9484cSchristos unsigned int unused: 18; 106898b9484cSchristos dnttpointer field ; /* Pointer to field or qualifier. */ 106998b9484cSchristos dnttpointer nextfield ; /* Pointer to next field. */ 107098b9484cSchristos }; 107198b9484cSchristos 107298b9484cSchristos /* C++ virtual functions. */ 107398b9484cSchristos 107498b9484cSchristos struct dntt_type_vfunc 107598b9484cSchristos { 107698b9484cSchristos unsigned int extension: 1; /* always zero */ 107798b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_VFUNC */ 107898b9484cSchristos unsigned int pure: 1; /* pure virtual function ? */ 107998b9484cSchristos unsigned int unused: 20; 108098b9484cSchristos dnttpointer funcptr ; /* points to FUNCTION symbol */ 108198b9484cSchristos unsigned long vtbl_offset ; /* offset into vtbl for virtual */ 108298b9484cSchristos }; 108398b9484cSchristos 108498b9484cSchristos /* Not precisely sure what this is intended for - DDE ignores it. */ 108598b9484cSchristos 108698b9484cSchristos struct dntt_type_memaccess 108798b9484cSchristos { 108898b9484cSchristos unsigned int extension: 1; /* always zero */ 108998b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_MEMACCESS */ 109098b9484cSchristos unsigned int unused: 21; 109198b9484cSchristos dnttpointer classptr ; /* pointer to base class */ 109298b9484cSchristos dnttpointer field ; /* pointer field */ 109398b9484cSchristos }; 109498b9484cSchristos 109598b9484cSchristos /* The DNTT_TYPE_INHERITANCE record describes derived classes. 109698b9484cSchristos In particular, the "parentlist" field of the CLASS record points 109798b9484cSchristos to a list of INHERITANCE records for classes from which we 109898b9484cSchristos inherit members. */ 109998b9484cSchristos 110098b9484cSchristos struct dntt_type_inheritance 110198b9484cSchristos { 110298b9484cSchristos unsigned int extension: 1; /* always zero */ 110398b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_INHERITANCE */ 110498b9484cSchristos unsigned int Virtual: 1; /* virtual base class ? */ 110598b9484cSchristos unsigned int visibility: 2; /* pub = 0, prot = 1, priv = 2 */ 110698b9484cSchristos unsigned int unused: 18; 110798b9484cSchristos dnttpointer classname ; /* first parent class, if any */ 110898b9484cSchristos unsigned long offset ; /* offset to start of base class */ 110998b9484cSchristos dnttpointer next ; /* pointer to next K_INHERITANCE */ 111098b9484cSchristos unsigned long future[2] ; /* padding to 3-word block end */ 111198b9484cSchristos }; 111298b9484cSchristos 111398b9484cSchristos /* C++ "friend" classes ... */ 111498b9484cSchristos 111598b9484cSchristos struct dntt_type_friend_class 111698b9484cSchristos { 111798b9484cSchristos unsigned int extension: 1; /* always zero */ 111898b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_FRIEND_CLASS */ 111998b9484cSchristos unsigned int unused: 21; 112098b9484cSchristos dnttpointer classptr ; /* pointer to class DNTT */ 112198b9484cSchristos dnttpointer next ; /* next DNTT_FRIEND */ 112298b9484cSchristos }; 112398b9484cSchristos 112498b9484cSchristos struct dntt_type_friend_func 112598b9484cSchristos { 112698b9484cSchristos unsigned int extension: 1; /* always zero */ 112798b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_FRIEND_FUNC */ 112898b9484cSchristos unsigned int unused: 21; 112998b9484cSchristos dnttpointer funcptr ; /* pointer to function */ 113098b9484cSchristos dnttpointer classptr ; /* pointer to class DNTT */ 113198b9484cSchristos dnttpointer next ; /* next DNTT_FRIEND */ 113298b9484cSchristos unsigned long future[2] ; /* padding to 3-word block end */ 113398b9484cSchristos }; 113498b9484cSchristos 113598b9484cSchristos /* DDE appears to ignore the DNTT_TYPE_MODIFIER record. 113698b9484cSchristos It could perhaps be used to give better "ptype" output in GDB; 113798b9484cSchristos otherwise it is probably safe for GDB to ignore it also. */ 113898b9484cSchristos 113998b9484cSchristos struct dntt_type_modifier 114098b9484cSchristos { 114198b9484cSchristos unsigned int extension: 1; /* always zero */ 114298b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_MODIFIER */ 114398b9484cSchristos unsigned int m_const: 1; /* const */ 114498b9484cSchristos unsigned int m_static: 1; /* static */ 114598b9484cSchristos unsigned int m_void: 1; /* void */ 114698b9484cSchristos unsigned int m_volatile: 1; /* volatile */ 114798b9484cSchristos unsigned int m_duplicate: 1; /* duplicate */ 114898b9484cSchristos unsigned int unused: 16; 114998b9484cSchristos dnttpointer type ; /* subtype */ 115098b9484cSchristos unsigned long future ; /* padding to 3-word block end */ 115198b9484cSchristos }; 115298b9484cSchristos 115398b9484cSchristos /* I'm not sure what this was intended for - DDE ignores it. */ 115498b9484cSchristos 115598b9484cSchristos struct dntt_type_object_id 115698b9484cSchristos { 115798b9484cSchristos unsigned int extension: 1; /* always zero */ 115898b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_OBJECT_ID */ 115998b9484cSchristos unsigned int indirect: 1; /* Is object_ident addr of addr? */ 116098b9484cSchristos unsigned int unused: 20; 116198b9484cSchristos unsigned long object_ident ; /* object identifier */ 116298b9484cSchristos unsigned long offset ; /* offset to start of base class */ 116398b9484cSchristos dnttpointer next ; /* pointer to next K_OBJECT_ID */ 116498b9484cSchristos unsigned long segoffset ; /* for linker fixup */ 116598b9484cSchristos unsigned long future ; /* padding to 3-word block end */ 116698b9484cSchristos }; 116798b9484cSchristos 116898b9484cSchristos /* No separate dntt_type_memfunc; same as dntt_type_func */ 116998b9484cSchristos 117098b9484cSchristos /* Symbol records to support templates. These only get used 117198b9484cSchristos in DDE's "describe" output (like GDB's "ptype"). */ 117298b9484cSchristos 117398b9484cSchristos /* The TEMPLATE record is the header for a template-class. 117498b9484cSchristos Like the CLASS record, a TEMPLATE record has a memberlist that 117598b9484cSchristos points to a list of template members. It also has an arglist 117698b9484cSchristos pointing to a list of TEMPLATE_ARG records. */ 117798b9484cSchristos 117898b9484cSchristos struct dntt_type_template 117998b9484cSchristos { 118098b9484cSchristos unsigned int extension: 1; /* always zero */ 118198b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_TEMPLATE */ 118298b9484cSchristos unsigned int abstract: 1; /* is this an abstract class? */ 118398b9484cSchristos unsigned int class_decl: 2; /* 0=class,1=union,2=struct */ 118498b9484cSchristos unsigned int unused: 18; 118598b9484cSchristos dnttpointer memberlist ; /* ptr to chain of K_[GEN]FIELDs */ 118698b9484cSchristos long unused2 ; /* offset in obj of ptr to vtbl */ 118798b9484cSchristos dnttpointer parentlist ; /* ptr to K_INHERITANCE list */ 118898b9484cSchristos unsigned long bitlength ; /* total at this level */ 118998b9484cSchristos dnttpointer identlist ; /* ptr to chain of class ident's */ 119098b9484cSchristos dnttpointer friendlist ; /* ptr to K_FRIEND list */ 119198b9484cSchristos dnttpointer arglist ; /* ptr to argument list */ 119298b9484cSchristos dnttpointer expansions ; /* ptr to expansion list */ 119398b9484cSchristos }; 119498b9484cSchristos 119598b9484cSchristos /* Template-class arguments are a list of TEMPL_ARG records 119698b9484cSchristos chained together. The "name" field is the name of the formal. 119798b9484cSchristos E.g.: 119898b9484cSchristos 119998b9484cSchristos template <class T> class q { ... }; 120098b9484cSchristos 120198b9484cSchristos Then "T" is the name of the formal argument. */ 120298b9484cSchristos 120398b9484cSchristos struct dntt_type_templ_arg 120498b9484cSchristos { 120598b9484cSchristos unsigned int extension: 1; /* always zero */ 120698b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_TEMPL_ARG */ 120798b9484cSchristos unsigned int usagetype: 1; /* 0 type-name 1 expression */ 120898b9484cSchristos unsigned int unused: 20; 120998b9484cSchristos vtpointer name ; /* name of argument */ 121098b9484cSchristos dnttpointer type ; /* for non type arguments */ 121198b9484cSchristos dnttpointer nextarg ; /* Next argument if any */ 121298b9484cSchristos long future[2] ; /* padding to 3-word block end */ 121398b9484cSchristos }; 121498b9484cSchristos 121598b9484cSchristos /* FUNC_TEMPLATE records are sort of like FUNCTION, but are emitted 121698b9484cSchristos for template member functions. E.g., 121798b9484cSchristos 121898b9484cSchristos template <class T> class q 121998b9484cSchristos { 122098b9484cSchristos ... 122198b9484cSchristos void f(); 122298b9484cSchristos ... 122398b9484cSchristos }; 122498b9484cSchristos 122598b9484cSchristos Within the list of FIELDs/GENFIELDs defining the member list 122698b9484cSchristos of the template "q", "f" would appear as a FUNC_TEMPLATE. 122798b9484cSchristos We'll also see instances of FUNCTION "f" records for each 122898b9484cSchristos instantiation of the template. */ 122998b9484cSchristos 123098b9484cSchristos struct dntt_type_func_template 123198b9484cSchristos { 123298b9484cSchristos unsigned int extension: 1; /* always zero */ 123398b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_FUNC_TEMPLATE */ 123498b9484cSchristos unsigned int public: 1; /* 1 => globally visible */ 123598b9484cSchristos unsigned int language: 4; /* type of language */ 123698b9484cSchristos unsigned int level: 5; /* nesting level (top level = 0)*/ 123798b9484cSchristos unsigned int optimize: 2; /* level of optimization */ 123898b9484cSchristos unsigned int varargs: 1; /* ellipses. Pascal/800 later */ 123998b9484cSchristos unsigned int info: 4; /* lang-specific stuff; F_xxxx */ 124098b9484cSchristos unsigned int inlined: 1; 124198b9484cSchristos unsigned int localloc: 1; /* 0 at top, 1 at end of block */ 124298b9484cSchristos unsigned int unused: 2; 124398b9484cSchristos vtpointer name ; /* name of function */ 124498b9484cSchristos vtpointer alias ; /* alternate name, if any */ 124598b9484cSchristos dnttpointer firstparam ; /* first FPARAM, if any */ 124698b9484cSchristos dnttpointer retval ; /* return type, if any */ 124798b9484cSchristos dnttpointer arglist ; /* ptr to argument list */ 124898b9484cSchristos }; 124998b9484cSchristos 125098b9484cSchristos /* LINK is apparently intended to link together function template 125198b9484cSchristos definitions with their instantiations. However, it is not clear 125298b9484cSchristos why this would be needed, except to provide the information on 125398b9484cSchristos a "ptype" command. And as far as I can tell, aCC does not 125498b9484cSchristos generate this record. */ 125598b9484cSchristos 125698b9484cSchristos struct dntt_type_link 125798b9484cSchristos { 125898b9484cSchristos unsigned int extension: 1; /* always zero */ 125998b9484cSchristos unsigned int kind: 10; /* always DNTT_TYPE_LINK */ 126098b9484cSchristos unsigned int linkKind: 4; /* always LINK_UNKNOWN */ 126198b9484cSchristos unsigned int unused: 17; 126298b9484cSchristos long future1 ; /* expansion */ 126398b9484cSchristos dnttpointer ptr1 ; /* link from template */ 126498b9484cSchristos dnttpointer ptr2 ; /* to expansion */ 126598b9484cSchristos long future[2] ; /* padding to 3-word block end */ 126698b9484cSchristos }; 126798b9484cSchristos 126898b9484cSchristos /* end of C++ specific SOM's. */ 126998b9484cSchristos 127098b9484cSchristos /* DNTT_TYPE_DYN_ARRAY_DESC is unused by GDB */ 127198b9484cSchristos /* DNTT_TYPE_DESC_SUBRANGE is unused by GDB */ 127298b9484cSchristos /* DNTT_TYPE_BEGIN_EXT is unused by GDB */ 127398b9484cSchristos /* DNTT_TYPE_INLN is unused by GDB */ 127498b9484cSchristos /* DNTT_TYPE_INLN_LIST is unused by GDB */ 127598b9484cSchristos /* DNTT_TYPE_ALIAS is unused by GDB */ 127698b9484cSchristos 127798b9484cSchristos struct dntt_type_doc_function 127898b9484cSchristos { 127998b9484cSchristos unsigned int extension: 1; /* always zero */ 128098b9484cSchristos unsigned int kind: 10; /* K_DOC_FUNCTION or */ 128198b9484cSchristos /* K_DOC_MEMFUNC */ 128298b9484cSchristos unsigned int global: 1; /* 1 => globally visible */ 128398b9484cSchristos unsigned int language: 4; /* type of language */ 128498b9484cSchristos unsigned int level: 5; /* nesting level (top level = 0)*/ 128598b9484cSchristos unsigned int optimize: 2; /* level of optimization */ 128698b9484cSchristos unsigned int varargs: 1; /* ellipses. Pascal/800 later */ 128798b9484cSchristos unsigned int info: 4; /* lang-specific stuff; F_xxxx */ 128898b9484cSchristos unsigned int inlined: 1; 128998b9484cSchristos unsigned int localloc: 1; /* 0 at top, 1 at end of block */ 129098b9484cSchristos unsigned int expansion: 1; /* 1 = function expansion */ 129198b9484cSchristos unsigned int doc_clone: 1; 129298b9484cSchristos vtpointer name; /* name of function */ 129398b9484cSchristos vtpointer alias; /* alternate name, if any */ 129498b9484cSchristos dnttpointer firstparam; /* first FPARAM, if any */ 129598b9484cSchristos sltpointer address; /* code and text locations */ 129698b9484cSchristos CORE_ADDR entryaddr; /* address of entry point */ 129798b9484cSchristos dnttpointer retval; /* return type, if any */ 129898b9484cSchristos CORE_ADDR lowaddr; /* lowest address of function */ 129998b9484cSchristos CORE_ADDR hiaddr; /* highest address of function */ 130098b9484cSchristos dnttpointer inline_list; /* pointer to first inline */ 130198b9484cSchristos ltpointer lt_offset; /* start of frag/cp line table */ 130298b9484cSchristos ctxtpointer ctxt_offset; /* start of context table for this routine */ 130398b9484cSchristos }; 130498b9484cSchristos 130598b9484cSchristos /* DNTT_TYPE_DOC_MEMFUNC is unused by GDB */ 130698b9484cSchristos 130798b9484cSchristos /* DNTT_TYPE_GENERIC and DNTT_TYPE_BLOCK are convience structures 130898b9484cSchristos so we can examine a DNTT entry in a generic fashion. */ 130998b9484cSchristos struct dntt_type_generic 131098b9484cSchristos { 131198b9484cSchristos unsigned int word[9]; 131298b9484cSchristos }; 131398b9484cSchristos 131498b9484cSchristos struct dntt_type_block 131598b9484cSchristos { 131698b9484cSchristos unsigned int extension: 1; 131798b9484cSchristos unsigned int kind: 10; 131898b9484cSchristos unsigned int unused: 21; 131998b9484cSchristos unsigned int word[2]; 132098b9484cSchristos }; 132198b9484cSchristos 132298b9484cSchristos /* One entry in a DNTT (either the LNTT or GNTT). 132398b9484cSchristos This is a union of the above 60 or so structure definitions. */ 132498b9484cSchristos 132598b9484cSchristos union dnttentry 132698b9484cSchristos { 132798b9484cSchristos struct dntt_type_srcfile dsfile; 132898b9484cSchristos struct dntt_type_module dmodule; 132998b9484cSchristos struct dntt_type_function dfunc; 133098b9484cSchristos struct dntt_type_function dentry; 133198b9484cSchristos struct dntt_type_begin dbegin; 133298b9484cSchristos struct dntt_type_end dend; 133398b9484cSchristos struct dntt_type_fparam dfparam; 133498b9484cSchristos struct dntt_type_svar dsvar; 133598b9484cSchristos struct dntt_type_dvar ddvar; 133698b9484cSchristos struct dntt_type_const dconst; 133798b9484cSchristos struct dntt_type_type dtype; 133898b9484cSchristos struct dntt_type_type dtag; 133998b9484cSchristos struct dntt_type_pointer dptr; 134098b9484cSchristos struct dntt_type_enum denum; 134198b9484cSchristos struct dntt_type_memenum dmember; 134298b9484cSchristos struct dntt_type_set dset; 134398b9484cSchristos struct dntt_type_subrange dsubr; 134498b9484cSchristos struct dntt_type_array darray; 134598b9484cSchristos struct dntt_type_struct dstruct; 134698b9484cSchristos struct dntt_type_union dunion; 134798b9484cSchristos struct dntt_type_field dfield; 134898b9484cSchristos struct dntt_type_functype dfunctype; 134998b9484cSchristos struct dntt_type_with dwith; 135098b9484cSchristos struct dntt_type_function dblockdata; 135198b9484cSchristos struct dntt_type_class_scope dclass_scope; 135298b9484cSchristos struct dntt_type_pointer dreference; 135398b9484cSchristos struct dntt_type_ptrmem dptrmem; 135498b9484cSchristos struct dntt_type_ptrmemfunc dptrmemfunc; 135598b9484cSchristos struct dntt_type_class dclass; 135698b9484cSchristos struct dntt_type_genfield dgenfield; 135798b9484cSchristos struct dntt_type_vfunc dvfunc; 135898b9484cSchristos struct dntt_type_memaccess dmemaccess; 135998b9484cSchristos struct dntt_type_inheritance dinheritance; 136098b9484cSchristos struct dntt_type_friend_class dfriend_class; 136198b9484cSchristos struct dntt_type_friend_func dfriend_func; 136298b9484cSchristos struct dntt_type_modifier dmodifier; 136398b9484cSchristos struct dntt_type_object_id dobject_id; 136498b9484cSchristos struct dntt_type_template dtemplate; 136598b9484cSchristos struct dntt_type_templ_arg dtempl_arg; 136698b9484cSchristos struct dntt_type_func_template dfunc_template; 136798b9484cSchristos struct dntt_type_link dlink; 136898b9484cSchristos struct dntt_type_doc_function ddocfunc; 136998b9484cSchristos struct dntt_type_generic dgeneric; 137098b9484cSchristos struct dntt_type_block dblock; 137198b9484cSchristos }; 137298b9484cSchristos 137398b9484cSchristos /* Source line entry types. */ 137498b9484cSchristos enum slttype 137598b9484cSchristos { 137698b9484cSchristos SLT_NORMAL, 137798b9484cSchristos SLT_SRCFILE, 137898b9484cSchristos SLT_MODULE, 137998b9484cSchristos SLT_FUNCTION, 138098b9484cSchristos SLT_ENTRY, 138198b9484cSchristos SLT_BEGIN, 138298b9484cSchristos SLT_END, 138398b9484cSchristos SLT_WITH, 138498b9484cSchristos SLT_EXIT, 138598b9484cSchristos SLT_ASSIST, 138698b9484cSchristos SLT_MARKER, 138798b9484cSchristos SLT_CLASS_SCOPE, 138898b9484cSchristos SLT_INLN, 138998b9484cSchristos SLT_NORMAL_OFFSET, 139098b9484cSchristos }; 139198b9484cSchristos 139298b9484cSchristos /* A normal source line entry. Simply provides a mapping of a source 139398b9484cSchristos line number to a code address. 139498b9484cSchristos 139598b9484cSchristos SLTDESC will always be SLT_NORMAL or SLT_EXIT. */ 139698b9484cSchristos 139798b9484cSchristos struct slt_normal 139898b9484cSchristos { 139998b9484cSchristos unsigned int sltdesc: 4; 140098b9484cSchristos unsigned int line: 28; 140198b9484cSchristos CORE_ADDR address; 140298b9484cSchristos }; 140398b9484cSchristos 140498b9484cSchristos struct slt_normal_off 140598b9484cSchristos { 140698b9484cSchristos unsigned int sltdesc: 4; 140798b9484cSchristos unsigned int offset: 6; 140898b9484cSchristos unsigned int line: 22; 140998b9484cSchristos CORE_ADDR address; 141098b9484cSchristos }; 141198b9484cSchristos 141298b9484cSchristos /* A special source line entry. Provides a mapping of a declaration 141398b9484cSchristos to a line number. These entries point back into the DNTT which 141498b9484cSchristos references them. */ 141598b9484cSchristos 141698b9484cSchristos struct slt_special 141798b9484cSchristos { 141898b9484cSchristos unsigned int sltdesc: 4; 141998b9484cSchristos unsigned int line: 28; 142098b9484cSchristos dnttpointer backptr; 142198b9484cSchristos }; 142298b9484cSchristos 142398b9484cSchristos /* Used to describe nesting. 142498b9484cSchristos 142598b9484cSchristos For nested languages, an slt_assist entry must follow each SLT_FUNC 142698b9484cSchristos entry in the SLT. The address field will point forward to the 142798b9484cSchristos first slt_normal entry within the function's scope. */ 142898b9484cSchristos 142998b9484cSchristos struct slt_assist 143098b9484cSchristos { 143198b9484cSchristos unsigned int sltdesc: 4; 143298b9484cSchristos unsigned int unused: 28; 143398b9484cSchristos sltpointer address; 143498b9484cSchristos }; 143598b9484cSchristos 143698b9484cSchristos struct slt_generic 143798b9484cSchristos { 143898b9484cSchristos unsigned int word[2]; 143998b9484cSchristos }; 144098b9484cSchristos 144198b9484cSchristos union sltentry 144298b9484cSchristos { 144398b9484cSchristos struct slt_normal snorm; 144498b9484cSchristos struct slt_normal_off snormoff; 144598b9484cSchristos struct slt_special sspec; 144698b9484cSchristos struct slt_assist sasst; 144798b9484cSchristos struct slt_generic sgeneric; 144898b9484cSchristos }; 144998b9484cSchristos 145098b9484cSchristos /* $LINES$ declarations 145198b9484cSchristos This is the line table used for optimized code, which is only present 145298b9484cSchristos in the new $PROGRAM_INFO$ debug space. */ 145398b9484cSchristos 145498b9484cSchristos #define DST_LN_ESCAPE_FLAG1 15 145598b9484cSchristos #define DST_LN_ESCAPE_FLAG2 14 145698b9484cSchristos #define DST_LN_CTX_SPEC1 13 145798b9484cSchristos #define DST_LN_CTX_SPEC2 12 145898b9484cSchristos 145998b9484cSchristos /* Escape function codes: */ 146098b9484cSchristos 146198b9484cSchristos typedef enum 146298b9484cSchristos { 146398b9484cSchristos dst_ln_pad, /* pad byte */ 146498b9484cSchristos dst_ln_escape_1, /* reserved */ 146598b9484cSchristos dst_ln_dpc1_dln1, /* 1 byte line delta, 1 byte pc delta */ 146698b9484cSchristos dst_ln_dpc2_dln2, /* 2 bytes line delta, 2 bytes pc delta */ 146798b9484cSchristos dst_ln_pc4_ln4, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ 146898b9484cSchristos dst_ln_dpc0_dln1, /* 1 byte line delta, pc delta = 0 */ 146998b9484cSchristos dst_ln_ln_off_1, /* statement escape, stmt # = 1 (2nd stmt on line) */ 147098b9484cSchristos dst_ln_ln_off, /* statement escape, stmt # = next byte */ 147198b9484cSchristos dst_ln_entry, /* entry escape, next byte is entry number */ 147298b9484cSchristos dst_ln_exit, /* exit escape */ 147398b9484cSchristos dst_ln_stmt_end, /* gap escape, 4 bytes pc delta */ 147498b9484cSchristos dst_ln_stmt_cp, /* current stmt is a critical point */ 147598b9484cSchristos dst_ln_escape_12, /* reserved */ 147698b9484cSchristos dst_ln_escape_13, /* this is an exception site record */ 147798b9484cSchristos dst_ln_nxt_byte, /* next byte contains the real escape code */ 147898b9484cSchristos dst_ln_end, /* end escape, final entry follows */ 147998b9484cSchristos dst_ln_escape1_END_OF_ENUM 148098b9484cSchristos } 148198b9484cSchristos dst_ln_escape1_t; 148298b9484cSchristos 148398b9484cSchristos typedef enum 148498b9484cSchristos { 148598b9484cSchristos dst_ln_ctx_1, /* next byte describes context switch with 5-bit */ 148698b9484cSchristos /* index into the image table and 3-bit run length. */ 148798b9484cSchristos /* If run length is 0, end with another cxt specifier or ctx_end */ 148898b9484cSchristos dst_ln_ctx_2, /* next 2 bytes switch context: 13 bit index, 3 bit run length */ 148998b9484cSchristos dst_ln_ctx_4, /* next 4 bytes switch context: 29 bit index, 3 bit run length */ 149098b9484cSchristos dst_ln_ctx_end, /* end current context */ 149198b9484cSchristos dst_ln_col_run_1, /* next byte is column position of start of next statement, */ 149298b9484cSchristos /* following byte is length of statement */ 149398b9484cSchristos dst_ln_col_run_2, /* next 2 bytes is column position of start of next statement, */ 149498b9484cSchristos /* following 2 bytes is length of statement */ 149598b9484cSchristos dst_ln_init_base1, /* next 4 bytes are absolute PC, followed by 1 byte of line number */ 149698b9484cSchristos dst_ln_init_base2, /* next 4 bytes are absolute PC, followed by 2 bytes of line number */ 149798b9484cSchristos dst_ln_init_base3, /* next 4 bytes are absolute PC, followed by 3 bytes of line number */ 149898b9484cSchristos dst_ln_escape2_END_OF_ENUM 149998b9484cSchristos } 150098b9484cSchristos dst_ln_escape2_t; 150198b9484cSchristos 150298b9484cSchristos typedef union 150398b9484cSchristos { 150498b9484cSchristos struct 150598b9484cSchristos { 150698b9484cSchristos unsigned int pc_delta : 4; /* 4 bit pc delta */ 150798b9484cSchristos int ln_delta : 4; /* 4 bit line number delta */ 150898b9484cSchristos } 150998b9484cSchristos delta; 151098b9484cSchristos 151198b9484cSchristos struct 151298b9484cSchristos { 151398b9484cSchristos unsigned int esc_flag : 4; /* alias for pc_delta */ 151498b9484cSchristos unsigned int esc_code : 4; /* escape function code (dst_ln_escape1_t, or ...2_t */ 151598b9484cSchristos } 151698b9484cSchristos esc; 151798b9484cSchristos 151898b9484cSchristos struct 151998b9484cSchristos { 152098b9484cSchristos unsigned int esc_flag : 4; /* dst_ln_ctx_spec1, or dst_ln_ctx_spec2 */ 152198b9484cSchristos unsigned int run_length : 2; 152298b9484cSchristos unsigned int ctx_index : 2; /* ...spec2 contains index; ...spec1, index - 4 */ 152398b9484cSchristos } 152498b9484cSchristos ctx_spec; 152598b9484cSchristos 152698b9484cSchristos char sdata; /* signed data byte */ 152798b9484cSchristos unsigned char udata; /* unsigned data byte */ 152898b9484cSchristos } 152998b9484cSchristos dst_ln_entry_t, 153098b9484cSchristos * dst_ln_entry_ptr_t; 153198b9484cSchristos 153298b9484cSchristos /* Warning: although the above union occupies only 1 byte the compiler treats 153398b9484cSchristos it as having size 2 (the minimum size of a struct). Therefore a sequence of 153498b9484cSchristos dst_ln_entry_t's cannot be described as an array, and walking through such a 153598b9484cSchristos sequence requires convoluted code such as 153698b9484cSchristos ln_ptr = (dst_ln_entry_ptr_t) (char*) ln_ptr + 1 153798b9484cSchristos We regret the inconvenience. */ 153898b9484cSchristos 153998b9484cSchristos /* Structure for interpreting the byte following a dst_ln_ctx1 entry. */ 154098b9484cSchristos typedef struct 154198b9484cSchristos { 154298b9484cSchristos unsigned int ctx1_index : 5; /* 5 bit index into context table */ 154398b9484cSchristos unsigned int ctx1_run_length : 3; /* 3 bit run length */ 154498b9484cSchristos } dst_ln_ctx1_t, 154598b9484cSchristos *dst_ln_ctx1_ptr_t; 154698b9484cSchristos 154798b9484cSchristos /* Structure for interpreting the bytes following a dst_ln_ctx2 entry. */ 154898b9484cSchristos typedef struct 154998b9484cSchristos { 155098b9484cSchristos unsigned int ctx2_index : 13; /* 13 bit index into context table */ 155198b9484cSchristos unsigned int ctx2_run_length : 3; /* 3 bit run length */ 155298b9484cSchristos } dst_ln_ctx2_t, 155398b9484cSchristos *dst_ln_ctx2_ptr_t; 155498b9484cSchristos 155598b9484cSchristos /* Structure for interpreting the bytes following a dst_ln_ctx4 entry. */ 155698b9484cSchristos typedef struct 155798b9484cSchristos { 155898b9484cSchristos unsigned int ctx4_index : 29; /* 29 bit index into context table */ 155998b9484cSchristos unsigned int ctx4_run_length : 3; /* 3 bit run length */ 156098b9484cSchristos } dst_ln_ctx4_t, 156198b9484cSchristos *dst_ln_ctx4_ptr_t; 156298b9484cSchristos 156398b9484cSchristos 156498b9484cSchristos /* PXDB definitions. 156598b9484cSchristos 156698b9484cSchristos PXDB is a post-processor which takes the executable file 156798b9484cSchristos and massages the debug information so that the debugger may 156898b9484cSchristos start up and run more efficiently. Some of the tasks 156998b9484cSchristos performed by PXDB are: 157098b9484cSchristos 157198b9484cSchristos o Remove duplicate global type and variable information 157298b9484cSchristos from the GNTT, 157398b9484cSchristos 157498b9484cSchristos o Append the GNTT onto the end of the LNTT and place both 157598b9484cSchristos back in the LNTT section, 157698b9484cSchristos 157798b9484cSchristos o Build quick look-up tables (description follows) for 157898b9484cSchristos files, procedures, modules, and paragraphs (for Cobol), 157998b9484cSchristos placing these in the GNTT section, 158098b9484cSchristos 158198b9484cSchristos o Reconstruct the header appearing in the header section 158298b9484cSchristos to access this information. 158398b9484cSchristos 158498b9484cSchristos The "quick look-up" tables are in the $GNTT$ sub-space, in 158598b9484cSchristos the following order: 158698b9484cSchristos 158798b9484cSchristos Procedures -sorted by address 158898b9484cSchristos Source files -sorted by address (of the 158998b9484cSchristos generated code from routines) 159098b9484cSchristos Modules -sorted by address 159198b9484cSchristos Classes -<unsorted?> 159298b9484cSchristos Address Alias -sorted by index <?> 159398b9484cSchristos Object IDs -sorted by object identifier 159498b9484cSchristos 159598b9484cSchristos Most quick entries have (0-based) indices into the LNTT tables to 159698b9484cSchristos the full entries for the item it describes. 159798b9484cSchristos 159898b9484cSchristos The post-PXDB header is in the $HEADER$ sub-space. Alas, it 159998b9484cSchristos occurs in different forms, depending on the optimization level 160098b9484cSchristos in the compilation step and whether PXDB was run or not. The 160198b9484cSchristos worst part is the forms aren't self-describing, so we'll have 160298b9484cSchristos to grovel in the bits to figure out what kind we're looking at 160398b9484cSchristos (see hp_get_header in hp-psymtab-read.c). */ 160498b9484cSchristos 160598b9484cSchristos /* PXDB versions. */ 160698b9484cSchristos 160798b9484cSchristos #define PXDB_VERSION_CPLUSPLUS 1 160898b9484cSchristos #define PXDB_VERSION_7_4 2 160998b9484cSchristos #define PXDB_VERSION_CPP_30 3 161098b9484cSchristos #define PXDB_VERSION_DDE_3_2A 4 161198b9484cSchristos #define PXDB_VERSION_DDE_3_2 5 161298b9484cSchristos #define PXDB_VERSION_DDE_4_0 6 161398b9484cSchristos 161498b9484cSchristos #define PXDB_VERSION_2_1 1 161598b9484cSchristos 161698b9484cSchristos /* Header version for the case that there is no DOC info 161798b9484cSchristos but the executable has been processed by pxdb (the easy 161898b9484cSchristos case, from "cc -g"). */ 161998b9484cSchristos 162098b9484cSchristos typedef struct PXDB_struct 162198b9484cSchristos { 162298b9484cSchristos int pd_entries; /* # of entries in function look-up table */ 162398b9484cSchristos int fd_entries; /* # of entries in file look-up table */ 162498b9484cSchristos int md_entries; /* # of entries in module look-up table */ 162598b9484cSchristos unsigned int pxdbed : 1; /* 1 => file has been preprocessed */ 162698b9484cSchristos unsigned int bighdr : 1; /* 1 => this header contains 'time' word */ 162798b9484cSchristos unsigned int sa_header : 1;/* 1 => created by SA version of pxdb */ 162898b9484cSchristos /* used for version check in xdb */ 162998b9484cSchristos unsigned int inlined: 1; /* one or more functions have been inlined */ 163098b9484cSchristos unsigned int spare:12; 163198b9484cSchristos short version; /* pxdb header version */ 163298b9484cSchristos int globals; /* index into the DNTT where GNTT begins */ 163398b9484cSchristos unsigned int time; /* modify time of file before being pxdbed */ 163498b9484cSchristos int pg_entries; /* # of entries in label look-up table */ 163598b9484cSchristos int functions; /* actual number of functions */ 163698b9484cSchristos int files; /* actual number of files */ 163798b9484cSchristos int cd_entries; /* # of entries in class look-up table */ 163898b9484cSchristos int aa_entries; /* # of entries in addr alias look-up table */ 163998b9484cSchristos int oi_entries; /* # of entries in object id look-up table */ 164098b9484cSchristos } PXDB_header, *PXDB_header_ptr; 164198b9484cSchristos 164298b9484cSchristos /* Header version for the case that there is no DOC info and the 164398b9484cSchristos executable has NOT been processed by pxdb. */ 164498b9484cSchristos 164598b9484cSchristos typedef struct XDB_header_struct 164698b9484cSchristos { 164798b9484cSchristos long gntt_length; 164898b9484cSchristos long lntt_length; 164998b9484cSchristos long slt_length; 165098b9484cSchristos long vt_length; 165198b9484cSchristos long xt_length; 165298b9484cSchristos } XDB_header; 165398b9484cSchristos 165498b9484cSchristos /* Header version for the case that there is DOC info and the 165598b9484cSchristos executable has been processed by pxdb. */ 165698b9484cSchristos 165798b9484cSchristos typedef struct DOC_info_PXDB_header_struct 165898b9484cSchristos { 165998b9484cSchristos unsigned int xdb_header: 1; /* bit set if this is post-3.1 xdb */ 166098b9484cSchristos unsigned int doc_header: 1; /* bit set if this is doc-style header */ 166198b9484cSchristos unsigned int version: 8; /* version of pxdb see defines 166298b9484cSchristos PXDB_VERSION_* in this file. */ 166398b9484cSchristos unsigned int reserved_for_flags: 16;/* for future use; -- must be 166498b9484cSchristos set to zero. */ 166598b9484cSchristos unsigned int has_aux_pd_table: 1; /* $GNTT$ has aux PD table */ 166698b9484cSchristos unsigned int has_expr_table: 1; /* space has $EXPR$ */ 166798b9484cSchristos unsigned int has_range_table: 1; /* space has $RANGE$ */ 166898b9484cSchristos unsigned int has_context_table: 1; /* space has $SRC_CTXT$ */ 166998b9484cSchristos unsigned int has_lines_table: 1; /* space contains a $LINES$ 167098b9484cSchristos subspace for line tables. */ 167198b9484cSchristos unsigned int has_lt_offset_map: 1; /* space contains an lt_offset 167298b9484cSchristos subspace for line table mapping. */ 167398b9484cSchristos /* The following fields are the same as those in the PXDB_header in $DEBUG$ */ 167498b9484cSchristos int pd_entries; /* # of entries in function look-up table */ 167598b9484cSchristos int fd_entries; /* # of entries in file look-up table */ 167698b9484cSchristos int md_entries; /* # of entries in module look-up table */ 167798b9484cSchristos unsigned int pxdbed : 1; /* 1 => file has been preprocessed */ 167898b9484cSchristos unsigned int bighdr : 1; /* 1 => this header contains 'time' word */ 167998b9484cSchristos unsigned int sa_header : 1;/* 1 => created by SA version of pxdb */ 168098b9484cSchristos /* used for version check in xdb */ 168198b9484cSchristos unsigned int inlined: 1; /* one or more functions have been inlined */ 168298b9484cSchristos unsigned int spare : 28; 168398b9484cSchristos int globals; /* index into the DNTT where GNTT begins */ 168498b9484cSchristos unsigned int time; /* modify time of file before being pxdbed */ 168598b9484cSchristos int pg_entries; /* # of entries in label look-up table */ 168698b9484cSchristos int functions; /* actual number of functions */ 168798b9484cSchristos int files; /* actual number of files */ 168898b9484cSchristos int cd_entries; /* # of entries in class look-up table */ 168998b9484cSchristos int aa_entries; /* # of entries in addr alias look-up table */ 169098b9484cSchristos int oi_entries; /* # of entries in object id look-up table */ 169198b9484cSchristos } DOC_info_PXDB_header; 169298b9484cSchristos 169398b9484cSchristos /* Header version for the case that there is DOC info and the 169498b9484cSchristos executable has NOT been processed by pxdb. */ 169598b9484cSchristos 169698b9484cSchristos typedef struct DOC_info_header_struct 169798b9484cSchristos { 169898b9484cSchristos unsigned int xdb_header: 1; /* bit set if this is post-3.1 xdb */ 169998b9484cSchristos unsigned int doc_header: 1; /* bit set if this is doc-style header*/ 170098b9484cSchristos unsigned int version: 8; /* version of debug/header 170198b9484cSchristos format. For 10.0 the value 170298b9484cSchristos will be 1. For "Davis" the value is 2. */ 170398b9484cSchristos unsigned int reserved_for_flags: 18; /* for future use; -- must be set to zero. */ 170498b9484cSchristos unsigned int has_range_table: 1; /* space contains a $RANGE$ subspace for variable ranges. */ 170598b9484cSchristos unsigned int has_context_table: 1; /* space contains a $CTXT$ subspace for context/inline table. */ 170698b9484cSchristos unsigned int has_lines_table: 1; /* space contains a $LINES$ subspace for line tables. */ 170798b9484cSchristos unsigned int has_lt_offset_map: 1; /* space contains an lt_offset subspace for line table mapping. */ 170898b9484cSchristos 170998b9484cSchristos long gntt_length; /* same as old header */ 171098b9484cSchristos long lntt_length; /* same as old header */ 171198b9484cSchristos long slt_length; /* same as old header */ 171298b9484cSchristos long vt_length; /* same as old header */ 171398b9484cSchristos long xt_length; /* same as old header */ 171498b9484cSchristos long ctxt_length; /* present only if version >= 2 */ 171598b9484cSchristos long range_length; /* present only if version >= 2 */ 171698b9484cSchristos long expr_length; /* present only if version >= 2 */ 171798b9484cSchristos 171898b9484cSchristos } DOC_info_header; 171998b9484cSchristos 172098b9484cSchristos typedef union GenericDebugHeader_union 172198b9484cSchristos { 172298b9484cSchristos PXDB_header no_doc; 172398b9484cSchristos DOC_info_PXDB_header doc; 172498b9484cSchristos XDB_header no_pxdb_no_doc; 172598b9484cSchristos DOC_info_header no_pxdb_doc; 172698b9484cSchristos } GenericDebugHeader; 172798b9484cSchristos 172898b9484cSchristos 172998b9484cSchristos /* Procedure Descriptor: 173098b9484cSchristos An element of the procedure quick look-up table. */ 173198b9484cSchristos 173298b9484cSchristos typedef struct quick_procedure 173398b9484cSchristos { 173498b9484cSchristos long isym; /* 0-based index of first symbol 173598b9484cSchristos for procedure in $LNTT$, 173698b9484cSchristos i.e. the procedure itself. */ 173798b9484cSchristos CORE_ADDR adrStart; /* memory adr of start of proc */ 173898b9484cSchristos CORE_ADDR adrEnd; /* memory adr of end of proc */ 173998b9484cSchristos char *sbAlias; /* alias name of procedure */ 174098b9484cSchristos char *sbProc; /* real name of procedure */ 174198b9484cSchristos CORE_ADDR adrBp; /* address of entry breakpoint */ 174298b9484cSchristos CORE_ADDR adrExitBp; /* address of exit breakpoint */ 174398b9484cSchristos int icd; /* member of this class (index) */ 174498b9484cSchristos unsigned int ipd; /* index of template for this */ 174598b9484cSchristos /* function (index) */ 174698b9484cSchristos unsigned int unused: 5; 174798b9484cSchristos unsigned int no_lt_offset: 1;/* no entry in lt_offset table */ 174898b9484cSchristos unsigned int fTemplate: 1; /* function template */ 174998b9484cSchristos unsigned int fExpansion: 1; /* function expansion */ 175098b9484cSchristos unsigned int linked : 1; /* linked with other expansions */ 175198b9484cSchristos unsigned int duplicate: 1; /* clone of another procedure */ 175298b9484cSchristos unsigned int overloaded:1; /* overloaded function */ 175398b9484cSchristos unsigned int member: 1; /* class member function */ 175498b9484cSchristos unsigned int constructor:1; /* constructor function */ 175598b9484cSchristos unsigned int destructor:1; /* destructor function */ 175698b9484cSchristos unsigned int Static: 1; /* static function */ 175798b9484cSchristos unsigned int Virtual: 1; /* virtual function */ 175898b9484cSchristos unsigned int constant: 1; /* constant function */ 175998b9484cSchristos unsigned int pure: 1; /* pure (virtual) function */ 176098b9484cSchristos unsigned int language: 4; /* procedure's language */ 176198b9484cSchristos unsigned int inlined: 1; /* function has been inlined */ 176298b9484cSchristos unsigned int Operator: 1; /* operator function */ 176398b9484cSchristos unsigned int stub: 1; /* bodyless function */ 176498b9484cSchristos unsigned int optimize: 2; /* optimization level */ 176598b9484cSchristos unsigned int level: 5; /* nesting level (top=0) */ 176698b9484cSchristos } quick_procedure_entry, *quick_procedure_entry_ptr; 176798b9484cSchristos 176898b9484cSchristos /* Source File Descriptor: 176998b9484cSchristos An element of the source file quick look-up table. */ 177098b9484cSchristos 177198b9484cSchristos typedef struct quick_source 177298b9484cSchristos { 177398b9484cSchristos long isym; /* 0-based index in $LNTT$ of 177498b9484cSchristos first symbol for this file. */ 177598b9484cSchristos CORE_ADDR adrStart; /* mem adr of start of file's code */ 177698b9484cSchristos CORE_ADDR adrEnd; /* mem adr of end of file's code */ 177798b9484cSchristos char *sbFile; /* name of source file */ 177898b9484cSchristos unsigned int fHasDecl: 1; /* do we have a .d file? */ 177998b9484cSchristos unsigned int fWarned: 1; /* have warned about age problems? */ 178098b9484cSchristos unsigned int fSrcfile: 1; /* 0 => include 1=> source */ 178198b9484cSchristos unsigned short ilnMac; /* lines in file (0 if don't know) */ 178298b9484cSchristos int ipd; /* 0-based index of first procedure 178398b9484cSchristos in this file, in the quick 178498b9484cSchristos look-up table of procedures. */ 178598b9484cSchristos unsigned int *rgLn; /* line pointer array, if any */ 178698b9484cSchristos } quick_file_entry, *quick_file_entry_ptr; 178798b9484cSchristos 178898b9484cSchristos /* Module Descriptor: 178998b9484cSchristos An element of the module quick reference table. */ 179098b9484cSchristos 179198b9484cSchristos typedef struct quick_module 179298b9484cSchristos { 179398b9484cSchristos long isym; /* 0-based index of first 179498b9484cSchristos symbol for module. */ 179598b9484cSchristos CORE_ADDR adrStart; /* adr of start of mod. */ 179698b9484cSchristos CORE_ADDR adrEnd; /* adr of end of mod. */ 179798b9484cSchristos char *sbAlias; /* alias name of module */ 179898b9484cSchristos char *sbMod; /* real name of module */ 179998b9484cSchristos unsigned int imports: 1; /* module have any imports? */ 180098b9484cSchristos unsigned int vars_in_front: 1; /* module globals in front? */ 180198b9484cSchristos unsigned int vars_in_gaps: 1; /* module globals in gaps? */ 180298b9484cSchristos unsigned int language: 4; /* type of language */ 180398b9484cSchristos unsigned int unused : 25; 180498b9484cSchristos unsigned int unused2; /* space for future stuff */ 180598b9484cSchristos } quick_module_entry, *quick_module_entry_ptr; 180698b9484cSchristos 180798b9484cSchristos /* Auxiliary Procedure Descriptor: 180898b9484cSchristos An element of the auxiliary procedure quick look-up table. */ 180998b9484cSchristos 181098b9484cSchristos typedef struct quick_aux_procedure 181198b9484cSchristos { 181298b9484cSchristos long isym_inln; /* start on inline list for proc */ 181398b9484cSchristos long spare; 181498b9484cSchristos } quick_aux_procedure_entry, *quick_aux_procedure_entry_ptr; 181598b9484cSchristos 181698b9484cSchristos /* Paragraph Descriptor: 181798b9484cSchristos An element of the paragraph quick look-up table. */ 181898b9484cSchristos 181998b9484cSchristos typedef struct quick_paragraph 182098b9484cSchristos { 182198b9484cSchristos long isym; /* first symbol for label (index) */ 182298b9484cSchristos CORE_ADDR adrStart; /* memory adr of start of label */ 182398b9484cSchristos CORE_ADDR adrEnd; /* memory adr of end of label */ 182498b9484cSchristos char *sbLab; /* name of label */ 182598b9484cSchristos unsigned int inst; /* Used in xdb to store inst @ bp */ 182698b9484cSchristos unsigned int sect: 1; /* true = section, false = parag. */ 182798b9484cSchristos unsigned int unused: 31; /* future use */ 182898b9484cSchristos } quick_paragraph_entry, *quick_paragraph_entry_ptr; 182998b9484cSchristos 183098b9484cSchristos /* Class Descriptor: 183198b9484cSchristos An element of the class quick look-up table. */ 183298b9484cSchristos 183398b9484cSchristos typedef struct quick_class 183498b9484cSchristos { 183598b9484cSchristos char *sbClass; /* name of class */ 183698b9484cSchristos long isym; /* class symbol (tag) */ 183798b9484cSchristos unsigned int type : 2; /* 0=class, 1=union, 2=struct */ 183898b9484cSchristos unsigned int fTemplate : 1;/* class template */ 183998b9484cSchristos unsigned int expansion : 1;/* template expansion */ 184098b9484cSchristos unsigned int unused :28; 184198b9484cSchristos sltpointer lowscope; /* beginning of defined scope */ 184298b9484cSchristos sltpointer hiscope; /* end of defined scope */ 184398b9484cSchristos } quick_class_entry, *quick_class_entry_ptr; 184498b9484cSchristos 184598b9484cSchristos /* Address Alias Entry 184698b9484cSchristos An element of the address alias quick look-up table. */ 184798b9484cSchristos 184898b9484cSchristos typedef struct quick_alias 184998b9484cSchristos { 185098b9484cSchristos CORE_ADDR low; 185198b9484cSchristos CORE_ADDR high; 185298b9484cSchristos int index; 185398b9484cSchristos unsigned int unused : 31; 185498b9484cSchristos unsigned int alternate : 1; /* alternate unnamed aliases? */ 185598b9484cSchristos } quick_alias_entry, *quick_alias_entry_ptr; 185698b9484cSchristos 185798b9484cSchristos /* Object Identification Entry 185898b9484cSchristos An element of the object identification quick look-up table. */ 185998b9484cSchristos 186098b9484cSchristos typedef struct quick_obj_ID 186198b9484cSchristos { 186298b9484cSchristos CORE_ADDR obj_ident; /* class identifier */ 186398b9484cSchristos long isym; /* class symbol */ 186498b9484cSchristos long offset; /* offset to object start */ 186598b9484cSchristos } quick_obj_ID_entry, *quick_obj_ID_entry_ptr; 186698b9484cSchristos 186798b9484cSchristos #endif /* HP_SYMTAB_INCLUDED */ 1868