#ifndef _SYMTAB64_INCLUDED /* allow multiple inclusions */ #define _SYMTAB64_INCLUDED /***************************************************************** * Revision: 71 * 7/21/95 by Dan Schmitz (dschmitz@apollo.hp.com) * Initial conversion to 64 bit SOM debug format * ***************************************************************** * $Source: /ses/Tahoe/product/doc/htdocs/software/symtab64_h.txt $ * $Revision: 1.3 $ * $Date: 1999/12/16 19:56:46 $ ***************************************************************** * Revision 66.25 91/01/13 19:03:48 19:03:48 ssa (Shared Source Administrator) * Author: jmn@sluggo * added DNTT_FUNC.localloc flag; for C++300 compiler (jmn for bruno) * * Revision 66.24 90/08/21 10:38:03 10:38:03 markm (Mark McDowell) * A distinction is now made between "float" and "double" for the declared * type of a parameter or variable. This allows us to print the correct * declared type for a floating point parameter regardless of how that * parameter is actually passed. Note that this must be "turned on" in * PrintType by removing some comment delimiters when the C and C++ compilers * generate this new type information. * * Revision 66.23 90/07/26 09:53:53 09:53:53 bruno (Bruno Melli) * Added a new define for pxdb version number * * Revision 66.22 90/06/08 16:20:48 16:20:48 markm (Mark McDowell) * The difference between "int" and "long" is now recognized. * * Revision 66.21 90/03/14 16:23:59 16:23:59 markm (Mark McDowell) * Added "functions" and "files" fields to pxdb header. * * Revision 66.20 89/12/22 09:24:37 09:24:37 markm (Mark McDowell) * Made the PDS's language field visible to non-C++ debuggers. * * Revision 66.19 89/12/15 15:58:14 15:58:14 markm (Mark McDowell) * Added "classflag" bits to DNTT_BEGIN and DNTT_END to handle local class * definitions. Added K_MEMFUNC kind to handle "dangling" DNTT_FUNC * definitions created in class definitions. * * Revision 66.18 89/12/08 11:45:23 11:45:23 markm (Mark McDowell) * Added "segoffset" field to DNTT_OBJECT_ID for use by the linker. * * Revision 66.17 89/11/30 14:37:21 14:37:21 markm (Mark McDowell) * Added stub flag to procedure descriptor structure for bodyless functions. * * Revision 66.13 89/11/14 09:28:36 09:28:36 markm (Mark McDowell) * Add classmem bits to DNTT_CONST and DNTT_MEMENUM. * * Revision 66.12 89/11/07 14:50:25 14:50:25 jmn (John Newman) * fixed #define of K_MAX to correct value * * Revision 66.11 89/11/01 10:43:37 10:43:37 markm (Mark McDowell) * The lowscope and hiscope fields of the class descriptor were changed * from VTPOINTER's to SLTPOINTER's. * * Revision 66.10 89/10/27 10:50:18 10:50:18 markm (Mark McDowell) * Add promoted bit to DNTT_INHERITANCE. * * Revision 66.9 89/10/23 15:15:22 15:15:22 markm (Mark McDowell) * Add inlined bit to PXDB_header. * * Revision 66.8 89/10/23 14:38:47 14:38:47 markm (Mark McDowell) * Add alternate bit to AAS. * * Revision 66.7 89/10/23 14:06:15 14:06:15 markm (Mark McDowell) * Add Operator and inlined bits to PDS; lowscope and hiscope fields * to CDS. * * Revision 66.6 89/10/11 08:23:30 08:23:30 markm (Mark McDowell) * Added anonymous union bit to DNTT_GENFIELD. * * Revision 66.5 89/10/05 17:24:05 17:24:05 bruno (Bruno Melli) * split unused field in PXDB_header into unused and short for * version number. * * Revision 66.4 89/09/22 16:24:30 16:24:30 jmn (John Newman) * Merged in all C++ definitions. * Changed semantics for Block Data; now uses K_BLOCKDATA * instead of F_ARGMODE_BLKDATA. * * Revision 66.3 89/09/06 15:33:30 15:33:30 jww (Jim Wichelman) * Add _SYMTAB_INCLUDED to support multiple includes (for s300 ccom). * * Revision 66.2 89/08/29 09:39:05 09:39:05 jmn (John Newman) * added language field to DNTT_XREF (requested by Schumacher) * * Revision 66.1 89/08/21 09:22:07 09:22:07 markm (Mark McDowell) * Merged s300 and s800 symtab.h formats. * * Revision 7.2 89/04/12 10:21:57 10:21:57 xdb (John Newman) * added DNTT_IMPORT.explicit flag (re S. Folkman, SR#4700749770) * * Revision 7.1 89/02/28 11:20:18 11:20:18 jmn (John Newman) * rearranged RCS header a bit * * Revision 7.0 89/02/28 11:13:08 11:13:08 jmn (John Newman) * more HPUX 7.0 additions: * - commentary on T_WIDE_CHAR basetype * - new fields in DNTT_FUNC: varargs, info * - values for DNTT_FUNC.info field (relating to C fparams); commentary * * Revision 2.1 88/11/03 11:08:40 11:08:40 jmn (John Newman) * new basetype: T_WIDE_CHAR * * Revision 2.0 88/10/24 11:00:34 11:00:34 jmn (John Newman) * Initial (RCS) revision * ***************************************************************** * Initial (pre-RCS) revision: 86/12/17 ***************************************************************** * Statis Analysis: * - Revised to include new XREF information for * Excalibur Static Analysis support. - mcgrory, ras (7/25/88) * - Revised Static Analysis info including new INFO2 record * in XT table, the addition of the optimize field in the * DNTT_FUNC record, the definition of K_MAX, and the removal * of the definition of uint. - sjl (8/8/88) * - Moved definitions of the quick look-up table array elements * into symtab.h. Added defns for K_SA, and K_MACRO dntts - sjl (8/23/88) * - Added #if[n]def NO_SA to provide backward compatibility with non-SA * compilers. - jmn (9/23/88) * - Added extension_header flag to XDB_header - jmn (10/1/88) * - Added sa_header flag to PXDB_header - jmn (10/1/88) ***************************************************************** * */ /* * * SYMBOLIC DEBUG FORMAT ACD * $Revision: 1.3 $ * * * * ---- 1. INTRODUCTION * * * This document describes the current format for data tables which * appear in HP-UX / HPE object files (a.out files). These tables * will be generated by the compilers, fixed up by the linker, and * used by various programs (primarily the symbolic debugger(s)) to * reconstruct information about the program. The form of this * document is a C include file annotated with comments. * * On SPECTRUM, a major goal was that the linker need not know * anything about the format. To this end, it was decided that the * debug information be composed of several unloadable subspaces * within an unloadable space (named $DEBUG$), and that link time * updates to the debug information be made through the standard * mechanism of a list of fixups. The linker will perform the * required fixups for the debug spaces, and subspaces from * separate compilation units will be concatenated. However, at * exec time, the loader would know that the debug space is not to * be loaded. * * Similarly, on the series 300, several debug tables are present * in the a.out format which are not loaded at exec time. Debug * tables are simply concatenated into larger tables at link time * and all fixups are then performed by pxdb. */ /* * ---- 2. SUMMARY OF STRUCTURES * * * The debug information consists of six tables: a header table * and five special tables. The header table will contain one * header record for each compilation unit. Each header record * identifies the size (in bytes) of the five tables generated by * that compilation unit. Two of the tables are very similar. The * GNTT and LNTT both contain name and type information (NTT for * Name and Type Table). The GNTT contains information about * globals, and is thus limited to variables, types, and constants. * The LNTT is for information about locals. The LNTT must * therefore contain scoping information such as procedure nesting, * begin-end blocks, etc. The GNTT and LNTT are both DNTTs (Debug * Name and Type Tables), so the prefix DNTT is attached to objects * (like a DNTTPOINTER) that are relevant to both the GNTT and * LNTT. The SLT contains information relating source (or listing) * lines to code addresses. The SLT and LNTT contain pointers * between the two tables, so that the scoping information * contained in the LNTT can also be used with the SLT. The VT * contains ascii strings (such as variable names) and the values * of named constants. The five tables are summarized below: * * * Table Abbr Contains Points into * ============= ==== ========================= =============== * Global symbols GNTT global name-and-type info GNTT * Local symbols LNTT local name-and-type info GNTT,LNTT,SLT,VT * source line SLT source/listing line info LNTT,SLT * value VT names and constants - * xref XT File offsets and Attributes XT,VT * * * The pointers needed within the debug tables are in fact indexes * into the tables. The GNTT, LNTT, and SLT each consist of a series * of equal-sized entries. Some DNTT entries begin a data structure * and some are extension entries. Some SLT entries are "special" * (point back to the LNTT), others are "assist" (point forward in * the SLT), but most are "normal" (point to code). * * There can be pointers from the LNTT to the GNTT, as it is common * to have local variables of a global type. However, there are * never pointers from the GNTT to the LNTT, as global variables * are never of a local type. * * The tables are defined to be as machine-independent as possible, * but the debugger may need to "know" some facts about the system * and language it is dealing with. * * The GNTT and LNTT are the only tables that require fixups to be * generated by the compiler and acted upon by the linker. There * are other fixups to be done, but these are all done by the pre- * processor. */ /* * ---- 3. LOW-LEVEL TYPE DECLARATIONS */ /* * Code or data address: * * For the series 300: * * A virtual Address * * For Spectrum: * * A Spectrum short pointer. * */ #if __cplusplus #include #define public global #elif defined USE_LANGTYPES_INCLUDE /* We need to include this file, instead of defining the following types, if * the source code is also including libelf.h */ #include #else typedef long long Int64; typedef unsigned long long UInt64; typedef int Int32; typedef unsigned int UInt32; typedef short Int16; typedef unsigned short UInt16; #endif #include "symtabcommon.h" typedef Int64 ADDRESS; typedef UInt64 ADRT, *pADRT; typedef unsigned int BITS; /* * Language types: * * Sizeof (LANGTYPE) = 4 bits, for a maximum of 16 possible * language types. */ typedef BITS LANGTYPE; /* * Location types: * * machine-dependent and context-dependent specifiers of * variable storage location. */ typedef UInt64 STATTYPE; /* static-type location */ typedef Int64 DYNTYPE; /* dynamic-type location */ typedef UInt32 REGTYPE; /* register-type location */ typedef Int64 CONSTVALUE; /* hold a constant value */ typedef UInt64 BITLENGTH; /* store the bitsize */ typedef UInt64 BITOFFSET; /* store an offset in bits */ /* * Loc type Series 300 Spectrum * ======== ================ =============== * * STATTYPE Absolute address A Spectrum * into process short pointer. * space (could be * code or data). * * * DYNTYPE A6-register- SP-register * relative byte relative byte * offset (+/-). offset (+/-) * * REGTYPE Register number Register number * (see below). (see below). * * All location types are always byte (not word) pointers when they * address memory, and they always point to the first byte * containing the object, skipping any padding bytes. For example, * if in Pascal a CHAR is allocated in the last byte of a whole * word, the pointer is to that byte. (In C, four different CHAR * variables might be packed into one word.) */ /* * Meaning of STATTYPE for CONST entries: * * Sizeof (LOCDESCTYPE) = 3 bits, for a maximum of 8 possible * desctypes. */ typedef BITS LOCDESCTYPE; /* * Basetypes: * * Sizeof (BASETYPE) = 5 bits, for a maximum of 32 possible * basetypes. */ typedef BITS BASETYPE; /* THE HIGHEST BASE_TYPE ALLOWABLE is 31 (see DNTTP_IMMEDIATE) */ /* * The string types are reserved for cases where the language has * an explicit string type separate from "array of char". * * The ANSI/C wchar_t typedef defines a special base-type to * the debugger. The interpretation of wide-characters during * input or display (i.e. their mapping to/from "external" * characters) is defined by the ANSI/C functions mbtowc() and * wctomb(), the "multi-byte" translation functions. * * T_FLABEL is used for CONSTs which are actually FORTRAN labels. * The T_FLABEL is needed for the following: in FORTRAN there is * the ASSIGN statement (ASSIGN