1 /* Definitions and structures for reading debug symbols from the
4 Written by the Center for Software Science at the University of Utah
7 Copyright (C) 1994-2017 Free Software Foundation, Inc.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22 MA 02110-1301, USA. */
24 #ifndef HP_SYMTAB_INCLUDED
25 #define HP_SYMTAB_INCLUDED
27 /* General information:
29 This header file defines and describes only the data structures
30 necessary to read debug symbols produced by the HP C compiler,
31 HP ANSI C++ compiler, and HP FORTRAN 90 compiler using the
32 SOM object file format.
33 (For a full description of the debug format, ftp hpux-symtab.h from
34 jaguar.cs.utah.edu:/dist).
36 Additional notes (Rich Title)
37 This file is a reverse-engineered version of a file called
38 "symtab.h" which exists internal to HP's Computer Languages Organization
39 in /CLO/Components/DDE/obj/som/symtab.h. Because HP's version of
40 the file is copyrighted and not distributed, it is necessary for
41 GDB to use the reverse-engineered version that follows.
42 Work was done by Cygnus to reverse-engineer the C subset of symtab.h.
43 The WDB project has extended this to also contain the C++
44 symbol definitions, the F90 symbol definitions,
45 and the DOC (debugging-optimized-code) symbol definitions.
46 In some cases (the C++ symbol definitions)
47 I have added internal documentation here that
48 goes beyond what is supplied in HP's symtab.h. If we someday
49 unify these files again, the extra comments should be merged back
52 -------------------------------------------------------------------
54 Debug symbols are contained entirely within an unloadable space called
55 $DEBUG$. $DEBUG$ contains several subspaces which group related
58 $GNTT$ contains information for global variables, types and contants.
60 $LNTT$ contains information for procedures (including nesting), scoping
61 information, local variables, types, and constants.
63 $SLT$ contains source line information so that code addresses may be
64 mapped to source lines.
66 $VT$ contains various strings and constants for named objects (variables,
67 typedefs, functions, etc). Strings are stored as null-terminated character
68 lists. Constants always begin on word boundaries. The first byte of
69 the VT must be zero (a null string).
71 $XT$ is not currently used by GDB.
73 Many structures within the subspaces point to other structures within
74 the same subspace, or to structures within a different subspace. These
75 pointers are represented as a structure index from the beginning of
76 the appropriate subspace. */
78 /* Used to describe where a constant is stored. */
86 /* Languages supported by this debug format. Within the data structures
87 this type is limited to 4 bits for a maximum of 16 languages. */
93 HP_LANGUAGE_F77
= HP_LANGUAGE_FORTRAN
,
99 HP_LANGUAGE_CPLUSPLUS
,
104 /* Basic data types available in this debug format. Within the data
105 structures this type is limited to 5 bits for a maximum of 32 basic
109 HP_TYPE_UNDEFINED
, /* 0 */
110 HP_TYPE_BOOLEAN
, /* 1 */
111 HP_TYPE_CHAR
, /* 2 */
113 HP_TYPE_UNSIGNED_INT
, /* 4 */
114 HP_TYPE_REAL
, /* 5 */
115 HP_TYPE_COMPLEX
, /* 6 */
116 HP_TYPE_STRING200
, /* 7 */
117 HP_TYPE_LONGSTRING200
, /* 8 */
118 HP_TYPE_TEXT
, /* 9 */
119 HP_TYPE_FLABEL
, /* 10 */
120 HP_TYPE_FTN_STRING_SPEC
, /* 11 */
121 HP_TYPE_MOD_STRING_SPEC
, /* 12 */
122 HP_TYPE_PACKED_DECIMAL
, /* 13 */
123 HP_TYPE_REAL_3000
, /* 14 */
124 HP_TYPE_MOD_STRING_3000
, /* 15 */
125 HP_TYPE_ANYPOINTER
, /* 16 */
126 HP_TYPE_GLOBAL_ANYPOINTER
, /* 17 */
127 HP_TYPE_LOCAL_ANYPOINTER
, /* 18 */
128 HP_TYPE_COMPLEXS3000
, /* 19 */
129 HP_TYPE_FTN_STRING_S300_COMPAT
, /* 20 */
130 HP_TYPE_FTN_STRING_VAX_COMPAT
, /* 21 */
131 HP_TYPE_BOOLEAN_S300_COMPAT
, /* 22 */
132 HP_TYPE_BOOLEAN_VAX_COMPAT
, /* 23 */
133 HP_TYPE_WIDE_CHAR
, /* 24 */
134 HP_TYPE_LONG
, /* 25 */
135 HP_TYPE_UNSIGNED_LONG
, /* 26 */
136 HP_TYPE_DOUBLE
, /* 27 */
137 HP_TYPE_TEMPLATE_ARG
, /* 28 */
138 HP_TYPE_VOID
/* 29 */
141 /* An immediate name and type table entry.
143 extension and immediate will always be one.
144 global will always be zero.
145 hp_type is the basic type this entry describes.
146 bitlength is the length in bits for the basic type. */
147 struct dnttp_immediate
149 unsigned int extension
: 1;
150 unsigned int immediate
: 1;
151 unsigned int global
: 1;
152 unsigned int type
: 5;
153 unsigned int bitlength
: 24;
156 /* A nonimmediate name and type table entry.
158 extension will always be one.
159 immediate will always be zero.
160 if global is zero, this entry points into the LNTT
161 if global is one, this entry points into the GNTT
162 index is the index within the GNTT or LNTT for this entry. */
163 struct dnttp_nonimmediate
165 unsigned int extension
: 1;
166 unsigned int immediate
: 1;
167 unsigned int global
: 1;
168 unsigned int index
: 29;
171 /* A pointer to an entry in the GNTT and LNTT tables. It has two
172 forms depending on the type being described.
174 The immediate form is used for simple entries and is one
177 The nonimmediate form is used for complex entries and contains
178 an index into the LNTT or GNTT which describes the entire type.
180 If a dnttpointer is -1, then it is a NIL entry. */
183 typedef union dnttpointer
185 struct dnttp_immediate dntti
;
186 struct dnttp_nonimmediate dnttp
;
190 /* An index into the source line table. As with dnttpointers, a sltpointer
191 of -1 indicates a NIL entry. */
193 typedef int sltpointer
;
195 /* Index into DOC (= "Debugging Optimized Code") line table. */
197 typedef int ltpointer
;
199 /* Index into context table. */
201 typedef int ctxtpointer
;
203 /* Unsigned byte offset into the VT. */
204 typedef unsigned int vtpointer
;
206 /* A DNTT entry (used within the GNTT and LNTT).
208 DNTT entries are variable sized objects, but are always a multiple
209 of 3 words (we call each group of 3 words a "block").
211 The first bit in each block is an extension bit. This bit is zero
212 for the first block of a DNTT entry. If the entry requires more
213 than one block, then this bit is set to one in all blocks after
216 /* Each DNTT entry describes a particular debug symbol (beginning of
217 a source file, a function, variables, structures, etc.
219 The type of the DNTT entry is stored in the "kind" field within the
220 DNTT entry itself. */
259 DNTT_TYPE_CLASS_SCOPE
,
262 DNTT_TYPE_PTRMEMFUNC
,
267 DNTT_TYPE_INHERITANCE
,
268 DNTT_TYPE_FRIEND_CLASS
,
269 DNTT_TYPE_FRIEND_FUNC
,
274 DNTT_TYPE_TEMPLATE_ARG
,
275 DNTT_TYPE_FUNC_TEMPLATE
,
277 DNTT_TYPE_DYN_ARRAY_DESC
,
278 DNTT_TYPE_DESC_SUBRANGE
,
283 DNTT_TYPE_DOC_FUNCTION
,
284 DNTT_TYPE_DOC_MEMFUNC
,
288 /* DNTT_TYPE_SRCFILE:
290 One DNTT_TYPE_SRCFILE symbol is output for the start of each source
291 file and at the begin and end of an included file. A DNTT_TYPE_SRCFILE
292 entry is also output before each DNTT_TYPE_FUNC symbol so that debuggers
293 can determine what file a function was defined in.
295 LANGUAGE describes the source file's language.
297 NAME points to an VT entry providing the source file's name.
299 Note the name used for DNTT_TYPE_SRCFILE entries are exactly as seen
300 by the compiler (ie they may be relative or absolute). C include files
301 via <> inclusion must use absolute paths.
303 ADDRESS points to an SLT entry from which line number and code locations
304 may be determined. */
306 struct dntt_type_srcfile
308 unsigned int extension
: 1;
309 unsigned int kind
: 10; /* DNTT_TYPE_SRCFILE */
310 unsigned int language
: 4;
311 unsigned int unused
: 17;
318 A DNTT_TYPE_MODULE symbol is emitted for the start of a pascal
319 module or C source file. A module indicates a compilation unit
320 for name-scoping purposes; in that regard there should be
321 a 1-1 correspondence between GDB "symtab"'s and MODULE symbol records.
323 Each DNTT_TYPE_MODULE must have an associated DNTT_TYPE_END symbol.
325 NAME points to a VT entry providing the module's name. Note C
326 source files are considered nameless modules.
328 ALIAS point to a VT entry providing a secondary name.
330 ADDRESS points to an SLT entry from which line number and code locations
331 may be determined. */
333 struct dntt_type_module
335 unsigned int extension
: 1;
336 unsigned int kind
: 10; /* DNTT_TYPE_MODULE */
337 unsigned int unused
: 21;
344 /* DNTT_TYPE_FUNCTION,
349 A DNTT_TYPE_FUNCTION symbol is emitted for each function definition;
350 a DNTT_TYPE_ENTRY symbols is used for secondary entry points. Both
351 symbols used the dntt_type_function structure.
352 A DNTT_TYPE_BLOCKDATA symbol is emitted ...?
353 A DNTT_TYPE_MEMFUNC symbol is emitted for inlined member functions (C++).
355 Each of DNTT_TYPE_FUNCTION must have a matching DNTT_TYPE_END.
357 GLOBAL is nonzero if the function has global scope.
359 LANGUAGE describes the function's source language.
361 OPT_LEVEL describes the optimization level the function was compiled
364 VARARGS is nonzero if the function uses varargs.
366 NAME points to a VT entry providing the function's name.
368 ALIAS points to a VT entry providing a secondary name for the function.
370 FIRSTPARAM points to a LNTT entry which describes the parameter list.
372 ADDRESS points to an SLT entry from which line number and code locations
375 ENTRYADDR is the memory address corresponding the function's entry point
377 RETVAL points to a LNTT entry describing the function's return value.
379 LOWADDR is the lowest memory address associated with this function.
381 HIADDR is the highest memory address associated with this function. */
383 struct dntt_type_function
385 unsigned int extension
: 1;
386 unsigned int kind
: 10; /* DNTT_TYPE_FUNCTION,
389 or DNTT_TYPE_MEMFUNC */
390 unsigned int global
: 1;
391 unsigned int language
: 4;
392 unsigned int nest_level
: 5;
393 unsigned int opt_level
: 2;
394 unsigned int varargs
: 1;
395 unsigned int lang_info
: 4;
396 unsigned int inlined
: 1;
397 unsigned int localalloc
: 1;
398 unsigned int expansion
: 1;
399 unsigned int unused
: 1;
402 dnttpointer firstparam
;
412 A DNTT_TYPE_BEGIN symbol is emitted to begin a new nested scope.
413 Every DNTT_TYPE_BEGIN symbol must have a matching DNTT_TYPE_END symbol.
415 CLASSFLAG is nonzero if this is the beginning of a c++ class definition.
417 ADDRESS points to an SLT entry from which line number and code locations
418 may be determined. */
420 struct dntt_type_begin
422 unsigned int extension
: 1;
423 unsigned int kind
: 10;
424 unsigned int classflag
: 1;
425 unsigned int unused
: 20;
431 A DNTT_TYPE_END symbol is emitted when closing a scope started by
432 a DNTT_TYPE_MODULE, DNTT_TYPE_FUNCTION, DNTT_TYPE_WITH,
433 DNTT_TYPE_COMMON, DNTT_TYPE_BEGIN, and DNTT_TYPE_CLASS_SCOPE symbols.
435 ENDKIND describes what type of scope the DNTT_TYPE_END is closing
436 (one of the above 6 kinds).
438 CLASSFLAG is nonzero if this is the end of a c++ class definition.
440 ADDRESS points to an SLT entry from which line number and code locations
443 BEGINSCOPE points to the LNTT entry which opened the scope. */
447 unsigned int extension
: 1;
448 unsigned int kind
: 10;
449 unsigned int endkind
: 10;
450 unsigned int classflag
: 1;
451 unsigned int unused
: 10;
453 dnttpointer beginscope
;
456 /* DNTT_TYPE_IMPORT is unused by GDB. */
457 /* DNTT_TYPE_LABEL is unused by GDB. */
461 A DNTT_TYPE_FPARAM symbol is emitted for a function argument. When
462 chained together the symbols represent an argument list for a function.
464 REGPARAM is nonzero if this parameter was passed in a register.
466 INDIRECT is nonzero if this parameter is a pointer to the parameter
467 (pass by reference or pass by value for large items).
469 LONGADDR is nonzero if the parameter is a 64bit pointer.
471 NAME is a pointer into the VT for the parameter's name.
473 LOCATION describes where the parameter is stored. Depending on the
474 parameter type LOCATION could be a register number, or an offset
475 from the stack pointer.
477 TYPE points to a NTT entry describing the type of this parameter.
479 NEXTPARAM points to the LNTT entry describing the next parameter. */
481 struct dntt_type_fparam
483 unsigned int extension
: 1;
484 unsigned int kind
: 10;
485 unsigned int regparam
: 1;
486 unsigned int indirect
: 1;
487 unsigned int longaddr
: 1;
488 unsigned int copyparam
: 1;
489 unsigned int dflt
: 1;
490 unsigned int doc_ranges
: 1;
491 unsigned int misc_kind
: 1;
492 unsigned int unused
: 14;
496 dnttpointer nextparam
;
502 A DNTT_TYPE_SVAR is emitted to describe a variable in static storage.
504 GLOBAL is nonzero if the variable has global scope.
506 INDIRECT is nonzero if the variable is a pointer to an object.
508 LONGADDR is nonzero if the variable is in long pointer space.
510 STATICMEM is nonzero if the variable is a member of a class.
512 A_UNION is nonzero if the variable is an anonymous union member.
514 NAME is a pointer into the VT for the variable's name.
516 LOCATION provides the memory address for the variable.
518 TYPE is a pointer into either the GNTT or LNTT which describes
519 the type of this variable. */
521 struct dntt_type_svar
523 unsigned int extension
: 1;
524 unsigned int kind
: 10;
525 unsigned int global
: 1;
526 unsigned int indirect
: 1;
527 unsigned int longaddr
: 1;
528 unsigned int staticmem
: 1;
529 unsigned int a_union
: 1;
530 unsigned int unused1
: 1;
531 unsigned int thread_specific
: 1;
532 unsigned int unused2
: 14;
537 unsigned int displacement
;
542 A DNTT_TYPE_DVAR is emitted to describe automatic variables and variables
545 GLOBAL is nonzero if the variable has global scope.
547 INDIRECT is nonzero if the variable is a pointer to an object.
549 REGVAR is nonzero if the variable is in a register.
551 A_UNION is nonzero if the variable is an anonymous union member.
553 NAME is a pointer into the VT for the variable's name.
555 LOCATION provides the memory address or register number for the variable.
557 TYPE is a pointer into either the GNTT or LNTT which describes
558 the type of this variable. */
560 struct dntt_type_dvar
562 unsigned int extension
: 1;
563 unsigned int kind
: 10;
564 unsigned int global
: 1;
565 unsigned int indirect
: 1;
566 unsigned int regvar
: 1;
567 unsigned int a_union
: 1;
568 unsigned int unused
: 17;
577 A DNTT_TYPE_CONST symbol is emitted for program constants.
579 GLOBAL is nonzero if the constant has global scope.
581 INDIRECT is nonzero if the constant is a pointer to an object.
583 LOCATION_TYPE describes where to find the constant's value
584 (in the VT, memory, or embedded in an instruction).
586 CLASSMEM is nonzero if the constant is a member of a class.
588 NAME is a pointer into the VT for the constant's name.
590 LOCATION provides the memory address, register number or pointer
591 into the VT for the constant's value.
593 TYPE is a pointer into either the GNTT or LNTT which describes
594 the type of this variable. */
596 struct dntt_type_const
598 unsigned int extension
: 1;
599 unsigned int kind
: 10;
600 unsigned int global
: 1;
601 unsigned int indirect
: 1;
602 unsigned int location_type
: 3;
603 unsigned int classmem
: 1;
604 unsigned int unused
: 15;
609 unsigned int displacement
;
612 /* DNTT_TYPE_TYPEDEF and DNTT_TYPE_TAGDEF:
614 The same structure is used to describe typedefs and tagdefs.
616 DNTT_TYPE_TYPEDEFS are associated with C "typedefs".
618 DNTT_TYPE_TAGDEFs are associated with C "struct", "union", and "enum"
619 tags, which may have the same name as a typedef in the same scope.
620 Also they are associated with C++ "class" tags, which implicitly have
621 the same name as the class type.
623 GLOBAL is nonzero if the typedef/tagdef has global scope.
625 TYPEINFO is used to determine if full type information is available
626 for a tag. (usually 1, but can be zero for opaque types in C).
628 NAME is a pointer into the VT for the constant's name.
630 TYPE points to the underlying type for the typedef/tagdef in the
633 struct dntt_type_type
635 unsigned int extension
: 1;
636 unsigned int kind
: 10; /* DNTT_TYPE_TYPEDEF or
638 unsigned int global
: 1;
639 unsigned int typeinfo
: 1;
640 unsigned int unused
: 19;
642 dnttpointer type
; /* Underlying type, which for TAGDEF's may be
643 DNTT_TYPE_STRUCT, DNTT_TYPE_UNION,
644 DNTT_TYPE_ENUM, or DNTT_TYPE_CLASS.
645 For TYPEDEF's other underlying types
646 are also possible. */
649 /* DNTT_TYPE_POINTER:
651 Used to describe a pointer to an underlying type.
653 POINTSTO is a pointer into the GNTT or LNTT for the type which this
656 BITLENGTH is the length of the pointer (not the underlying type). */
658 struct dntt_type_pointer
660 unsigned int extension
: 1;
661 unsigned int kind
: 10;
662 unsigned int unused
: 21;
663 dnttpointer pointsto
;
664 unsigned int bitlength
;
670 Used to describe enumerated types.
672 FIRSTMEM is a pointer to a DNTT_TYPE_MEMENUM in the GNTT/LNTT which
673 describes the first member (and contains a pointer to the chain of
676 BITLENGTH is the number of bits used to hold the values of the enum's
679 struct dntt_type_enum
681 unsigned int extension
: 1;
682 unsigned int kind
: 10;
683 unsigned int unused
: 21;
684 dnttpointer firstmem
;
685 unsigned int bitlength
;
690 Used to describe members of an enumerated type.
692 CLASSMEM is nonzero if this member is part of a class.
694 NAME points into the VT for the name of this member.
696 VALUE is the value of this enumeration member.
698 NEXTMEM points to the next DNTT_TYPE_MEMENUM in the chain. */
700 struct dntt_type_memenum
702 unsigned int extension
: 1;
703 unsigned int kind
: 10;
704 unsigned int classmem
: 1;
705 unsigned int unused
: 20;
713 Used to describe PASCAL "set" type.
715 DECLARATION describes the bitpacking of the set.
717 SUBTYPE points to a DNTT entry describing the type of the members.
719 BITLENGTH is the size of the set. */
723 unsigned int extension
: 1;
724 unsigned int kind
: 10;
725 unsigned int declaration
: 2;
726 unsigned int unused
: 19;
728 unsigned int bitlength
;
731 /* DNTT_TYPE_SUBRANGE
733 Used to describe subrange type.
735 DYN_LOW describes the lower bound of the subrange:
737 00 for a constant lower bound (found in LOWBOUND).
739 01 for a dynamic lower bound with the lower bound found in the
740 memory address pointed to by LOWBOUND.
742 10 for a dynamic lower bound described by an variable found in the
743 DNTT/LNTT (LOWBOUND would be a pointer into the DNTT/LNTT).
745 DYN_HIGH is similar to DYN_LOW, except it describes the upper bound.
747 SUBTYPE points to the type of the subrange.
749 BITLENGTH is the length in bits needed to describe the subrange's
752 struct dntt_type_subrange
754 unsigned int extension
: 1;
755 unsigned int kind
: 10;
756 unsigned int dyn_low
: 2;
757 unsigned int dyn_high
: 2;
758 unsigned int unused
: 17;
762 unsigned int bitlength
;
767 Used to describe an array type.
769 DECLARATION describes the bit packing used in the array.
771 ARRAYISBYTES is nonzero if the field in arraylength describes the
772 length in bytes rather than in bits. A value of zero is used to
773 describe an array with size 2**32.
775 ELEMISBYTES is nonzero if the length if each element in the array
776 is describes in bytes rather than bits. A value of zero is used
777 to an element with size 2**32.
779 ELEMORDER is nonzero if the elements are indexed in increasing order.
781 JUSTIFIED if the elements are left justified to index zero.
783 ARRAYLENGTH is the length of the array.
785 INDEXTYPE is a DNTT pointer to the type used to index the array.
787 ELEMTYPE is a DNTT pointer to the type for the array elements.
789 ELEMLENGTH is the length of each element in the array (including
792 Multi-dimensional arrays are represented by ELEMTYPE pointing to
793 another DNTT_TYPE_ARRAY. */
795 struct dntt_type_array
797 unsigned int extension
: 1;
798 unsigned int kind
: 10;
799 unsigned int declaration
: 2;
800 unsigned int dyn_low
: 2;
801 unsigned int dyn_high
: 2;
802 unsigned int arrayisbytes
: 1;
803 unsigned int elemisbytes
: 1;
804 unsigned int elemorder
: 1;
805 unsigned int justified
: 1;
806 unsigned int unused
: 11;
807 unsigned int arraylength
;
808 dnttpointer indextype
;
809 dnttpointer elemtype
;
810 unsigned int elemlength
;
815 DNTT_TYPE_STRUCT is used to describe a C structure.
817 DECLARATION describes the bitpacking used.
819 FIRSTFIELD is a DNTT pointer to the first field of the structure
820 (each field contains a pointer to the next field, walk the list
821 to access all fields of the structure).
823 VARTAGFIELD and VARLIST are used for Pascal variant records.
825 BITLENGTH is the size of the structure in bits. */
827 struct dntt_type_struct
829 unsigned int extension
: 1;
830 unsigned int kind
: 10;
831 unsigned int declaration
: 2;
832 unsigned int unused
: 19;
833 dnttpointer firstfield
;
834 dnttpointer vartagfield
;
836 unsigned int bitlength
;
841 DNTT_TYPE_UNION is used to describe a C union.
843 FIRSTFIELD is a DNTT pointer to the beginning of the field chain.
845 BITLENGTH is the size of the union in bits. */
847 struct dntt_type_union
849 unsigned int extension
: 1;
850 unsigned int kind
: 10;
851 unsigned int unused
: 21;
852 dnttpointer firstfield
;
853 unsigned int bitlength
;
858 DNTT_TYPE_FIELD describes one field in a structure or union
861 VISIBILITY is used to describe the visibility of the field
862 (for c++. public = 0, protected = 1, private = 2).
864 A_UNION is nonzero if this field is a member of an anonymous union.
866 STATICMEM is nonzero if this field is a static member of a template.
868 NAME is a pointer into the VT for the name of the field.
870 BITOFFSET gives the offset of this field in bits from the beginning
871 of the structure or union this field is a member of.
873 TYPE is a DNTT pointer to the type describing this field.
875 BITLENGTH is the size of the entry in bits.
877 NEXTFIELD is a DNTT pointer to the next field in the chain. */
879 struct dntt_type_field
881 unsigned int extension
: 1;
882 unsigned int kind
: 10;
883 unsigned int visibility
: 2;
884 unsigned int a_union
: 1;
885 unsigned int staticmem
: 1;
886 unsigned int unused
: 17;
888 unsigned int bitoffset
;
890 unsigned int bitlength
;
891 dnttpointer nextfield
;
894 /* DNTT_TYPE_VARIANT is unused by GDB. */
895 /* DNTT_TYPE_FILE is unused by GDB. */
897 /* DNTT_TYPE_FUNCTYPE
899 I think this is used to describe a function type (e.g., would
900 be emitted as part of a function-pointer description).
902 VARARGS is nonzero if this function uses varargs.
904 FIRSTPARAM is a DNTT pointer to the first entry in the parameter
907 RETVAL is a DNTT pointer to the type of the return value. */
909 struct dntt_type_functype
911 unsigned int extension
: 1;
912 unsigned int kind
: 10;
913 unsigned int varargs
: 1;
914 unsigned int info
: 4;
915 unsigned int unused
: 16;
916 unsigned int bitlength
;
917 dnttpointer firstparam
;
921 /* DNTT_TYPE_WITH is emitted by C++ to indicate "with" scoping semantics.
922 (Probably also emitted by PASCAL to support "with"...).
924 C++ example: Say "memfunc" is a method of class "c", and say
925 "m" is a data member of class "c". Then from within "memfunc",
926 it is legal to reference "m" directly (e.g. you don't have to
927 say "this->m". The symbol table indicates
928 this by emitting a DNTT_TYPE_WITH symbol within the function "memfunc",
929 pointing to the type symbol for class "c".
931 In GDB, this symbol record is unnecessary,
932 because GDB's symbol lookup algorithm
933 infers the "with" semantics when it sees a "this" argument to the member
934 function. So GDB can safely ignore the DNTT_TYPE_WITH record.
936 A DNTT_TYPE_WITH has a matching DNTT_TYPE_END symbol. */
938 struct dntt_type_with
940 unsigned int extension
: 1; /* always zero */
941 unsigned int kind
: 10; /* always DNTT_TYPE_WITH */
942 unsigned int addrtype
: 2; /* 0 => STATTYPE */
945 unsigned int indirect
: 1; /* 1 => pointer to object */
946 unsigned int longaddr
: 1; /* 1 => in long pointer space */
947 unsigned int nestlevel
: 6; /* # of nesting levels back */
948 unsigned int doc_ranges
: 1; /* 1 => location is range list */
949 unsigned int unused
: 10;
950 long location
; /* where stored (allocated) */
952 dnttpointer type
; /* type of with expression */
953 vtpointer name
; /* name of with expression */
954 unsigned long offset
; /* byte offset from location */
957 /* DNTT_TYPE_COMMON is unsupported by GDB. */
958 /* A DNTT_TYPE_COMMON symbol must have a matching DNTT_TYPE_END symbol */
960 /* DNTT_TYPE_COBSTRUCT is unsupported by GDB. */
961 /* DNTT_TYPE_XREF is unsupported by GDB. */
962 /* DNTT_TYPE_SA is unsupported by GDB. */
963 /* DNTT_TYPE_MACRO is unsupported by GDB */
965 /* DNTT_TYPE_BLOCKDATA has the same structure as DNTT_TYPE_FUNCTION */
967 /* The following are the C++ specific SOM records */
969 /* The purpose of the DNTT_TYPE_CLASS_SCOPE is to bracket C++ methods
970 and indicate the method name belongs in the "class scope" rather
971 than in the module they are being defined in. For example:
975 void memfunc(); // member function
978 void c::memfunc() // definition of class c's "memfunc"
988 In the above, the name "memfunc" is not directly visible from "main".
989 I.e., you have to say "break c::memfunc".
990 If it were a normal function (not a method), it would be visible
991 via the simple "break memfunc". Since "memfunc" otherwise looks
992 like a normal FUNCTION in the symbol table, the bracketing
993 CLASS_SCOPE is what is used to indicate it is really a method.
996 A DNTT_TYPE_CLASS_SCOPE symbol must have a matching DNTT_TYPE_END symbol. */
998 struct dntt_type_class_scope
1000 unsigned int extension
: 1; /* Always zero. */
1001 unsigned int kind
: 10; /* Always DNTT_TYPE_CLASS_SCOPE. */
1002 unsigned int unused
: 21;
1003 sltpointer address
; /* Pointer to SLT entry. */
1004 dnttpointer type
; /* Pointer to class type DNTT. */
1007 /* C++ reference parameter.
1008 The structure of this record is the same as DNTT_TYPE_POINTER -
1009 refer to struct dntt_type_pointer. */
1011 /* The next two describe C++ pointer-to-data-member type, and
1012 pointer-to-member-function type, respectively.
1013 DNTT_TYPE_PTRMEM and DNTT_TYPE_PTRMEMFUNC have the same structure. */
1015 struct dntt_type_ptrmem
1017 unsigned int extension
: 1; /* Always zero. */
1018 unsigned int kind
: 10; /* Always DNTT_TYPE_PTRMEM. */
1019 unsigned int unused
: 21;
1020 dnttpointer pointsto
; /* Pointer to class DNTT. */
1021 dnttpointer memtype
; /* Type of member. */
1024 struct dntt_type_ptrmemfunc
1026 unsigned int extension
: 1; /* Always zero. */
1027 unsigned int kind
: 10; /* Always DNTT_TYPE_PTRMEMFUNC. */
1028 unsigned int unused
: 21;
1029 dnttpointer pointsto
; /* Pointer to class DNTT. */
1030 dnttpointer memtype
; /* Type of member. */
1033 /* The DNTT_TYPE_CLASS symbol is emitted to describe a class type.
1034 "memberlist" points to a chained list of FIELD or GENFIELD records
1035 indicating the class members. "parentlist" points to a chained list
1036 of INHERITANCE records indicating classes from which we inherit
1039 struct dntt_type_class
1041 unsigned int extension
: 1; /* Always zero. */
1042 unsigned int kind
: 10; /* Always DNTT_TYPE_CLASS. */
1043 unsigned int abstract
: 1; /* Is this an abstract class? */
1044 unsigned int class_decl
: 2; /* 0=class,1=union,2=struct. */
1045 unsigned int expansion
: 1; /* 1=template expansion. */
1046 unsigned int unused
: 17;
1047 dnttpointer memberlist
; /* Ptr to chain of [GEN]FIELDs. */
1048 unsigned long vtbl_loc
; /* Offset in obj of ptr to vtbl. */
1049 dnttpointer parentlist
; /* Ptr to K_INHERITANCE list. */
1050 unsigned long bitlength
; /* Total at this level. */
1051 dnttpointer identlist
; /* Ptr to chain of class ident's. */
1052 dnttpointer friendlist
; /* Ptr to K_FRIEND list. */
1053 dnttpointer templateptr
; /* Ptr to template. */
1054 dnttpointer nextexp
; /* Ptr to next expansion. */
1057 /* Class members are indicated via either the FIELD record (for
1058 data members, same as for C struct fields), or by the GENFIELD record
1059 (for member functions). */
1061 struct dntt_type_genfield
1063 unsigned int extension
: 1; /* Always zero. */
1064 unsigned int kind
: 10; /* Always DNTT_TYPE_GENFIELD. */
1065 unsigned int visibility
: 2; /* Pub = 0, prot = 1, priv = 2. */
1066 unsigned int a_union
: 1; /* 1 => anonymous union member. */
1067 unsigned int unused
: 18;
1068 dnttpointer field
; /* Pointer to field or qualifier. */
1069 dnttpointer nextfield
; /* Pointer to next field. */
1072 /* C++ virtual functions. */
1074 struct dntt_type_vfunc
1076 unsigned int extension
: 1; /* always zero */
1077 unsigned int kind
: 10; /* always DNTT_TYPE_VFUNC */
1078 unsigned int pure
: 1; /* pure virtual function ? */
1079 unsigned int unused
: 20;
1080 dnttpointer funcptr
; /* points to FUNCTION symbol */
1081 unsigned long vtbl_offset
; /* offset into vtbl for virtual */
1084 /* Not precisely sure what this is intended for - DDE ignores it. */
1086 struct dntt_type_memaccess
1088 unsigned int extension
: 1; /* always zero */
1089 unsigned int kind
: 10; /* always DNTT_TYPE_MEMACCESS */
1090 unsigned int unused
: 21;
1091 dnttpointer classptr
; /* pointer to base class */
1092 dnttpointer field
; /* pointer field */
1095 /* The DNTT_TYPE_INHERITANCE record describes derived classes.
1096 In particular, the "parentlist" field of the CLASS record points
1097 to a list of INHERITANCE records for classes from which we
1100 struct dntt_type_inheritance
1102 unsigned int extension
: 1; /* always zero */
1103 unsigned int kind
: 10; /* always DNTT_TYPE_INHERITANCE */
1104 unsigned int Virtual
: 1; /* virtual base class ? */
1105 unsigned int visibility
: 2; /* pub = 0, prot = 1, priv = 2 */
1106 unsigned int unused
: 18;
1107 dnttpointer classname
; /* first parent class, if any */
1108 unsigned long offset
; /* offset to start of base class */
1109 dnttpointer next
; /* pointer to next K_INHERITANCE */
1110 unsigned long future
[2] ; /* padding to 3-word block end */
1113 /* C++ "friend" classes ... */
1115 struct dntt_type_friend_class
1117 unsigned int extension
: 1; /* always zero */
1118 unsigned int kind
: 10; /* always DNTT_TYPE_FRIEND_CLASS */
1119 unsigned int unused
: 21;
1120 dnttpointer classptr
; /* pointer to class DNTT */
1121 dnttpointer next
; /* next DNTT_FRIEND */
1124 struct dntt_type_friend_func
1126 unsigned int extension
: 1; /* always zero */
1127 unsigned int kind
: 10; /* always DNTT_TYPE_FRIEND_FUNC */
1128 unsigned int unused
: 21;
1129 dnttpointer funcptr
; /* pointer to function */
1130 dnttpointer classptr
; /* pointer to class DNTT */
1131 dnttpointer next
; /* next DNTT_FRIEND */
1132 unsigned long future
[2] ; /* padding to 3-word block end */
1135 /* DDE appears to ignore the DNTT_TYPE_MODIFIER record.
1136 It could perhaps be used to give better "ptype" output in GDB;
1137 otherwise it is probably safe for GDB to ignore it also. */
1139 struct dntt_type_modifier
1141 unsigned int extension
: 1; /* always zero */
1142 unsigned int kind
: 10; /* always DNTT_TYPE_MODIFIER */
1143 unsigned int m_const
: 1; /* const */
1144 unsigned int m_static
: 1; /* static */
1145 unsigned int m_void
: 1; /* void */
1146 unsigned int m_volatile
: 1; /* volatile */
1147 unsigned int m_duplicate
: 1; /* duplicate */
1148 unsigned int unused
: 16;
1149 dnttpointer type
; /* subtype */
1150 unsigned long future
; /* padding to 3-word block end */
1153 /* I'm not sure what this was intended for - DDE ignores it. */
1155 struct dntt_type_object_id
1157 unsigned int extension
: 1; /* always zero */
1158 unsigned int kind
: 10; /* always DNTT_TYPE_OBJECT_ID */
1159 unsigned int indirect
: 1; /* Is object_ident addr of addr? */
1160 unsigned int unused
: 20;
1161 unsigned long object_ident
; /* object identifier */
1162 unsigned long offset
; /* offset to start of base class */
1163 dnttpointer next
; /* pointer to next K_OBJECT_ID */
1164 unsigned long segoffset
; /* for linker fixup */
1165 unsigned long future
; /* padding to 3-word block end */
1168 /* No separate dntt_type_memfunc; same as dntt_type_func */
1170 /* Symbol records to support templates. These only get used
1171 in DDE's "describe" output (like GDB's "ptype"). */
1173 /* The TEMPLATE record is the header for a template-class.
1174 Like the CLASS record, a TEMPLATE record has a memberlist that
1175 points to a list of template members. It also has an arglist
1176 pointing to a list of TEMPLATE_ARG records. */
1178 struct dntt_type_template
1180 unsigned int extension
: 1; /* always zero */
1181 unsigned int kind
: 10; /* always DNTT_TYPE_TEMPLATE */
1182 unsigned int abstract
: 1; /* is this an abstract class? */
1183 unsigned int class_decl
: 2; /* 0=class,1=union,2=struct */
1184 unsigned int unused
: 18;
1185 dnttpointer memberlist
; /* ptr to chain of K_[GEN]FIELDs */
1186 long unused2
; /* offset in obj of ptr to vtbl */
1187 dnttpointer parentlist
; /* ptr to K_INHERITANCE list */
1188 unsigned long bitlength
; /* total at this level */
1189 dnttpointer identlist
; /* ptr to chain of class ident's */
1190 dnttpointer friendlist
; /* ptr to K_FRIEND list */
1191 dnttpointer arglist
; /* ptr to argument list */
1192 dnttpointer expansions
; /* ptr to expansion list */
1195 /* Template-class arguments are a list of TEMPL_ARG records
1196 chained together. The "name" field is the name of the formal.
1199 template <class T> class q { ... };
1201 Then "T" is the name of the formal argument. */
1203 struct dntt_type_templ_arg
1205 unsigned int extension
: 1; /* always zero */
1206 unsigned int kind
: 10; /* always DNTT_TYPE_TEMPL_ARG */
1207 unsigned int usagetype
: 1; /* 0 type-name 1 expression */
1208 unsigned int unused
: 20;
1209 vtpointer name
; /* name of argument */
1210 dnttpointer type
; /* for non type arguments */
1211 dnttpointer nextarg
; /* Next argument if any */
1212 long future
[2] ; /* padding to 3-word block end */
1215 /* FUNC_TEMPLATE records are sort of like FUNCTION, but are emitted
1216 for template member functions. E.g.,
1218 template <class T> class q
1225 Within the list of FIELDs/GENFIELDs defining the member list
1226 of the template "q", "f" would appear as a FUNC_TEMPLATE.
1227 We'll also see instances of FUNCTION "f" records for each
1228 instantiation of the template. */
1230 struct dntt_type_func_template
1232 unsigned int extension
: 1; /* always zero */
1233 unsigned int kind
: 10; /* always DNTT_TYPE_FUNC_TEMPLATE */
1234 unsigned int public: 1; /* 1 => globally visible */
1235 unsigned int language
: 4; /* type of language */
1236 unsigned int level
: 5; /* nesting level (top level = 0)*/
1237 unsigned int optimize
: 2; /* level of optimization */
1238 unsigned int varargs
: 1; /* ellipses. Pascal/800 later */
1239 unsigned int info
: 4; /* lang-specific stuff; F_xxxx */
1240 unsigned int inlined
: 1;
1241 unsigned int localloc
: 1; /* 0 at top, 1 at end of block */
1242 unsigned int unused
: 2;
1243 vtpointer name
; /* name of function */
1244 vtpointer alias
; /* alternate name, if any */
1245 dnttpointer firstparam
; /* first FPARAM, if any */
1246 dnttpointer retval
; /* return type, if any */
1247 dnttpointer arglist
; /* ptr to argument list */
1250 /* LINK is apparently intended to link together function template
1251 definitions with their instantiations. However, it is not clear
1252 why this would be needed, except to provide the information on
1253 a "ptype" command. And as far as I can tell, aCC does not
1254 generate this record. */
1256 struct dntt_type_link
1258 unsigned int extension
: 1; /* always zero */
1259 unsigned int kind
: 10; /* always DNTT_TYPE_LINK */
1260 unsigned int linkKind
: 4; /* always LINK_UNKNOWN */
1261 unsigned int unused
: 17;
1262 long future1
; /* expansion */
1263 dnttpointer ptr1
; /* link from template */
1264 dnttpointer ptr2
; /* to expansion */
1265 long future
[2] ; /* padding to 3-word block end */
1268 /* end of C++ specific SOM's. */
1270 /* DNTT_TYPE_DYN_ARRAY_DESC is unused by GDB */
1271 /* DNTT_TYPE_DESC_SUBRANGE is unused by GDB */
1272 /* DNTT_TYPE_BEGIN_EXT is unused by GDB */
1273 /* DNTT_TYPE_INLN is unused by GDB */
1274 /* DNTT_TYPE_INLN_LIST is unused by GDB */
1275 /* DNTT_TYPE_ALIAS is unused by GDB */
1277 struct dntt_type_doc_function
1279 unsigned int extension
: 1; /* always zero */
1280 unsigned int kind
: 10; /* K_DOC_FUNCTION or */
1282 unsigned int global
: 1; /* 1 => globally visible */
1283 unsigned int language
: 4; /* type of language */
1284 unsigned int level
: 5; /* nesting level (top level = 0)*/
1285 unsigned int optimize
: 2; /* level of optimization */
1286 unsigned int varargs
: 1; /* ellipses. Pascal/800 later */
1287 unsigned int info
: 4; /* lang-specific stuff; F_xxxx */
1288 unsigned int inlined
: 1;
1289 unsigned int localloc
: 1; /* 0 at top, 1 at end of block */
1290 unsigned int expansion
: 1; /* 1 = function expansion */
1291 unsigned int doc_clone
: 1;
1292 vtpointer name
; /* name of function */
1293 vtpointer alias
; /* alternate name, if any */
1294 dnttpointer firstparam
; /* first FPARAM, if any */
1295 sltpointer address
; /* code and text locations */
1296 CORE_ADDR entryaddr
; /* address of entry point */
1297 dnttpointer retval
; /* return type, if any */
1298 CORE_ADDR lowaddr
; /* lowest address of function */
1299 CORE_ADDR hiaddr
; /* highest address of function */
1300 dnttpointer inline_list
; /* pointer to first inline */
1301 ltpointer lt_offset
; /* start of frag/cp line table */
1302 ctxtpointer ctxt_offset
; /* start of context table for this routine */
1305 /* DNTT_TYPE_DOC_MEMFUNC is unused by GDB */
1307 /* DNTT_TYPE_GENERIC and DNTT_TYPE_BLOCK are convience structures
1308 so we can examine a DNTT entry in a generic fashion. */
1309 struct dntt_type_generic
1311 unsigned int word
[9];
1314 struct dntt_type_block
1316 unsigned int extension
: 1;
1317 unsigned int kind
: 10;
1318 unsigned int unused
: 21;
1319 unsigned int word
[2];
1322 /* One entry in a DNTT (either the LNTT or GNTT).
1323 This is a union of the above 60 or so structure definitions. */
1327 struct dntt_type_srcfile dsfile
;
1328 struct dntt_type_module dmodule
;
1329 struct dntt_type_function dfunc
;
1330 struct dntt_type_function dentry
;
1331 struct dntt_type_begin dbegin
;
1332 struct dntt_type_end dend
;
1333 struct dntt_type_fparam dfparam
;
1334 struct dntt_type_svar dsvar
;
1335 struct dntt_type_dvar ddvar
;
1336 struct dntt_type_const dconst
;
1337 struct dntt_type_type dtype
;
1338 struct dntt_type_type dtag
;
1339 struct dntt_type_pointer dptr
;
1340 struct dntt_type_enum denum
;
1341 struct dntt_type_memenum dmember
;
1342 struct dntt_type_set dset
;
1343 struct dntt_type_subrange dsubr
;
1344 struct dntt_type_array darray
;
1345 struct dntt_type_struct dstruct
;
1346 struct dntt_type_union dunion
;
1347 struct dntt_type_field dfield
;
1348 struct dntt_type_functype dfunctype
;
1349 struct dntt_type_with dwith
;
1350 struct dntt_type_function dblockdata
;
1351 struct dntt_type_class_scope dclass_scope
;
1352 struct dntt_type_pointer dreference
;
1353 struct dntt_type_ptrmem dptrmem
;
1354 struct dntt_type_ptrmemfunc dptrmemfunc
;
1355 struct dntt_type_class dclass
;
1356 struct dntt_type_genfield dgenfield
;
1357 struct dntt_type_vfunc dvfunc
;
1358 struct dntt_type_memaccess dmemaccess
;
1359 struct dntt_type_inheritance dinheritance
;
1360 struct dntt_type_friend_class dfriend_class
;
1361 struct dntt_type_friend_func dfriend_func
;
1362 struct dntt_type_modifier dmodifier
;
1363 struct dntt_type_object_id dobject_id
;
1364 struct dntt_type_template dtemplate
;
1365 struct dntt_type_templ_arg dtempl_arg
;
1366 struct dntt_type_func_template dfunc_template
;
1367 struct dntt_type_link dlink
;
1368 struct dntt_type_doc_function ddocfunc
;
1369 struct dntt_type_generic dgeneric
;
1370 struct dntt_type_block dblock
;
1373 /* Source line entry types. */
1392 /* A normal source line entry. Simply provides a mapping of a source
1393 line number to a code address.
1395 SLTDESC will always be SLT_NORMAL or SLT_EXIT. */
1399 unsigned int sltdesc
: 4;
1400 unsigned int line
: 28;
1404 struct slt_normal_off
1406 unsigned int sltdesc
: 4;
1407 unsigned int offset
: 6;
1408 unsigned int line
: 22;
1412 /* A special source line entry. Provides a mapping of a declaration
1413 to a line number. These entries point back into the DNTT which
1418 unsigned int sltdesc
: 4;
1419 unsigned int line
: 28;
1420 dnttpointer backptr
;
1423 /* Used to describe nesting.
1425 For nested languages, an slt_assist entry must follow each SLT_FUNC
1426 entry in the SLT. The address field will point forward to the
1427 first slt_normal entry within the function's scope. */
1431 unsigned int sltdesc
: 4;
1432 unsigned int unused
: 28;
1438 unsigned int word
[2];
1443 struct slt_normal snorm
;
1444 struct slt_normal_off snormoff
;
1445 struct slt_special sspec
;
1446 struct slt_assist sasst
;
1447 struct slt_generic sgeneric
;
1450 /* $LINES$ declarations
1451 This is the line table used for optimized code, which is only present
1452 in the new $PROGRAM_INFO$ debug space. */
1454 #define DST_LN_ESCAPE_FLAG1 15
1455 #define DST_LN_ESCAPE_FLAG2 14
1456 #define DST_LN_CTX_SPEC1 13
1457 #define DST_LN_CTX_SPEC2 12
1459 /* Escape function codes: */
1463 dst_ln_pad
, /* pad byte */
1464 dst_ln_escape_1
, /* reserved */
1465 dst_ln_dpc1_dln1
, /* 1 byte line delta, 1 byte pc delta */
1466 dst_ln_dpc2_dln2
, /* 2 bytes line delta, 2 bytes pc delta */
1467 dst_ln_pc4_ln4
, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */
1468 dst_ln_dpc0_dln1
, /* 1 byte line delta, pc delta = 0 */
1469 dst_ln_ln_off_1
, /* statement escape, stmt # = 1 (2nd stmt on line) */
1470 dst_ln_ln_off
, /* statement escape, stmt # = next byte */
1471 dst_ln_entry
, /* entry escape, next byte is entry number */
1472 dst_ln_exit
, /* exit escape */
1473 dst_ln_stmt_end
, /* gap escape, 4 bytes pc delta */
1474 dst_ln_stmt_cp
, /* current stmt is a critical point */
1475 dst_ln_escape_12
, /* reserved */
1476 dst_ln_escape_13
, /* this is an exception site record */
1477 dst_ln_nxt_byte
, /* next byte contains the real escape code */
1478 dst_ln_end
, /* end escape, final entry follows */
1479 dst_ln_escape1_END_OF_ENUM
1485 dst_ln_ctx_1
, /* next byte describes context switch with 5-bit */
1486 /* index into the image table and 3-bit run length. */
1487 /* If run length is 0, end with another cxt specifier or ctx_end */
1488 dst_ln_ctx_2
, /* next 2 bytes switch context: 13 bit index, 3 bit run length */
1489 dst_ln_ctx_4
, /* next 4 bytes switch context: 29 bit index, 3 bit run length */
1490 dst_ln_ctx_end
, /* end current context */
1491 dst_ln_col_run_1
, /* next byte is column position of start of next statement, */
1492 /* following byte is length of statement */
1493 dst_ln_col_run_2
, /* next 2 bytes is column position of start of next statement, */
1494 /* following 2 bytes is length of statement */
1495 dst_ln_init_base1
, /* next 4 bytes are absolute PC, followed by 1 byte of line number */
1496 dst_ln_init_base2
, /* next 4 bytes are absolute PC, followed by 2 bytes of line number */
1497 dst_ln_init_base3
, /* next 4 bytes are absolute PC, followed by 3 bytes of line number */
1498 dst_ln_escape2_END_OF_ENUM
1506 unsigned int pc_delta
: 4; /* 4 bit pc delta */
1507 int ln_delta
: 4; /* 4 bit line number delta */
1513 unsigned int esc_flag
: 4; /* alias for pc_delta */
1514 unsigned int esc_code
: 4; /* escape function code (dst_ln_escape1_t, or ...2_t */
1520 unsigned int esc_flag
: 4; /* dst_ln_ctx_spec1, or dst_ln_ctx_spec2 */
1521 unsigned int run_length
: 2;
1522 unsigned int ctx_index
: 2; /* ...spec2 contains index; ...spec1, index - 4 */
1526 char sdata
; /* signed data byte */
1527 unsigned char udata
; /* unsigned data byte */
1530 * dst_ln_entry_ptr_t
;
1532 /* Warning: although the above union occupies only 1 byte the compiler treats
1533 it as having size 2 (the minimum size of a struct). Therefore a sequence of
1534 dst_ln_entry_t's cannot be described as an array, and walking through such a
1535 sequence requires convoluted code such as
1536 ln_ptr = (dst_ln_entry_ptr_t) (char*) ln_ptr + 1
1537 We regret the inconvenience. */
1539 /* Structure for interpreting the byte following a dst_ln_ctx1 entry. */
1542 unsigned int ctx1_index
: 5; /* 5 bit index into context table */
1543 unsigned int ctx1_run_length
: 3; /* 3 bit run length */
1547 /* Structure for interpreting the bytes following a dst_ln_ctx2 entry. */
1550 unsigned int ctx2_index
: 13; /* 13 bit index into context table */
1551 unsigned int ctx2_run_length
: 3; /* 3 bit run length */
1555 /* Structure for interpreting the bytes following a dst_ln_ctx4 entry. */
1558 unsigned int ctx4_index
: 29; /* 29 bit index into context table */
1559 unsigned int ctx4_run_length
: 3; /* 3 bit run length */
1564 /* PXDB definitions.
1566 PXDB is a post-processor which takes the executable file
1567 and massages the debug information so that the debugger may
1568 start up and run more efficiently. Some of the tasks
1569 performed by PXDB are:
1571 o Remove duplicate global type and variable information
1574 o Append the GNTT onto the end of the LNTT and place both
1575 back in the LNTT section,
1577 o Build quick look-up tables (description follows) for
1578 files, procedures, modules, and paragraphs (for Cobol),
1579 placing these in the GNTT section,
1581 o Reconstruct the header appearing in the header section
1582 to access this information.
1584 The "quick look-up" tables are in the $GNTT$ sub-space, in
1585 the following order:
1587 Procedures -sorted by address
1588 Source files -sorted by address (of the
1589 generated code from routines)
1590 Modules -sorted by address
1591 Classes -<unsorted?>
1592 Address Alias -sorted by index <?>
1593 Object IDs -sorted by object identifier
1595 Most quick entries have (0-based) indices into the LNTT tables to
1596 the full entries for the item it describes.
1598 The post-PXDB header is in the $HEADER$ sub-space. Alas, it
1599 occurs in different forms, depending on the optimization level
1600 in the compilation step and whether PXDB was run or not. The
1601 worst part is the forms aren't self-describing, so we'll have
1602 to grovel in the bits to figure out what kind we're looking at
1603 (see hp_get_header in hp-psymtab-read.c). */
1605 /* PXDB versions. */
1607 #define PXDB_VERSION_CPLUSPLUS 1
1608 #define PXDB_VERSION_7_4 2
1609 #define PXDB_VERSION_CPP_30 3
1610 #define PXDB_VERSION_DDE_3_2A 4
1611 #define PXDB_VERSION_DDE_3_2 5
1612 #define PXDB_VERSION_DDE_4_0 6
1614 #define PXDB_VERSION_2_1 1
1616 /* Header version for the case that there is no DOC info
1617 but the executable has been processed by pxdb (the easy
1618 case, from "cc -g"). */
1620 typedef struct PXDB_struct
1622 int pd_entries
; /* # of entries in function look-up table */
1623 int fd_entries
; /* # of entries in file look-up table */
1624 int md_entries
; /* # of entries in module look-up table */
1625 unsigned int pxdbed
: 1; /* 1 => file has been preprocessed */
1626 unsigned int bighdr
: 1; /* 1 => this header contains 'time' word */
1627 unsigned int sa_header
: 1;/* 1 => created by SA version of pxdb */
1628 /* used for version check in xdb */
1629 unsigned int inlined
: 1; /* one or more functions have been inlined */
1630 unsigned int spare
:12;
1631 short version
; /* pxdb header version */
1632 int globals
; /* index into the DNTT where GNTT begins */
1633 unsigned int time
; /* modify time of file before being pxdbed */
1634 int pg_entries
; /* # of entries in label look-up table */
1635 int functions
; /* actual number of functions */
1636 int files
; /* actual number of files */
1637 int cd_entries
; /* # of entries in class look-up table */
1638 int aa_entries
; /* # of entries in addr alias look-up table */
1639 int oi_entries
; /* # of entries in object id look-up table */
1640 } PXDB_header
, *PXDB_header_ptr
;
1642 /* Header version for the case that there is no DOC info and the
1643 executable has NOT been processed by pxdb. */
1645 typedef struct XDB_header_struct
1654 /* Header version for the case that there is DOC info and the
1655 executable has been processed by pxdb. */
1657 typedef struct DOC_info_PXDB_header_struct
1659 unsigned int xdb_header
: 1; /* bit set if this is post-3.1 xdb */
1660 unsigned int doc_header
: 1; /* bit set if this is doc-style header */
1661 unsigned int version
: 8; /* version of pxdb see defines
1662 PXDB_VERSION_* in this file. */
1663 unsigned int reserved_for_flags
: 16;/* for future use; -- must be
1665 unsigned int has_aux_pd_table
: 1; /* $GNTT$ has aux PD table */
1666 unsigned int has_expr_table
: 1; /* space has $EXPR$ */
1667 unsigned int has_range_table
: 1; /* space has $RANGE$ */
1668 unsigned int has_context_table
: 1; /* space has $SRC_CTXT$ */
1669 unsigned int has_lines_table
: 1; /* space contains a $LINES$
1670 subspace for line tables. */
1671 unsigned int has_lt_offset_map
: 1; /* space contains an lt_offset
1672 subspace for line table mapping. */
1673 /* The following fields are the same as those in the PXDB_header in $DEBUG$ */
1674 int pd_entries
; /* # of entries in function look-up table */
1675 int fd_entries
; /* # of entries in file look-up table */
1676 int md_entries
; /* # of entries in module look-up table */
1677 unsigned int pxdbed
: 1; /* 1 => file has been preprocessed */
1678 unsigned int bighdr
: 1; /* 1 => this header contains 'time' word */
1679 unsigned int sa_header
: 1;/* 1 => created by SA version of pxdb */
1680 /* used for version check in xdb */
1681 unsigned int inlined
: 1; /* one or more functions have been inlined */
1682 unsigned int spare
: 28;
1683 int globals
; /* index into the DNTT where GNTT begins */
1684 unsigned int time
; /* modify time of file before being pxdbed */
1685 int pg_entries
; /* # of entries in label look-up table */
1686 int functions
; /* actual number of functions */
1687 int files
; /* actual number of files */
1688 int cd_entries
; /* # of entries in class look-up table */
1689 int aa_entries
; /* # of entries in addr alias look-up table */
1690 int oi_entries
; /* # of entries in object id look-up table */
1691 } DOC_info_PXDB_header
;
1693 /* Header version for the case that there is DOC info and the
1694 executable has NOT been processed by pxdb. */
1696 typedef struct DOC_info_header_struct
1698 unsigned int xdb_header
: 1; /* bit set if this is post-3.1 xdb */
1699 unsigned int doc_header
: 1; /* bit set if this is doc-style header*/
1700 unsigned int version
: 8; /* version of debug/header
1701 format. For 10.0 the value
1702 will be 1. For "Davis" the value is 2. */
1703 unsigned int reserved_for_flags
: 18; /* for future use; -- must be set to zero. */
1704 unsigned int has_range_table
: 1; /* space contains a $RANGE$ subspace for variable ranges. */
1705 unsigned int has_context_table
: 1; /* space contains a $CTXT$ subspace for context/inline table. */
1706 unsigned int has_lines_table
: 1; /* space contains a $LINES$ subspace for line tables. */
1707 unsigned int has_lt_offset_map
: 1; /* space contains an lt_offset subspace for line table mapping. */
1709 long gntt_length
; /* same as old header */
1710 long lntt_length
; /* same as old header */
1711 long slt_length
; /* same as old header */
1712 long vt_length
; /* same as old header */
1713 long xt_length
; /* same as old header */
1714 long ctxt_length
; /* present only if version >= 2 */
1715 long range_length
; /* present only if version >= 2 */
1716 long expr_length
; /* present only if version >= 2 */
1720 typedef union GenericDebugHeader_union
1723 DOC_info_PXDB_header doc
;
1724 XDB_header no_pxdb_no_doc
;
1725 DOC_info_header no_pxdb_doc
;
1726 } GenericDebugHeader
;
1729 /* Procedure Descriptor:
1730 An element of the procedure quick look-up table. */
1732 typedef struct quick_procedure
1734 long isym
; /* 0-based index of first symbol
1735 for procedure in $LNTT$,
1736 i.e. the procedure itself. */
1737 CORE_ADDR adrStart
; /* memory adr of start of proc */
1738 CORE_ADDR adrEnd
; /* memory adr of end of proc */
1739 char *sbAlias
; /* alias name of procedure */
1740 char *sbProc
; /* real name of procedure */
1741 CORE_ADDR adrBp
; /* address of entry breakpoint */
1742 CORE_ADDR adrExitBp
; /* address of exit breakpoint */
1743 int icd
; /* member of this class (index) */
1744 unsigned int ipd
; /* index of template for this */
1745 /* function (index) */
1746 unsigned int unused
: 5;
1747 unsigned int no_lt_offset
: 1;/* no entry in lt_offset table */
1748 unsigned int fTemplate
: 1; /* function template */
1749 unsigned int fExpansion
: 1; /* function expansion */
1750 unsigned int linked
: 1; /* linked with other expansions */
1751 unsigned int duplicate
: 1; /* clone of another procedure */
1752 unsigned int overloaded
:1; /* overloaded function */
1753 unsigned int member
: 1; /* class member function */
1754 unsigned int constructor
:1; /* constructor function */
1755 unsigned int destructor
:1; /* destructor function */
1756 unsigned int Static
: 1; /* static function */
1757 unsigned int Virtual
: 1; /* virtual function */
1758 unsigned int constant
: 1; /* constant function */
1759 unsigned int pure
: 1; /* pure (virtual) function */
1760 unsigned int language
: 4; /* procedure's language */
1761 unsigned int inlined
: 1; /* function has been inlined */
1762 unsigned int Operator
: 1; /* operator function */
1763 unsigned int stub
: 1; /* bodyless function */
1764 unsigned int optimize
: 2; /* optimization level */
1765 unsigned int level
: 5; /* nesting level (top=0) */
1766 } quick_procedure_entry
, *quick_procedure_entry_ptr
;
1768 /* Source File Descriptor:
1769 An element of the source file quick look-up table. */
1771 typedef struct quick_source
1773 long isym
; /* 0-based index in $LNTT$ of
1774 first symbol for this file. */
1775 CORE_ADDR adrStart
; /* mem adr of start of file's code */
1776 CORE_ADDR adrEnd
; /* mem adr of end of file's code */
1777 char *sbFile
; /* name of source file */
1778 unsigned int fHasDecl
: 1; /* do we have a .d file? */
1779 unsigned int fWarned
: 1; /* have warned about age problems? */
1780 unsigned int fSrcfile
: 1; /* 0 => include 1=> source */
1781 unsigned short ilnMac
; /* lines in file (0 if don't know) */
1782 int ipd
; /* 0-based index of first procedure
1783 in this file, in the quick
1784 look-up table of procedures. */
1785 unsigned int *rgLn
; /* line pointer array, if any */
1786 } quick_file_entry
, *quick_file_entry_ptr
;
1788 /* Module Descriptor:
1789 An element of the module quick reference table. */
1791 typedef struct quick_module
1793 long isym
; /* 0-based index of first
1794 symbol for module. */
1795 CORE_ADDR adrStart
; /* adr of start of mod. */
1796 CORE_ADDR adrEnd
; /* adr of end of mod. */
1797 char *sbAlias
; /* alias name of module */
1798 char *sbMod
; /* real name of module */
1799 unsigned int imports
: 1; /* module have any imports? */
1800 unsigned int vars_in_front
: 1; /* module globals in front? */
1801 unsigned int vars_in_gaps
: 1; /* module globals in gaps? */
1802 unsigned int language
: 4; /* type of language */
1803 unsigned int unused
: 25;
1804 unsigned int unused2
; /* space for future stuff */
1805 } quick_module_entry
, *quick_module_entry_ptr
;
1807 /* Auxiliary Procedure Descriptor:
1808 An element of the auxiliary procedure quick look-up table. */
1810 typedef struct quick_aux_procedure
1812 long isym_inln
; /* start on inline list for proc */
1814 } quick_aux_procedure_entry
, *quick_aux_procedure_entry_ptr
;
1816 /* Paragraph Descriptor:
1817 An element of the paragraph quick look-up table. */
1819 typedef struct quick_paragraph
1821 long isym
; /* first symbol for label (index) */
1822 CORE_ADDR adrStart
; /* memory adr of start of label */
1823 CORE_ADDR adrEnd
; /* memory adr of end of label */
1824 char *sbLab
; /* name of label */
1825 unsigned int inst
; /* Used in xdb to store inst @ bp */
1826 unsigned int sect
: 1; /* true = section, false = parag. */
1827 unsigned int unused
: 31; /* future use */
1828 } quick_paragraph_entry
, *quick_paragraph_entry_ptr
;
1830 /* Class Descriptor:
1831 An element of the class quick look-up table. */
1833 typedef struct quick_class
1835 char *sbClass
; /* name of class */
1836 long isym
; /* class symbol (tag) */
1837 unsigned int type
: 2; /* 0=class, 1=union, 2=struct */
1838 unsigned int fTemplate
: 1;/* class template */
1839 unsigned int expansion
: 1;/* template expansion */
1840 unsigned int unused
:28;
1841 sltpointer lowscope
; /* beginning of defined scope */
1842 sltpointer hiscope
; /* end of defined scope */
1843 } quick_class_entry
, *quick_class_entry_ptr
;
1845 /* Address Alias Entry
1846 An element of the address alias quick look-up table. */
1848 typedef struct quick_alias
1853 unsigned int unused
: 31;
1854 unsigned int alternate
: 1; /* alternate unnamed aliases? */
1855 } quick_alias_entry
, *quick_alias_entry_ptr
;
1857 /* Object Identification Entry
1858 An element of the object identification quick look-up table. */
1860 typedef struct quick_obj_ID
1862 CORE_ADDR obj_ident
; /* class identifier */
1863 long isym
; /* class symbol */
1864 long offset
; /* offset to object start */
1865 } quick_obj_ID_entry
, *quick_obj_ID_entry_ptr
;
1867 #endif /* HP_SYMTAB_INCLUDED */