From 8ee0532ba8de5c9f4055959738cbeb7244a3e7f8 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 25 Nov 1994 07:32:51 +0000 Subject: [PATCH] * hp-symtab.h: New file describing the debug symbols emitted by the HP C compilers. * hpux-symtab.h: Deleted. NOTE: hpux-symtab.h was the HP copyrighted description and data structures for the debug symbols emitted by the various HP compilers (C, C++, Fortran, Cobol, Pascal, Modula-2, Cobol, etc). hp-symtab.h is my rewritten version which only describes the debug symbols used by the HP C compiler. hp-symtab.h is intended to be copyrighted by the FSF as part of GDB. --- include/.Sanitize | 7 +- include/ChangeLog | 15 + include/ChangeLog.hpread | 6 - include/hp-symtab.h | 983 +++++++++++++++ include/hpux-symtab.h | 2559 -------------------------------------- 5 files changed, 999 insertions(+), 2571 deletions(-) delete mode 100644 include/ChangeLog.hpread create mode 100644 include/hp-symtab.h delete mode 100755 include/hpux-symtab.h diff --git a/include/.Sanitize b/include/.Sanitize index aab0e01801..4ad77262f5 100644 --- a/include/.Sanitize +++ b/include/.Sanitize @@ -21,12 +21,6 @@ else lose_these_too="${lose_these_too} mpw" fi -if ( echo $* | grep keep\-hpread > /dev/null ) ; then - keep_these_too="${keep_these_too} hpux-symtab.h ChangeLog.hpread" -else - lose_these_too="${lose_these_too} hpux-symtab.h ChangeLog.hpread" -fi - # All files listed between the "Things-to-keep:" line and the # "Files-to-sed:" line will be kept. All other files will be removed. # Directories listed in this section will have their own Sanitize @@ -50,6 +44,7 @@ fopen-bin.h fopen-same.h gdbm.h getopt.h +hp-symtab.h ieee.h libiberty.h nlm diff --git a/include/ChangeLog b/include/ChangeLog index b11a3988c2..b91ed0ad2d 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,18 @@ +Fri Nov 25 00:14:05 1994 Jeff Law (law@snake.cs.utah.edu) + + * hp-symtab.h: New file describing the debug symbols emitted + by the HP C compilers. + +Fri Nov 11 15:48:37 1994 Ian Lance Taylor + + * bfdlink.h (struct bfd_link_hash_entry): Change u.c.size from 24 + to 26 bits, and change u.c.alignment_power from 8 to 6 bits. 6 + bit in the alignment power is enough for a 64 bit address space. + +Mon Oct 31 13:02:51 1994 Stan Shebs (shebs@andros.cygnus.com) + + * demangle.h (cplus_mangle_opname): Declare. + Tue Oct 25 11:38:02 1994 Ian Lance Taylor * bfdlink.h (struct bfd_link_callbacks): Fix comments for diff --git a/include/ChangeLog.hpread b/include/ChangeLog.hpread deleted file mode 100644 index 08bfaa29f2..0000000000 --- a/include/ChangeLog.hpread +++ /dev/null @@ -1,6 +0,0 @@ -Fri Aug 19 09:56:31 1994 Jeff Law (law@snake.cs.utah.edu) - - * hpux-symtab.h: New file describing the debug symbols emitted by - the HP C compilers. - - diff --git a/include/hp-symtab.h b/include/hp-symtab.h new file mode 100644 index 0000000000..84f6a513ea --- /dev/null +++ b/include/hp-symtab.h @@ -0,0 +1,983 @@ +/* Definitions and structures for reading debug symbols from the + native HP C compiler. + + Written by the Center for Software Science at the University of Utah + and by Cygnus Support. + + Copyright 1994 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef HP_SYMTAB_INCLUDED +#define HP_SYMTAB_INCLUDED + +/* General information: + + This header file defines and describes only the basic data structures + necessary to read debug symbols produced by the HP C compiler using the + SOM object file format. Definitions and structures used by other compilers + for other languages or object file formats may be missing. + (For a full description of the debug format, ftp hpux-symtab.h from + jaguar.cs.utah.edu:/dist). + + + Debug symbols are contained entirely within an unloadable space called + $DEBUG$. $DEBUG$ contains several subspaces which group related + debug symbols. + + $GNTT$ contains information for global variables, types and contants. + + $LNTT$ contains information for procedures (including nesting), scoping + information, local variables, types, and constants. + + $SLT$ contains source line information so that code addresses may be + mapped to source lines. + + $VT$ contains various strings and constants for named objects (variables, + typedefs, functions, etc). Strings are stored as null-terminated character + lists. Constants always begin on word boundaries. The first byte of + the VT must be zero (a null string). + + $XT$ is not currently used by GDB. + + Many structures within the subspaces point to other structures within + the same subspace, or to structures within a different subspace. These + pointers are represented as a structure index from the beginning of + the appropriate subspace. */ + +/* Used to describe where a constant is stored. */ +enum location_type +{ + LOCATION_IMMEDIATE, + LOCATION_PTR, + LOCATION_VT, +}; + +/* Languages supported by this debug format. Within the data structures + this type is limited to 4 bits for a maximum of 16 languages. */ +enum hp_language +{ + HP_LANGUAGE_UNKNOWN, + HP_LANGUAGE_C, + HP_LANGUAGE_F77, + HP_LANGUAGE_PASCAL, + HP_LANGUAGE_COBOL, + HP_LANGUAGE_BASIC, + HP_LANGUAGE_ADA, + HP_LANGUAGE_CPLUSPLUS, +}; + + +/* Basic data types available in this debug format. Within the data + structures this type is limited to 5 bits for a maximum of 32 basic + data types. */ +enum hp_type +{ + HP_TYPE_UNDEFINED, + HP_TYPE_BOOLEAN, + HP_TYPE_CHAR, + HP_TYPE_INT, + HP_TYPE_UNSIGNED_INT, + HP_TYPE_REAL, + HP_TYPE_COMPLEX, + HP_TYPE_STRING200, + HP_TYPE_LONGSTRING200, + HP_TYPE_TEXT, + HP_TYPE_FLABEL, + HP_TYPE_FTN_STRING_SPEC, + HP_TYPE_MOD_STRING_SPEC, + HP_TYPE_PACKED_DECIMAL, + HP_TYPE_REAL_3000, + HP_TYPE_MOD_STRING_3000, + HP_TYPE_ANYPOINTER, + HP_TYPE_GLOBAL_ANYPOINTER, + HP_TYPE_LOCAL_ANYPOINTER, + HP_TYPE_COMPLEXS3000, + HP_TYPE_FTN_STRING_S300_COMPAT, + HP_TYPE_FTN_STRING_VAX_COMPAT, + HP_TYPE_BOOLEAN_S300_COMPAT, + HP_TYPE_BOOLEAN_VAX_COMPAT, + HP_TYPE_WIDE_CHAR, + HP_TYPE_LONG, + HP_TYPE_UNSIGNED_LONG, + HP_TYPE_DOUBLE, + HP_TYPE_TEMPLATE_ARG, +}; + +/* An immediate name and type table entry. + + extension and immediate will always be one. + global will always be zero. + hp_type is the basic type this entry describes. + bitlength is the length in bits for the basic type. */ +struct dnttp_immediate +{ + unsigned int extension: 1; + unsigned int immediate: 1; + unsigned int global: 1; + enum hp_type type: 5; + unsigned int bitlength: 24; +}; + +/* A nonimmediate name and type table entry. + + extension will always be one. + immediate will always be zero. + if global is zero, this entry points into the LNTT + if global is one, this entry points into the GNTT + index is the index within the GNTT or LNTT for this entry. */ +struct dnttp_nonimmediate +{ + unsigned int extension: 1; + unsigned int immediate: 1; + unsigned int global: 1; + unsigned int index: 29; +}; + +/* A pointer to an entry in the GNTT and LNTT tables. It has two + forms depending on the type being described. + + The immediate form is used for simple entries and is one + word. + + The nonimmediate form is used for complex entries and contains + an index into the LNTT or GNTT which describes the entire type. + + If a dnttpointer is -1, then it is a NIL entry. */ + +#define DNTTNIL (-1) +typedef union dnttpointer +{ + struct dnttp_immediate dntti; + struct dnttp_nonimmediate dnttp; + int word; +} dnttpointer; + +/* An index into the source line table. As with dnttpointers, a sltpointer + of -1 indicates a NIL entry. */ +#define SLTNIL (-1) +typedef int sltpointer; + +/* Unsigned byte offset into the VT. */ +typedef unsigned int vtpointer; + +/* A DNTT entry (used within the GNTT and LNTT). + + DNTT entries are variable sized objects, but are always a multiple + of 3 words (we call each group of 3 words a "block"). + + The first bit in each block is an extension bit. This bit is zero + for the first block of a DNTT entry. If the entry requires more + than one block, then this bit is set to one in all blocks after + the first one. */ + +/* Each DNTT entry describes a particular debug symbol (beginning of + a source file, a function, variables, structures, etc. + + The type of the DNTT entry is stored in the "kind" field within the + DNTT entry itself. */ + +enum dntt_entry_type +{ + DNTT_TYPE_NIL = -1, + DNTT_TYPE_SRCFILE, + DNTT_TYPE_MODULE, + DNTT_TYPE_FUNCTION, + DNTT_TYPE_ENTRY, + DNTT_TYPE_BEGIN, + DNTT_TYPE_END, + DNTT_TYPE_IMPORT, + DNTT_TYPE_LABEL, + DNTT_TYPE_FPARAM, + DNTT_TYPE_SVAR, + DNTT_TYPE_DVAR, + DNTT_TYPE_HOLE1, + DNTT_TYPE_CONST, + DNTT_TYPE_TYPEDEF, + DNTT_TYPE_TAGDEF, + DNTT_TYPE_POINTER, + DNTT_TYPE_ENUM, + DNTT_TYPE_MEMENUM, + DNTT_TYPE_SET, + DNTT_TYPE_SUBRANGE, + DNTT_TYPE_ARRAY, + DNTT_TYPE_STRUCT, + DNTT_TYPE_UNION, + DNTT_TYPE_FIELD, + DNTT_TYPE_VARIANT, + DNTT_TYPE_FILE, + DNTT_TYPE_FUNCTYPE, + DNTT_TYPE_WITH, + DNTT_TYPE_COMMON, + DNTT_TYPE_COBSTRUCT, + DNTT_TYPE_XREF, + DNTT_TYPE_SA, + DNTT_TYPE_MACRO, + DNTT_TYPE_BLOCKDATA, + DNTT_TYPE_CLASS_SCOPE, + DNTT_TYPE_REFERENCE, + DNTT_TYPE_PTRMEM, + DNTT_TYPE_PTRMEMFUNC, + DNTT_TYPE_CLASS, + DNTT_TYPE_GENFIELD, + DNTT_TYPE_VFUNC, + DNTT_TYPE_MEMACCESS, + DNTT_TYPE_INHERITANCE, + DNTT_TYPE_FRIEND_CLASS, + DNTT_TYPE_FRIEND_FUNC, + DNTT_TYPE_MODIFIER, + DNTT_TYPE_OBJECT_ID, + DNTT_TYPE_MEMFUNC, + DNTT_TYPE_TEMPLATE, + DNTT_TYPE_TEMPLATE_ARG, + DNTT_TYPE_FUNC_TEMPLATE, + DNTT_TYPE_LINK, + DNTT_TYPE_MAX, +}; + +/* DNTT_TYPE_SRCFILE: + + One DNTT_TYPE_SRCFILE symbol is output for the start of each source + file and at the begin and end of an included file. A DNTT_TYPE_SRCFILE + entry is also output before each DNTT_TYPE_FUNC symbol so that debuggers + can determine what file a function was defined in. + + LANGUAGE describes the source file's language. + + NAME points to an VT entry providing the source file's name. + + Note the name used for DNTT_TYPE_SRCFILE entries are exactly as seen + by the compiler (ie they may be relative or absolute). C include files + via <> inclusion must use absolute paths. + + ADDRESS points to an SLT entry from which line number and code locations + may be determined. */ + +struct dntt_type_srcfile +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + enum hp_language language: 4; + unsigned int unused: 17; + vtpointer name; + sltpointer address; +}; + +/* DNTT_TYPE_MODULE: + + A DNTT_TYPE_MODULE symbol is emitted for the start of a pascal + module or C source file. + + Each DNTT_TYPE_MODULE must have an associated DNTT_TYPE_END symbol. + + NAME points to a VT entry providing the module's name. Note C + source files are considered nameless modules. + + ALIAS point to a VT entry providing a secondary name. + + ADDRESS points to an SLT entry from which line number and code locations + may be determined. */ + +struct dntt_type_module +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int unused: 21; + vtpointer name; + vtpointer alias; + dnttpointer unused2; + sltpointer address; +}; + +/* DNTT_TYPE_FUNCTION: + + A DNTT_TYPE_FUNCTION symbol is emitted for each function definition; + a DNTT_TYPE_ENTRY symbols is used for secondary entry points. Both + symbols used the dntt_type_function structure. + + Each DNTT_TYPE_FUNCTION must have a matching DNTT_TYPE_END. + + GLOBAL is nonzero if the function has global scope. + + LANGUAGE describes the function's source language. + + OPT_LEVEL describes the optimization level the function was compiled + with. + + VARARGS is nonzero if the function uses varargs. + + NAME points to a VT entry providing the function's name. + + ALIAS points to a VT entry providing a secondary name for the function. + + FIRSTPARAM points to a LNTT entry which describes the parameter list. + + ADDRESS points to an SLT entry from which line number and code locations + may be determined. + + ENTRYADDR is the memory address corresponding the the function's entry point + + RETVAL points to a LNTT entry describing the function's return value. + + LOWADDR is the lowest memory address associated with this function. + + HIADDR is the highest memory address associated with this function. */ + +struct dntt_type_function +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int global: 1; + enum hp_language language: 4; + unsigned int nest_level: 5; + unsigned int opt_level: 2; + unsigned int varargs: 1; + unsigned int lang_info: 4; + unsigned int inlined: 1; + unsigned int localalloc: 1; + unsigned int expansion: 1; + unsigned int unused: 1; + vtpointer name; + vtpointer alias; + dnttpointer firstparam; + sltpointer address; + CORE_ADDR entryaddr; + dnttpointer retval; + CORE_ADDR lowaddr; + CORE_ADDR hiaddr; +}; + +/* DNTT_TYPE_BEGIN: + + A DNTT_TYPE_BEGIN symbol is emitted to begin a new nested scope. + Every DNTT_TYPE_BEGIN symbol must have a matching DNTT_TYPE_END symbol. + + CLASSFLAG is nonzero if this is the beginning of a c++ class definition. + + ADDRESS points to an SLT entry from which line number and code locations + may be determined. */ + +struct dntt_type_begin +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int classflag: 1; + unsigned int unused: 20; + sltpointer address; +}; + +/* DNTT_TYPE_END: + + A DNTT_TYPE_END symbol is emitted when closing a scope started by + a DNTT_TYPE_MODULE, DNTT_TYPE_FUNCTION, and DNTT_TYPE_BEGIN symbols. + + ENDKIND describes what type of scope the DNTT_TYPE_END is closing + (DNTT_TYPE_MODULE, DNTT_TYPE_BEGIN, etc). + + CLASSFLAG is nonzero if this is the end of a c++ class definition. + + ADDRESS points to an SLT entry from which line number and code locations + may be determined. + + BEGINSCOPE points to the LNTT entry which opened the scope. */ + +struct dntt_type_end +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + enum dntt_entry_type endkind: 10; + unsigned int classflag: 1; + unsigned int unused: 10; + sltpointer address; + dnttpointer beginscope; +}; + +/* DNTT_TYPE_IMPORT is unused by GDB. */ +/* DNTT_TYPE_LABEL is unused by GDB. */ + +/* DNTT_TYPE_FPARAM: + + A DNTT_TYPE_FPARAM symbol is emitted for a function argument. When + chained together the symbols represent an argument list for a function. + + REGPARAM is nonzero if this parameter was passed in a register. + + INDIRECT is nonzero if this parameter is a pointer to the parameter + (pass by reference or pass by value for large items). + + LONGADDR is nonzero if the parameter is a 64bit pointer. + + NAME is a pointer into the VT for the parameter's name. + + LOCATION describes where the parameter is stored. Depending on the + parameter type LOCATION could be a register number, or an offset + from the stack pointer. + + TYPE points to a NTT entry describing the type of this parameter. + + NEXTPARAM points to the LNTT entry describing the next parameter. */ + +struct dntt_type_fparam +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int regparam: 1; + unsigned int indirect: 1; + unsigned int longaddr: 1; + unsigned int copyparam: 1; + unsigned int dflt: 1; + unsigned int unused: 16; + vtpointer name; + int location; + dnttpointer type; + dnttpointer nextparam; + int misc; +}; + +/* DNTT_TYPE_SVAR: + + A DNTT_TYPE_SVAR is emitted to describe a variable in static storage. + + GLOBAL is nonzero if the variable has global scope. + + INDIRECT is nonzero if the variable is a pointer to an object. + + LONGADDR is nonzero if the variable is in long pointer space. + + STATICMEM is nonzero if the variable is a member of a class. + + A_UNION is nonzero if the variable is an anonymous union member. + + NAME is a pointer into the VT for the variable's name. + + LOCATION provides the memory address for the variable. + + TYPE is a pointer into either the GNTT or LNTT which describes + the type of this variable. */ + +struct dntt_type_svar +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int global: 1; + unsigned int indirect: 1; + unsigned int longaddr: 1; + unsigned int staticmem: 1; + unsigned int a_union: 1; + unsigned int unused: 16; + vtpointer name; + CORE_ADDR location; + dnttpointer type; + unsigned int offset; + unsigned int displacement; +}; + +/* DNTT_TYPE_DVAR: + + A DNTT_TYPE_DVAR is emitted to describe automatic variables and variables + held in registers. + + GLOBAL is nonzero if the variable has global scope. + + INDIRECT is nonzero if the variable is a pointer to an object. + + REGVAR is nonzero if the variable is in a register. + + A_UNION is nonzero if the variable is an anonymous union member. + + NAME is a pointer into the VT for the variable's name. + + LOCATION provides the memory address or register number for the variable. + + TYPE is a pointer into either the GNTT or LNTT which describes + the type of this variable. */ + +struct dntt_type_dvar +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int global: 1; + unsigned int indirect: 1; + unsigned int regvar: 1; + unsigned int a_union: 1; + unsigned int unused: 17; + vtpointer name; + int location; + dnttpointer type; + unsigned int offset; +}; + +/* DNTT_TYPE_CONST: + + A DNTT_TYPE_CONST symbol is emitted for program constants. + + GLOBAL is nonzero if the constant has global scope. + + INDIRECT is nonzero if the constant is a pointer to an object. + + LOCATION_TYPE describes where to find the constant's value + (in the VT, memory, or embedded in an instruction). + + CLASSMEM is nonzero if the constant is a member of a class. + + NAME is a pointer into the VT for the constant's name. + + LOCATION provides the memory address, register number or pointer + into the VT for the constant's value. + + TYPE is a pointer into either the GNTT or LNTT which describes + the type of this variable. */ + +struct dntt_type_const +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int global: 1; + unsigned int indirect: 1; + enum location_type: 3; + unsigned int classmem: 1; + unsigned int unused: 15; + vtpointer name; + CORE_ADDR location; + dnttpointer type; + unsigned int offset; + unsigned int displacement; +}; + +/* DNTT_TYPE_TYPEDEF and DNTT_TYPE_TAGDEF: + + The same structure is used to describe typedefs and tagdefs. + + DNTT_TYPE_TYPEDEFS are associated with C "typedefs". + + DNTT_TYPE_TAGDEFs are associated with C "struct", "union", and "enum" + tags, which may have the same name as a typedef in the same scope. + + GLOBAL is nonzero if the typedef/tagdef has global scope. + + TYPEINFO is used to determine if full type information is available + for a tag. (usually 1, but can be zero for opaque types in C). + + NAME is a pointer into the VT for the constant's name. + + TYPE points to the underlying type for the typedef/tagdef in the + GNTT or LNTT. */ + +struct dntt_type_type +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int global: 1; + unsigned int typeinfo: 1; + unsigned int unused: 19; + vtpointer name; + dnttpointer type; +}; + +/* DNTT_TYPE_POINTER: + + Used to describe a pointer to an underlying type. + + POINTSTO is a pointer into the GNTT or LNTT for the type which this + pointer points to. + + BITLENGTH is the length of the pointer (not the underlying type). */ + +struct dntt_type_pointer +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int unused: 21; + dnttpointer pointsto; + unsigned int bitlength; +}; + + +/* DNTT_TYPE_ENUM: + + Used to describe enumerated types. + + FIRSTMEM is a pointer to a DNTT_TYPE_MEMENUM in the GNTT/LNTT which + describes the first member (and contains a pointer to the chain of + members). + + BITLENGTH is the number of bits used to hold the values of the enum's + members. */ + +struct dntt_type_enum +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int unused: 21; + dnttpointer firstmem; + unsigned int bitlength; +}; + +/* DNTT_TYPE_MEMENUM + + Used to describe members of an enumerated type. + + CLASSMEM is nonzero if this member is part of a class. + + NAME points into the VT for the name of this member. + + VALUE is the value of this enumeration member. + + NEXTMEM points to the next DNTT_TYPE_MEMENUM in the chain. */ + +struct dntt_type_memenum +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int classmem: 1; + unsigned int unused: 20; + vtpointer name; + unsigned int value; + dnttpointer nextmem; +}; + +/* DNTT_TYPE_SET + + DECLARATION describes the bitpacking of the set. + + SUBTYPE points to a DNTT entry describing the type of the members. + + BITLENGTH is the size of the set. */ + +struct dntt_type_set +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int declaration: 2; + unsigned int unused: 19; + dnttpointer subtype; + unsigned int bitlength; +}; + +/* DNTT_TYPE_SUBRANGE + + DYN_LOW describes the lower bound of the subrange: + + 00 for a constant lower bound (found in LOWBOUND). + + 01 for a dynamic lower bound with the lower bound found in the the + memory address pointed to by LOWBOUND. + + 10 for a dynamic lower bound described by an variable found in the + DNTT/LNTT (LOWBOUND would be a pointer into the DNTT/LNTT). + + DYN_HIGH is similar to DYN_LOW, except it describes the upper bound. + + SUBTYPE points to the type of the subrange. + + BITLENGTH is the length in bits needed to describe the subrange's + values. */ + +struct dntt_type_subrange +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int dyn_low: 2; + unsigned int dyn_high: 2; + unsigned int unused: 17; + int lowbound; + int highbound; + dnttpointer subtype; + unsigned int bitlength; +}; + +/* DNTT_TYPE_ARRAY + + DECLARATION describes the bit packing used in the array. + + ARRAYISBYTES is nonzero if the field in arraylength describes the + length in bytes rather than in bits. A value of zero is used to + describe an array with size 2**32. + + ELEMISBYTES is nonzero if the length if each element in the array + is describes in bytes rather than bits. A value of zero is used + to an element with size 2**32. + + ELEMORDER is nonzero if the elements are indexed in increasing order. + + JUSTIFIED if the elements are left justified to index zero. + + ARRAYLENGTH is the length of the array. + + INDEXTYPE is a DNTT pointer to the type used to index the array. + + ELEMTYPE is a DNTT pointer to the type for the array elements. + + ELEMLENGTH is the length of each element in the array (including + any padding). + + Multi-dimensional arrays are represented by ELEMTYPE pointing to + another DNTT_TYPE_ARRAY. */ + +struct dntt_type_array +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int declaration: 2; + unsigned int dyn_low: 2; + unsigned int dyn_high: 2; + unsigned int arrayisbytes: 1; + unsigned int elemisbytes: 1; + unsigned int elemorder: 1; + unsigned int justified: 1; + unsigned int unused: 11; + unsigned int arraylength; + dnttpointer indextype; + dnttpointer elemtype; + unsigned int elemlength; +}; + +/* DNTT_TYPE_STRUCT + + DNTT_TYPE_STRUCT is used to describe a C structure. + + DECLARATION describes the bitpacking used. + + FIRSTFIELD is a DNTT pointer to the first field of the structure + (each field contains a pointer to the next field, walk the list + to access all fields of the structure). + + VARTAGFIELD and VARLIST are used for Pascal variant records. + + BITLENGTH is the size of the structure in bits. */ + +struct dntt_type_struct +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int declaration: 2; + unsigned int unused: 19; + dnttpointer firstfield; + dnttpointer vartagfield; + dnttpointer varlist; + unsigned int bitlength; +}; + +/* DNTT_TYPE_UNION + + DNTT_TYPE_UNION is used to describe a C union. + + FIRSTFIELD is a DNTT pointer to the beginning of the field chain. + + BITLENGTH is the size of the union in bits. */ + +struct dntt_type_union +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int unused: 21; + dnttpointer firstfield; + unsigned int bitlength; +}; + +/* DNTT_TYPE_FIELD + + DNTT_TYPE_FIELD describes one field in a structure or union. + + VISIBILITY is used to describe the visibility of the field + (for c++. public = 0, protected = 1, private = 2). + + A_UNION is nonzero if this field is a member of an anonymous union. + + STATICMEM is nonzero if this field is a static member of a template. + + NAME is a pointer into the VT for the name of the field. + + BITOFFSET gives the offset of this field in bits from the beginning + of the structure or union this field is a member of. + + TYPE is a DNTT pointer to the type describing this field. + + BITLENGTH is the size of the entry in bits. + + NEXTFIELD is a DNTT pointer to the next field in the chain. */ + +struct dntt_type_field +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int visibility: 2; + unsigned int a_union: 1; + unsigned int staticmem: 1; + unsigned int unused: 17; + vtpointer name; + unsigned int bitoffset; + dnttpointer type; + unsigned int bitlength; + dnttpointer nextfield; +}; + +/* DNTT_TYPE_VARIANT is unused by GDB. */ +/* DNTT_TYPE_FILE is unused by GDB. */ + +/* DNTT_TYPE_COMMON is unused by GDB. */ +/* DNTT_TYPE_LINK is unused by GDB. */ +/* DNTT_TYPE_FFUNC_LINK is unused by GDB. */ +/* DNTT_TYPE_TEMPLATE is unused by GDB. */ + +/* DNTT_TYPE_FUNCTYPE + + VARARGS is nonzero if this function uses varargs. + + FIRSTPARAM is a DNTT pointer to the first entry in the parameter + chain. + + RETVAL is a DNTT pointer to the type of the return value. */ + +struct dntt_type_functype +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int varargs: 1; + unsigned int info: 4; + unsigned int unused: 16; + unsigned int bitlength; + dnttpointer firstparam; + dnttpointer retval; +}; + +/* DNTT_TYPE_WITH is unued by GDB. */ +/* DNTT_TYPE_COBSTRUCT is unused by GDB. */ +/* DNTT_TYPE_MODIFIER is unused by GDB. */ +/* DNTT_TYPE_GENFIELD is unused by GDB. */ +/* DNTT_TYPE_MEMACCESS is unused by GDB. */ +/* DNTT_TYPE_VFUNC is unused by GDB. */ +/* DNTT_TYPE_CLASS_SCOPE is unused by GDB. */ +/* DNTT_TYPE_FRIEND_CLASS is unused by GDB. */ +/* DNTT_TYPE_FRIEND_FUNC is unused by GDB. */ +/* DNTT_TYPE_CLASS unused by GDB. */ +/* DNTT_TYPE_TEMPLATE unused by GDB. */ +/* DNTT_TYPE_TEMPL_ARG is unused by GDB. */ +/* DNTT_TYPE_PTRMEM not used by GDB */ +/* DNTT_TYPE_INHERITANCE is unused by GDB. */ +/* DNTT_TYPE_OBJECT_ID is unused by GDB. */ +/* DNTT_TYPE_XREF is unused by GDB. */ +/* DNTT_TYPE_SA is unused by GDB. */ + +/* DNTT_TYPE_GENERIC and DNTT_TYPE_BLOCK are convience structures + so we can examine a DNTT entry in a generic fashion. */ +struct dntt_type_generic +{ + unsigned int word[9]; +}; + +struct dntt_type_block +{ + unsigned int extension: 1; + enum dntt_entry_type kind: 10; + unsigned int unused: 21; + unsigned int word[2]; +}; + +/* One entry in a DNTT (either the LNTT or GNTT). */ +union dnttentry +{ + struct dntt_type_srcfile dsfile; + struct dntt_type_module dmodule; + struct dntt_type_function dfunc; + struct dntt_type_function dentry; + struct dntt_type_begin dbegin; + struct dntt_type_end dend; + struct dntt_type_fparam dfparam; + struct dntt_type_svar dsvar; + struct dntt_type_dvar ddvar; + struct dntt_type_const dconst; + struct dntt_type_type dtype; + struct dntt_type_type dtag; + struct dntt_type_pointer dptr; + struct dntt_type_enum denum; + struct dntt_type_memenum dmember; + struct dntt_type_set dset; + struct dntt_type_subrange dsubr; + struct dntt_type_array darray; + struct dntt_type_struct dstruct; + struct dntt_type_union dunion; + struct dntt_type_field dfield; + struct dntt_type_functype dfunctype; + struct dntt_type_generic dgeneric; + struct dntt_type_block dblock; +}; + +/* Source line entry types. */ +enum slttype +{ + SLT_NORMAL, + SLT_SRCFILE, + SLT_MODULE, + SLT_FUNCTION, + SLT_ENTRY, + SLT_BEGIN, + SLT_END, + SLT_WITH, + SLT_EXIT, + SLT_ASSIST, + SLT_MARKER, +}; + +/* A normal source line entry. Simply provides a mapping of a source + line number to a code address. + + SLTDESC will always be SLT_NORMAL or SLT_EXIT. */ + +struct slt_normal +{ + enum slttype sltdesc: 4; + unsigned int line: 28; + CORE_ADDR address; +}; + +/* A special source line entry. Provides a mapping of a declaration + to a line number. These entries point back into the DNTT which + references them. */ + +struct slt_special +{ + enum slttype sltdesc: 4; + unsigned int line: 28; + dnttpointer backptr; +}; + +/* Used to describe nesting. + + For nested languages, an slt_assist entry must follow each SLT_FUNC + entry in the SLT. The address field will point forward to the + first slt_normal entry within the function's scope. */ + +struct slt_assist +{ + enum slttype sltdesc: 4; + unsigned int unused: 28; + sltpointer address; +}; + +struct slt_generic +{ + unsigned int word[2]; +}; + +union sltentry +{ + struct slt_normal snorm; + struct slt_special sspec; + struct slt_assist sasst; + struct slt_generic sgeneric; +}; + +#endif /* HP_SYMTAB_INCLUDED */ diff --git a/include/hpux-symtab.h b/include/hpux-symtab.h deleted file mode 100755 index 1e1813a1bf..0000000000 --- a/include/hpux-symtab.h +++ /dev/null @@ -1,2559 +0,0 @@ -/*************************************************************************** - * (c) Copyright 1988 - 1993 HEWLETT-PACKARD COMPANY. All rights reserved. * - ***************************************************************************/ - -/*************************************************************************** - * This program is "free" software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; Version 2, June 1991. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this include file; if not, write to the Free Software Foundation, - * Inc, 675 Mass Ave, Cambridge, MA 02139, USA - * - ***************************************************************************/ - -/*************************************************************************** - * - * Hewlett-Packard Company will not respond to external queries regarding - * the distribution or content of this include file. The University of - * Utah Center for Software Science (CSS) is the contact point for its - * distribution. CSS distributes this file under the terms of the GNU - * General Public License, as above: WITHOUT ANY WARRANTY. CSS makes NO - * WARRANTY as to the file's accuracy or timeliness. This file is NOT - * SUPPORTED by CSS. - * - * The current distributed version of this file is available by - * anonymous ftp from jaguar.cs.utah.edu in dist/hpux-symtab.h. - * The GNU General Public License is in dist/COPYING. - * Email may be directed to pa-gdb-bugs@cs.utah.edu. - * - ***************************************************************************/ - -#ifndef _SYMTAB_INCLUDED /* allow multiple inclusions */ -#define _SYMTAB_INCLUDED - -/* - * - * SYMBOLIC DEBUG FORMAT ACD - * $Revision$ - * - * - * - * ---- 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 PA-RISC, 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 PA-RISC: - * - * A PA-RISC short pointer. - * - */ - -#if __cplusplus -#define public global -#endif - -typedef long ADDRESS; -typedef unsigned long ADRT, *pADRT; - -/* - * Language types: - * - * Sizeof (LANGTYPE) = 4 bits, for a maximum of 16 possible - * language types. - */ - -typedef unsigned int LANGTYPE; - -#define LANG_UNKNOWN 0 -#define LANG_C 1 -#define LANG_HPF77 2 -#define LANG_HPPASCAL 3 -#define LANG_HPMODCAL 4 -#define LANG_HPCOBOL 5 -#define LANG_HPBASIC 6 -#define LANG_HPADA 7 -#ifdef CPLUSPLUS -#define LANG_CPLUSPLUS 8 -#endif - - -/* - * Location types: - * - * 32-bit, machine-dependent and context-dependent specifiers of - * variable storage location. - */ - -typedef unsigned long STATTYPE; /* static-type location */ -typedef long DYNTYPE; /* dynamic-type location */ -typedef unsigned long REGTYPE; /* register-type location */ - -#define STATNIL (-1) /* no location for STATTYPE */ - -/* - * Loc type Series 300 PA-RISC - * ======== ================ =============== - * - * STATTYPE Absolute address A PA-RISC - * 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 unsigned int LOCDESCTYPE; - -#define LOC_IMMED 0 /* immediate constant */ -#define LOC_PTR 1 /* standard STATTYPE */ -#define LOC_VT 2 /* value table byte offset */ - -/* - * Register numbers for REGTYPE (Series 300 only): - */ - -#define REG_D0 0 -#define REG_D1 1 -#define REG_D2 2 -#define REG_D3 3 -#define REG_D4 4 -#define REG_D5 5 -#define REG_D6 6 -#define REG_D7 7 - -#define REG_A0 8 -#define REG_A1 9 -#define REG_A2 10 -#define REG_A3 11 -#define REG_A4 12 -#define REG_A5 13 -#define REG_A6 14 -#define REG_A7 15 - -#define REG_FP0 16 -#define REG_FP1 17 -#define REG_FP2 18 -#define REG_FP3 19 -#define REG_FP4 20 -#define REG_FP5 21 -#define REG_FP6 22 -#define REG_FP7 23 - -#define REG_FPA0 24 -#define REG_FPA1 25 -#define REG_FPA2 26 -#define REG_FPA3 27 -#define REG_FPA4 28 -#define REG_FPA5 29 -#define REG_FPA6 30 -#define REG_FPA7 31 -#define REG_FPA8 32 -#define REG_FPA9 33 -#define REG_FPA10 34 -#define REG_FPA11 35 -#define REG_FPA12 36 -#define REG_FPA13 37 -#define REG_FPA14 38 -#define REG_FPA15 39 - -/* - * generic floating point registers; - * actual register determined at runtime - */ - -#define REG_FGEN0 40 -#define REG_FGEN1 41 -#define REG_FGEN2 42 -#define REG_FGEN3 43 -#define REG_FGEN4 44 -#define REG_FGEN5 45 -#define REG_FGEN6 46 -#define REG_FGEN7 47 -#define REG_FGEN8 48 -#define REG_FGEN9 49 -#define REG_FGEN10 50 -#define REG_FGEN11 51 -#define REG_FGEN12 52 -#define REG_FGEN13 53 -#define REG_FGEN14 54 -#define REG_FGEN15 55 - -/* - * Basetypes: - * - * Sizeof (BASETYPE) = 5 bits, for a maximum of 32 possible - * basetypes. - */ - -typedef unsigned int BASETYPE; - -#define T_UNDEFINED 0 /* unheard of */ -#define T_BOOLEAN 1 /* true/false or LOGICAL */ -#define T_CHAR 2 /* ASCII, signed if used as int */ -#define T_INT 3 /* signed integer */ -#define T_UNS_INT 4 /* unsigned integer */ -#define T_REAL 5 /* binary or decimal real */ -#define T_COMPLEX 6 /* pair of reals */ -#define T_STRING200 7 /* Series 300 string type */ -#define T_LONGSTRING200 8 /* Series 300 long string type */ -#define T_TEXT 9 /* for Pascal TEXT file */ -#define T_FLABEL 10 /* for any program labels */ -#define T_FTN_STRING_SPEC 11 /* PA-RISC FORTRAN string type */ -#define T_MOD_STRING_SPEC 12 /* PA-RISC Modcal/Pascal string */ -#define T_PACKED_DECIMAL 13 /* packed decimal */ -#define T_REAL_3000 14 /* HP3000 format real */ -#define T_MOD_STRING_3000 15 /* HP3000 Modcal/Pascal string */ -#define T_ANYPTR 16 /* Pascal any-pointer */ -#define T_GLOBAL_ANYPTR 17 /* Pascal global any-pointer */ -#define T_LOCAL_ANYPTR 18 /* Pascal local any-pointer */ -#define T_COMPLEXS3000 19 /* HP3000 format complex */ -#define T_FTN_STRING_S300_COMPAT 20 /* 9000/s300 compatible fortran string */ -#define T_FTN_STRING_VAX_COMPAT 21 /* VAX compatible fortran string */ -#define T_BOOLEAN_S300_COMPAT 22 /* 9000/s300 compatible fortran logical */ -#define T_BOOLEAN_VAX_COMPAT 23 /* VAX compatible fortran logical */ -#define T_WIDE_CHAR 24 /* ANSI/C wchar_t pseudo-type */ -#define T_LONG 25 /* signed long */ -#define T_UNS_LONG 26 /* unsigned long */ -#define T_DOUBLE 27 /* binary or decimal double */ -#ifdef TEMPLATES -#define T_TEMPLATE_ARG 28 /* template argument immediate type */ -#endif /* TEMPLATES */ - -/* 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