2000-05-29 Philip Blundell <philb@gnu.org>
[binutils.git] / include / hp-symtab.h
blobcf626c073436c17891eaed7b405ae957a4d9a880
1 /* Definitions and structures for reading debug symbols from the
2 native HP C compiler.
4 Written by the Center for Software Science at the University of Utah
5 and by Cygnus Support.
7 Copyright 1994 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 #ifndef HP_SYMTAB_INCLUDED
24 #define HP_SYMTAB_INCLUDED
26 /* General information:
28 This header file defines and describes only the data structures
29 necessary to read debug symbols produced by the HP C compiler,
30 HP ANSI C++ compiler, and HP FORTRAN 90 compiler using the
31 SOM object file format.
32 (For a full description of the debug format, ftp hpux-symtab.h from
33 jaguar.cs.utah.edu:/dist).
35 Additional notes (Rich Title)
36 This file is a reverse-engineered version of a file called
37 "symtab.h" which exists internal to HP's Computer Languages Organization
38 in /CLO/Components/DDE/obj/som/symtab.h. Because HP's version of
39 the file is copyrighted and not distributed, it is necessary for
40 GDB to use the reverse-engineered version that follows.
41 Work was done by Cygnus to reverse-engineer the C subset of symtab.h.
42 The WDB project has extended this to also contain the C++
43 symbol definitions, the F90 symbol definitions,
44 and the DOC (debugging-optimized-code) symbol definitions.
45 In some cases (the C++ symbol definitions)
46 I have added internal documentation here that
47 goes beyond what is supplied in HP's symtab.h. If we someday
48 unify these files again, the extra comments should be merged back
49 into HP's symtab.h.
51 -------------------------------------------------------------------
53 Debug symbols are contained entirely within an unloadable space called
54 $DEBUG$. $DEBUG$ contains several subspaces which group related
55 debug symbols.
57 $GNTT$ contains information for global variables, types and contants.
59 $LNTT$ contains information for procedures (including nesting), scoping
60 information, local variables, types, and constants.
62 $SLT$ contains source line information so that code addresses may be
63 mapped to source lines.
65 $VT$ contains various strings and constants for named objects (variables,
66 typedefs, functions, etc). Strings are stored as null-terminated character
67 lists. Constants always begin on word boundaries. The first byte of
68 the VT must be zero (a null string).
70 $XT$ is not currently used by GDB.
72 Many structures within the subspaces point to other structures within
73 the same subspace, or to structures within a different subspace. These
74 pointers are represented as a structure index from the beginning of
75 the appropriate subspace. */
77 /* Used to describe where a constant is stored. */
78 enum location_type
80 LOCATION_IMMEDIATE,
81 LOCATION_PTR,
82 LOCATION_VT,
85 /* Languages supported by this debug format. Within the data structures
86 this type is limited to 4 bits for a maximum of 16 languages. */
87 enum hp_language
89 HP_LANGUAGE_UNKNOWN,
90 HP_LANGUAGE_C,
91 HP_LANGUAGE_FORTRAN,
92 HP_LANGUAGE_F77 = HP_LANGUAGE_FORTRAN,
93 HP_LANGUAGE_PASCAL,
94 HP_LANGUAGE_MODCAL,
95 HP_LANGUAGE_COBOL,
96 HP_LANGUAGE_BASIC,
97 HP_LANGUAGE_ADA,
98 HP_LANGUAGE_CPLUSPLUS,
99 HP_LANGUAGE_DMPASCAL
103 /* Basic data types available in this debug format. Within the data
104 structures this type is limited to 5 bits for a maximum of 32 basic
105 data types. */
106 enum hp_type
108 HP_TYPE_UNDEFINED, /* 0 */
109 HP_TYPE_BOOLEAN, /* 1 */
110 HP_TYPE_CHAR, /* 2 */
111 HP_TYPE_INT, /* 3 */
112 HP_TYPE_UNSIGNED_INT, /* 4 */
113 HP_TYPE_REAL, /* 5 */
114 HP_TYPE_COMPLEX, /* 6 */
115 HP_TYPE_STRING200, /* 7 */
116 HP_TYPE_LONGSTRING200, /* 8 */
117 HP_TYPE_TEXT, /* 9 */
118 HP_TYPE_FLABEL, /* 10 */
119 HP_TYPE_FTN_STRING_SPEC, /* 11 */
120 HP_TYPE_MOD_STRING_SPEC, /* 12 */
121 HP_TYPE_PACKED_DECIMAL, /* 13 */
122 HP_TYPE_REAL_3000, /* 14 */
123 HP_TYPE_MOD_STRING_3000, /* 15 */
124 HP_TYPE_ANYPOINTER, /* 16 */
125 HP_TYPE_GLOBAL_ANYPOINTER, /* 17 */
126 HP_TYPE_LOCAL_ANYPOINTER, /* 18 */
127 HP_TYPE_COMPLEXS3000, /* 19 */
128 HP_TYPE_FTN_STRING_S300_COMPAT, /* 20 */
129 HP_TYPE_FTN_STRING_VAX_COMPAT, /* 21 */
130 HP_TYPE_BOOLEAN_S300_COMPAT, /* 22 */
131 HP_TYPE_BOOLEAN_VAX_COMPAT, /* 23 */
132 HP_TYPE_WIDE_CHAR, /* 24 */
133 HP_TYPE_LONG, /* 25 */
134 HP_TYPE_UNSIGNED_LONG, /* 26 */
135 HP_TYPE_DOUBLE, /* 27 */
136 HP_TYPE_TEMPLATE_ARG, /* 28 */
137 HP_TYPE_VOID /* 29 */
140 /* An immediate name and type table entry.
142 extension and immediate will always be one.
143 global will always be zero.
144 hp_type is the basic type this entry describes.
145 bitlength is the length in bits for the basic type. */
146 struct dnttp_immediate
148 unsigned int extension: 1;
149 unsigned int immediate: 1;
150 unsigned int global: 1;
151 unsigned int type: 5;
152 unsigned int bitlength: 24;
155 /* A nonimmediate name and type table entry.
157 extension will always be one.
158 immediate will always be zero.
159 if global is zero, this entry points into the LNTT
160 if global is one, this entry points into the GNTT
161 index is the index within the GNTT or LNTT for this entry. */
162 struct dnttp_nonimmediate
164 unsigned int extension: 1;
165 unsigned int immediate: 1;
166 unsigned int global: 1;
167 unsigned int index: 29;
170 /* A pointer to an entry in the GNTT and LNTT tables. It has two
171 forms depending on the type being described.
173 The immediate form is used for simple entries and is one
174 word.
176 The nonimmediate form is used for complex entries and contains
177 an index into the LNTT or GNTT which describes the entire type.
179 If a dnttpointer is -1, then it is a NIL entry. */
181 #define DNTTNIL (-1)
182 typedef union dnttpointer
184 struct dnttp_immediate dntti;
185 struct dnttp_nonimmediate dnttp;
186 int word;
187 } dnttpointer;
189 /* An index into the source line table. As with dnttpointers, a sltpointer
190 of -1 indicates a NIL entry. */
191 #define SLTNIL (-1)
192 typedef int sltpointer;
194 /* Index into DOC (= "Debugging Optimized Code") line table */
195 #define LTNIL (-1)
196 typedef int ltpointer;
198 /* Index into context table */
199 #define CTXTNIL (-1)
200 typedef int ctxtpointer;
202 /* Unsigned byte offset into the VT. */
203 typedef unsigned int vtpointer;
205 /* A DNTT entry (used within the GNTT and LNTT).
207 DNTT entries are variable sized objects, but are always a multiple
208 of 3 words (we call each group of 3 words a "block").
210 The first bit in each block is an extension bit. This bit is zero
211 for the first block of a DNTT entry. If the entry requires more
212 than one block, then this bit is set to one in all blocks after
213 the first one. */
215 /* Each DNTT entry describes a particular debug symbol (beginning of
216 a source file, a function, variables, structures, etc.
218 The type of the DNTT entry is stored in the "kind" field within the
219 DNTT entry itself. */
221 enum dntt_entry_type
223 DNTT_TYPE_NIL = -1,
224 DNTT_TYPE_SRCFILE,
225 DNTT_TYPE_MODULE,
226 DNTT_TYPE_FUNCTION,
227 DNTT_TYPE_ENTRY,
228 DNTT_TYPE_BEGIN,
229 DNTT_TYPE_END,
230 DNTT_TYPE_IMPORT,
231 DNTT_TYPE_LABEL,
232 DNTT_TYPE_FPARAM,
233 DNTT_TYPE_SVAR,
234 DNTT_TYPE_DVAR,
235 DNTT_TYPE_HOLE1,
236 DNTT_TYPE_CONST,
237 DNTT_TYPE_TYPEDEF,
238 DNTT_TYPE_TAGDEF,
239 DNTT_TYPE_POINTER,
240 DNTT_TYPE_ENUM,
241 DNTT_TYPE_MEMENUM,
242 DNTT_TYPE_SET,
243 DNTT_TYPE_SUBRANGE,
244 DNTT_TYPE_ARRAY,
245 DNTT_TYPE_STRUCT,
246 DNTT_TYPE_UNION,
247 DNTT_TYPE_FIELD,
248 DNTT_TYPE_VARIANT,
249 DNTT_TYPE_FILE,
250 DNTT_TYPE_FUNCTYPE,
251 DNTT_TYPE_WITH,
252 DNTT_TYPE_COMMON,
253 DNTT_TYPE_COBSTRUCT,
254 DNTT_TYPE_XREF,
255 DNTT_TYPE_SA,
256 DNTT_TYPE_MACRO,
257 DNTT_TYPE_BLOCKDATA,
258 DNTT_TYPE_CLASS_SCOPE,
259 DNTT_TYPE_REFERENCE,
260 DNTT_TYPE_PTRMEM,
261 DNTT_TYPE_PTRMEMFUNC,
262 DNTT_TYPE_CLASS,
263 DNTT_TYPE_GENFIELD,
264 DNTT_TYPE_VFUNC,
265 DNTT_TYPE_MEMACCESS,
266 DNTT_TYPE_INHERITANCE,
267 DNTT_TYPE_FRIEND_CLASS,
268 DNTT_TYPE_FRIEND_FUNC,
269 DNTT_TYPE_MODIFIER,
270 DNTT_TYPE_OBJECT_ID,
271 DNTT_TYPE_MEMFUNC,
272 DNTT_TYPE_TEMPLATE,
273 DNTT_TYPE_TEMPLATE_ARG,
274 DNTT_TYPE_FUNC_TEMPLATE,
275 DNTT_TYPE_LINK,
276 DNTT_TYPE_DYN_ARRAY_DESC,
277 DNTT_TYPE_DESC_SUBRANGE,
278 DNTT_TYPE_BEGIN_EXT,
279 DNTT_TYPE_INLN,
280 DNTT_TYPE_INLN_LIST,
281 DNTT_TYPE_ALIAS,
282 DNTT_TYPE_DOC_FUNCTION,
283 DNTT_TYPE_DOC_MEMFUNC,
284 DNTT_TYPE_MAX
287 /* DNTT_TYPE_SRCFILE:
289 One DNTT_TYPE_SRCFILE symbol is output for the start of each source
290 file and at the begin and end of an included file. A DNTT_TYPE_SRCFILE
291 entry is also output before each DNTT_TYPE_FUNC symbol so that debuggers
292 can determine what file a function was defined in.
294 LANGUAGE describes the source file's language.
296 NAME points to an VT entry providing the source file's name.
298 Note the name used for DNTT_TYPE_SRCFILE entries are exactly as seen
299 by the compiler (ie they may be relative or absolute). C include files
300 via <> inclusion must use absolute paths.
302 ADDRESS points to an SLT entry from which line number and code locations
303 may be determined. */
305 struct dntt_type_srcfile
307 unsigned int extension: 1;
308 unsigned int kind: 10; /* DNTT_TYPE_SRCFILE */
309 unsigned int language: 4;
310 unsigned int unused: 17;
311 vtpointer name;
312 sltpointer address;
315 /* DNTT_TYPE_MODULE:
317 A DNTT_TYPE_MODULE symbol is emitted for the start of a pascal
318 module or C source file. A module indicates a compilation unit
319 for name-scoping purposes; in that regard there should be
320 a 1-1 correspondence between GDB "symtab"'s and MODULE symbol records.
322 Each DNTT_TYPE_MODULE must have an associated DNTT_TYPE_END symbol.
324 NAME points to a VT entry providing the module's name. Note C
325 source files are considered nameless modules.
327 ALIAS point to a VT entry providing a secondary name.
329 ADDRESS points to an SLT entry from which line number and code locations
330 may be determined. */
332 struct dntt_type_module
334 unsigned int extension: 1;
335 unsigned int kind: 10; /* DNTT_TYPE_MODULE */
336 unsigned int unused: 21;
337 vtpointer name;
338 vtpointer alias;
339 dnttpointer unused2;
340 sltpointer address;
343 /* DNTT_TYPE_FUNCTION,
344 DNTT_TYPE_ENTRY,
345 DNTT_TYPE_BLOCKDATA,
346 DNTT_TYPE_MEMFUNC:
348 A DNTT_TYPE_FUNCTION symbol is emitted for each function definition;
349 a DNTT_TYPE_ENTRY symbols is used for secondary entry points. Both
350 symbols used the dntt_type_function structure.
351 A DNTT_TYPE_BLOCKDATA symbol is emitted ...?
352 A DNTT_TYPE_MEMFUNC symbol is emitted for inlined member functions (C++).
354 Each of DNTT_TYPE_FUNCTION must have a matching DNTT_TYPE_END.
356 GLOBAL is nonzero if the function has global scope.
358 LANGUAGE describes the function's source language.
360 OPT_LEVEL describes the optimization level the function was compiled
361 with.
363 VARARGS is nonzero if the function uses varargs.
365 NAME points to a VT entry providing the function's name.
367 ALIAS points to a VT entry providing a secondary name for the function.
369 FIRSTPARAM points to a LNTT entry which describes the parameter list.
371 ADDRESS points to an SLT entry from which line number and code locations
372 may be determined.
374 ENTRYADDR is the memory address corresponding the the function's entry point
376 RETVAL points to a LNTT entry describing the function's return value.
378 LOWADDR is the lowest memory address associated with this function.
380 HIADDR is the highest memory address associated with this function. */
382 struct dntt_type_function
384 unsigned int extension: 1;
385 unsigned int kind: 10; /* DNTT_TYPE_FUNCTION,
386 DNTT_TYPE_ENTRY,
387 DNTT_TYPE_BLOCKDATA
388 or DNTT_TYPE_MEMFUNC */
389 unsigned int global: 1;
390 unsigned int language: 4;
391 unsigned int nest_level: 5;
392 unsigned int opt_level: 2;
393 unsigned int varargs: 1;
394 unsigned int lang_info: 4;
395 unsigned int inlined: 1;
396 unsigned int localalloc: 1;
397 unsigned int expansion: 1;
398 unsigned int unused: 1;
399 vtpointer name;
400 vtpointer alias;
401 dnttpointer firstparam;
402 sltpointer address;
403 CORE_ADDR entryaddr;
404 dnttpointer retval;
405 CORE_ADDR lowaddr;
406 CORE_ADDR hiaddr;
409 /* DNTT_TYPE_BEGIN:
411 A DNTT_TYPE_BEGIN symbol is emitted to begin a new nested scope.
412 Every DNTT_TYPE_BEGIN symbol must have a matching DNTT_TYPE_END symbol.
414 CLASSFLAG is nonzero if this is the beginning of a c++ class definition.
416 ADDRESS points to an SLT entry from which line number and code locations
417 may be determined. */
419 struct dntt_type_begin
421 unsigned int extension: 1;
422 unsigned int kind: 10;
423 unsigned int classflag: 1;
424 unsigned int unused: 20;
425 sltpointer address;
428 /* DNTT_TYPE_END:
430 A DNTT_TYPE_END symbol is emitted when closing a scope started by
431 a DNTT_TYPE_MODULE, DNTT_TYPE_FUNCTION, DNTT_TYPE_WITH,
432 DNTT_TYPE_COMMON, DNTT_TYPE_BEGIN, and DNTT_TYPE_CLASS_SCOPE symbols.
434 ENDKIND describes what type of scope the DNTT_TYPE_END is closing
435 (one of the above 6 kinds).
437 CLASSFLAG is nonzero if this is the end of a c++ class definition.
439 ADDRESS points to an SLT entry from which line number and code locations
440 may be determined.
442 BEGINSCOPE points to the LNTT entry which opened the scope. */
444 struct dntt_type_end
446 unsigned int extension: 1;
447 unsigned int kind: 10;
448 unsigned int endkind: 10;
449 unsigned int classflag: 1;
450 unsigned int unused: 10;
451 sltpointer address;
452 dnttpointer beginscope;
455 /* DNTT_TYPE_IMPORT is unused by GDB. */
456 /* DNTT_TYPE_LABEL is unused by GDB. */
458 /* DNTT_TYPE_FPARAM:
460 A DNTT_TYPE_FPARAM symbol is emitted for a function argument. When
461 chained together the symbols represent an argument list for a function.
463 REGPARAM is nonzero if this parameter was passed in a register.
465 INDIRECT is nonzero if this parameter is a pointer to the parameter
466 (pass by reference or pass by value for large items).
468 LONGADDR is nonzero if the parameter is a 64bit pointer.
470 NAME is a pointer into the VT for the parameter's name.
472 LOCATION describes where the parameter is stored. Depending on the
473 parameter type LOCATION could be a register number, or an offset
474 from the stack pointer.
476 TYPE points to a NTT entry describing the type of this parameter.
478 NEXTPARAM points to the LNTT entry describing the next parameter. */
480 struct dntt_type_fparam
482 unsigned int extension: 1;
483 unsigned int kind: 10;
484 unsigned int regparam: 1;
485 unsigned int indirect: 1;
486 unsigned int longaddr: 1;
487 unsigned int copyparam: 1;
488 unsigned int dflt: 1;
489 unsigned int doc_ranges: 1;
490 unsigned int misc_kind: 1;
491 unsigned int unused: 14;
492 vtpointer name;
493 CORE_ADDR location;
494 dnttpointer type;
495 dnttpointer nextparam;
496 int misc;
499 /* DNTT_TYPE_SVAR:
501 A DNTT_TYPE_SVAR is emitted to describe a variable in static storage.
503 GLOBAL is nonzero if the variable has global scope.
505 INDIRECT is nonzero if the variable is a pointer to an object.
507 LONGADDR is nonzero if the variable is in long pointer space.
509 STATICMEM is nonzero if the variable is a member of a class.
511 A_UNION is nonzero if the variable is an anonymous union member.
513 NAME is a pointer into the VT for the variable's name.
515 LOCATION provides the memory address for the variable.
517 TYPE is a pointer into either the GNTT or LNTT which describes
518 the type of this variable. */
520 struct dntt_type_svar
522 unsigned int extension: 1;
523 unsigned int kind: 10;
524 unsigned int global: 1;
525 unsigned int indirect: 1;
526 unsigned int longaddr: 1;
527 unsigned int staticmem: 1;
528 unsigned int a_union: 1;
529 unsigned int unused1: 1;
530 unsigned int thread_specific: 1;
531 unsigned int unused2: 14;
532 vtpointer name;
533 CORE_ADDR location;
534 dnttpointer type;
535 unsigned int offset;
536 unsigned int displacement;
539 /* DNTT_TYPE_DVAR:
541 A DNTT_TYPE_DVAR is emitted to describe automatic variables and variables
542 held in registers.
544 GLOBAL is nonzero if the variable has global scope.
546 INDIRECT is nonzero if the variable is a pointer to an object.
548 REGVAR is nonzero if the variable is in a register.
550 A_UNION is nonzero if the variable is an anonymous union member.
552 NAME is a pointer into the VT for the variable's name.
554 LOCATION provides the memory address or register number for the variable.
556 TYPE is a pointer into either the GNTT or LNTT which describes
557 the type of this variable. */
559 struct dntt_type_dvar
561 unsigned int extension: 1;
562 unsigned int kind: 10;
563 unsigned int global: 1;
564 unsigned int indirect: 1;
565 unsigned int regvar: 1;
566 unsigned int a_union: 1;
567 unsigned int unused: 17;
568 vtpointer name;
569 int location;
570 dnttpointer type;
571 unsigned int offset;
574 /* DNTT_TYPE_CONST:
576 A DNTT_TYPE_CONST symbol is emitted for program constants.
578 GLOBAL is nonzero if the constant has global scope.
580 INDIRECT is nonzero if the constant is a pointer to an object.
582 LOCATION_TYPE describes where to find the constant's value
583 (in the VT, memory, or embedded in an instruction).
585 CLASSMEM is nonzero if the constant is a member of a class.
587 NAME is a pointer into the VT for the constant's name.
589 LOCATION provides the memory address, register number or pointer
590 into the VT for the constant's value.
592 TYPE is a pointer into either the GNTT or LNTT which describes
593 the type of this variable. */
595 struct dntt_type_const
597 unsigned int extension: 1;
598 unsigned int kind: 10;
599 unsigned int global: 1;
600 unsigned int indirect: 1;
601 unsigned int location_type: 3;
602 unsigned int classmem: 1;
603 unsigned int unused: 15;
604 vtpointer name;
605 CORE_ADDR location;
606 dnttpointer type;
607 unsigned int offset;
608 unsigned int displacement;
611 /* DNTT_TYPE_TYPEDEF and DNTT_TYPE_TAGDEF:
613 The same structure is used to describe typedefs and tagdefs.
615 DNTT_TYPE_TYPEDEFS are associated with C "typedefs".
617 DNTT_TYPE_TAGDEFs are associated with C "struct", "union", and "enum"
618 tags, which may have the same name as a typedef in the same scope.
619 Also they are associated with C++ "class" tags, which implicitly have
620 the same name as the class type.
622 GLOBAL is nonzero if the typedef/tagdef has global scope.
624 TYPEINFO is used to determine if full type information is available
625 for a tag. (usually 1, but can be zero for opaque types in C).
627 NAME is a pointer into the VT for the constant's name.
629 TYPE points to the underlying type for the typedef/tagdef in the
630 GNTT or LNTT. */
632 struct dntt_type_type
634 unsigned int extension: 1;
635 unsigned int kind: 10; /* DNTT_TYPE_TYPEDEF or
636 DNTT_TYPE_TAGDEF
638 unsigned int global: 1;
639 unsigned int typeinfo: 1;
640 unsigned int unused: 19;
641 vtpointer name;
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.
650 /* DNTT_TYPE_POINTER:
652 Used to describe a pointer to an underlying type.
654 POINTSTO is a pointer into the GNTT or LNTT for the type which this
655 pointer points to.
657 BITLENGTH is the length of the pointer (not the underlying type). */
659 struct dntt_type_pointer
661 unsigned int extension: 1;
662 unsigned int kind: 10;
663 unsigned int unused: 21;
664 dnttpointer pointsto;
665 unsigned int bitlength;
669 /* DNTT_TYPE_ENUM:
671 Used to describe enumerated types.
673 FIRSTMEM is a pointer to a DNTT_TYPE_MEMENUM in the GNTT/LNTT which
674 describes the first member (and contains a pointer to the chain of
675 members).
677 BITLENGTH is the number of bits used to hold the values of the enum's
678 members. */
680 struct dntt_type_enum
682 unsigned int extension: 1;
683 unsigned int kind: 10;
684 unsigned int unused: 21;
685 dnttpointer firstmem;
686 unsigned int bitlength;
689 /* DNTT_TYPE_MEMENUM
691 Used to describe members of an enumerated type.
693 CLASSMEM is nonzero if this member is part of a class.
695 NAME points into the VT for the name of this member.
697 VALUE is the value of this enumeration member.
699 NEXTMEM points to the next DNTT_TYPE_MEMENUM in the chain. */
701 struct dntt_type_memenum
703 unsigned int extension: 1;
704 unsigned int kind: 10;
705 unsigned int classmem: 1;
706 unsigned int unused: 20;
707 vtpointer name;
708 unsigned int value;
709 dnttpointer nextmem;
712 /* DNTT_TYPE_SET
714 Used to describe PASCAL "set" type.
716 DECLARATION describes the bitpacking of the set.
718 SUBTYPE points to a DNTT entry describing the type of the members.
720 BITLENGTH is the size of the set. */
722 struct dntt_type_set
724 unsigned int extension: 1;
725 unsigned int kind: 10;
726 unsigned int declaration: 2;
727 unsigned int unused: 19;
728 dnttpointer subtype;
729 unsigned int bitlength;
732 /* DNTT_TYPE_SUBRANGE
734 Used to describe subrange type.
736 DYN_LOW describes the lower bound of the subrange:
738 00 for a constant lower bound (found in LOWBOUND).
740 01 for a dynamic lower bound with the lower bound found in the the
741 memory address pointed to by LOWBOUND.
743 10 for a dynamic lower bound described by an variable found in the
744 DNTT/LNTT (LOWBOUND would be a pointer into the DNTT/LNTT).
746 DYN_HIGH is similar to DYN_LOW, except it describes the upper bound.
748 SUBTYPE points to the type of the subrange.
750 BITLENGTH is the length in bits needed to describe the subrange's
751 values. */
753 struct dntt_type_subrange
755 unsigned int extension: 1;
756 unsigned int kind: 10;
757 unsigned int dyn_low: 2;
758 unsigned int dyn_high: 2;
759 unsigned int unused: 17;
760 int lowbound;
761 int highbound;
762 dnttpointer subtype;
763 unsigned int bitlength;
766 /* DNTT_TYPE_ARRAY
768 Used to describe an array type.
770 DECLARATION describes the bit packing used in the array.
772 ARRAYISBYTES is nonzero if the field in arraylength describes the
773 length in bytes rather than in bits. A value of zero is used to
774 describe an array with size 2**32.
776 ELEMISBYTES is nonzero if the length if each element in the array
777 is describes in bytes rather than bits. A value of zero is used
778 to an element with size 2**32.
780 ELEMORDER is nonzero if the elements are indexed in increasing order.
782 JUSTIFIED if the elements are left justified to index zero.
784 ARRAYLENGTH is the length of the array.
786 INDEXTYPE is a DNTT pointer to the type used to index the array.
788 ELEMTYPE is a DNTT pointer to the type for the array elements.
790 ELEMLENGTH is the length of each element in the array (including
791 any padding).
793 Multi-dimensional arrays are represented by ELEMTYPE pointing to
794 another DNTT_TYPE_ARRAY. */
796 struct dntt_type_array
798 unsigned int extension: 1;
799 unsigned int kind: 10;
800 unsigned int declaration: 2;
801 unsigned int dyn_low: 2;
802 unsigned int dyn_high: 2;
803 unsigned int arrayisbytes: 1;
804 unsigned int elemisbytes: 1;
805 unsigned int elemorder: 1;
806 unsigned int justified: 1;
807 unsigned int unused: 11;
808 unsigned int arraylength;
809 dnttpointer indextype;
810 dnttpointer elemtype;
811 unsigned int elemlength;
814 /* DNTT_TYPE_STRUCT
816 DNTT_TYPE_STRUCT is used to describe a C structure.
818 DECLARATION describes the bitpacking used.
820 FIRSTFIELD is a DNTT pointer to the first field of the structure
821 (each field contains a pointer to the next field, walk the list
822 to access all fields of the structure).
824 VARTAGFIELD and VARLIST are used for Pascal variant records.
826 BITLENGTH is the size of the structure in bits. */
828 struct dntt_type_struct
830 unsigned int extension: 1;
831 unsigned int kind: 10;
832 unsigned int declaration: 2;
833 unsigned int unused: 19;
834 dnttpointer firstfield;
835 dnttpointer vartagfield;
836 dnttpointer varlist;
837 unsigned int bitlength;
840 /* DNTT_TYPE_UNION
842 DNTT_TYPE_UNION is used to describe a C union.
844 FIRSTFIELD is a DNTT pointer to the beginning of the field chain.
846 BITLENGTH is the size of the union in bits. */
848 struct dntt_type_union
850 unsigned int extension: 1;
851 unsigned int kind: 10;
852 unsigned int unused: 21;
853 dnttpointer firstfield;
854 unsigned int bitlength;
857 /* DNTT_TYPE_FIELD
859 DNTT_TYPE_FIELD describes one field in a structure or union
860 or C++ class.
862 VISIBILITY is used to describe the visibility of the field
863 (for c++. public = 0, protected = 1, private = 2).
865 A_UNION is nonzero if this field is a member of an anonymous union.
867 STATICMEM is nonzero if this field is a static member of a template.
869 NAME is a pointer into the VT for the name of the field.
871 BITOFFSET gives the offset of this field in bits from the beginning
872 of the structure or union this field is a member of.
874 TYPE is a DNTT pointer to the type describing this field.
876 BITLENGTH is the size of the entry in bits.
878 NEXTFIELD is a DNTT pointer to the next field in the chain. */
880 struct dntt_type_field
882 unsigned int extension: 1;
883 unsigned int kind: 10;
884 unsigned int visibility: 2;
885 unsigned int a_union: 1;
886 unsigned int staticmem: 1;
887 unsigned int unused: 17;
888 vtpointer name;
889 unsigned int bitoffset;
890 dnttpointer type;
891 unsigned int bitlength;
892 dnttpointer nextfield;
895 /* DNTT_TYPE_VARIANT is unused by GDB. */
896 /* DNTT_TYPE_FILE is unused by GDB. */
898 /* DNTT_TYPE_FUNCTYPE
900 I think this is used to describe a function type (e.g., would
901 be emitted as part of a function-pointer description).
903 VARARGS is nonzero if this function uses varargs.
905 FIRSTPARAM is a DNTT pointer to the first entry in the parameter
906 chain.
908 RETVAL is a DNTT pointer to the type of the return value. */
910 struct dntt_type_functype
912 unsigned int extension: 1;
913 unsigned int kind: 10;
914 unsigned int varargs: 1;
915 unsigned int info: 4;
916 unsigned int unused: 16;
917 unsigned int bitlength;
918 dnttpointer firstparam;
919 dnttpointer retval;
922 /* DNTT_TYPE_WITH is emitted by C++ to indicate "with" scoping semantics.
923 (Probably also emitted by PASCAL to support "with"...).
925 C++ example: Say "memfunc" is a method of class "c", and say
926 "m" is a data member of class "c". Then from within "memfunc",
927 it is legal to reference "m" directly (e.g. you don't have to
928 say "this->m". The symbol table indicates
929 this by emitting a DNTT_TYPE_WITH symbol within the function "memfunc",
930 pointing to the type symbol for class "c".
932 In GDB, this symbol record is unnecessary,
933 because GDB's symbol lookup algorithm
934 infers the "with" semantics when it sees a "this" argument to the member
935 function. So GDB can safely ignore the DNTT_TYPE_WITH record.
937 A DNTT_TYPE_WITH has a matching DNTT_TYPE_END symbol
940 struct dntt_type_with {
941 unsigned int extension: 1; /* always zero */
942 unsigned int kind: 10; /* always DNTT_TYPE_WITH */
943 unsigned int addrtype: 2; /* 0 => STATTYPE */
944 /* 1 => DYNTYPE */
945 /* 2 => REGTYPE */
946 unsigned int indirect: 1; /* 1 => pointer to object */
947 unsigned int longaddr: 1; /* 1 => in long pointer space */
948 unsigned int nestlevel: 6; /* # of nesting levels back */
949 unsigned int doc_ranges: 1; /* 1 => location is range list */
950 unsigned int unused: 10;
951 long location; /* where stored (allocated) */
952 sltpointer address;
953 dnttpointer type; /* type of with expression */
954 vtpointer name; /* name of with expression */
955 unsigned long offset; /* byte offset from location */
958 /* DNTT_TYPE_COMMON is unsupported by GDB. */
959 /* A DNTT_TYPE_COMMON symbol must have a matching DNTT_TYPE_END symbol */
961 /* DNTT_TYPE_COBSTRUCT is unsupported by GDB. */
962 /* DNTT_TYPE_XREF is unsupported by GDB. */
963 /* DNTT_TYPE_SA is unsupported by GDB. */
964 /* DNTT_TYPE_MACRO is unsupported by GDB */
966 /* DNTT_TYPE_BLOCKDATA has the same structure as DNTT_TYPE_FUNCTION */
968 /* The following are the C++ specific SOM records */
970 /* The purpose of the DNTT_TYPE_CLASS_SCOPE is to bracket C++ methods
971 and indicate the method name belongs in the "class scope" rather
972 than in the module they are being defined in. For example:
974 class c {
976 void memfunc(); // member function
979 void c::memfunc() // definition of class c's "memfunc"
984 main()
989 In the above, the name "memfunc" is not directly visible from "main".
990 I.e., you have to say "break c::memfunc".
991 If it were a normal function (not a method), it would be visible
992 via the simple "break memfunc". Since "memfunc" otherwise looks
993 like a normal FUNCTION in the symbol table, the bracketing
994 CLASS_SCOPE is what is used to indicate it is really a method.
997 A DNTT_TYPE_CLASS_SCOPE symbol must have a matching DNTT_TYPE_END symbol
1000 struct dntt_type_class_scope {
1001 unsigned int extension: 1; /* always zero */
1002 unsigned int kind: 10; /* always DNTT_TYPE_CLASS_SCOPE */
1003 unsigned int unused: 21;
1004 sltpointer address ; /* pointer to SLT entry */
1005 dnttpointer type ; /* pointer to class type DNTT */
1008 /* C++ reference parameter.
1009 The structure of this record is the same as DNTT_TYPE_POINTER -
1010 refer to struct dntt_type_pointer.
1013 /* The next two describe C++ pointer-to-data-member type, and
1014 pointer-to-member-function type, respectively.
1015 DNTT_TYPE_PTRMEM and DNTT_TYPE_PTRMEMFUNC have the same structure
1018 struct dntt_type_ptrmem {
1019 unsigned int extension: 1; /* always zero */
1020 unsigned int kind: 10; /* always DNTT_TYPE_PTRMEM */
1021 unsigned int unused: 21;
1022 dnttpointer pointsto ; /* pointer to class DNTT */
1023 dnttpointer memtype ; /* type of member */
1026 struct dntt_type_ptrmemfunc {
1027 unsigned int extension: 1; /* always zero */
1028 unsigned int kind: 10; /* always DNTT_TYPE_PTRMEMFUNC */
1029 unsigned int unused: 21;
1030 dnttpointer pointsto ; /* pointer to class DNTT */
1031 dnttpointer memtype ; /* type of member */
1034 /* The DNTT_TYPE_CLASS symbol is emitted to describe a class type.
1035 * "memberlist" points to a chained list of FIELD or GENFIELD records
1036 * indicating the class members. "parentlist" points to a chained list
1037 * of INHERITANCE records indicating classes from which we inherit
1038 * fields.
1041 struct dntt_type_class
1043 unsigned int extension: 1; /* always 0 */
1044 unsigned int kind: 10; /* always DNTT_TYPE_CLASS */
1045 unsigned int abstract: 1; /* is this an abstract class? */
1046 unsigned int class_decl: 2; /* 0=class,1=union,2=struct */
1047 unsigned int expansion: 1; /* 1=template expansion */
1048 unsigned int unused: 17;
1049 dnttpointer memberlist ; /* ptr to chain of [GEN]FIELDs */
1050 unsigned long vtbl_loc ; /* offset in obj of ptr to vtbl */
1051 dnttpointer parentlist ; /* ptr to K_INHERITANCE list */
1052 unsigned long bitlength ; /* total at this level */
1053 dnttpointer identlist ; /* ptr to chain of class ident's */
1054 dnttpointer friendlist ; /* ptr to K_FRIEND list */
1055 dnttpointer templateptr ; /* ptr to template */
1056 dnttpointer nextexp ; /* ptr to next expansion */
1059 /* Class members are indicated via either the FIELD record (for
1060 data members, same as for C struct fields), or by the GENFIELD record
1061 (for member functions).
1064 struct dntt_type_genfield {
1065 unsigned int extension: 1; /* always zero */
1066 unsigned int kind: 10; /* always DNTT_TYPE_GENFIELD */
1067 unsigned int visibility: 2; /* pub = 0, prot = 1, priv = 2 */
1068 unsigned int a_union: 1; /* 1 => anonymous union member */
1069 unsigned int unused: 18;
1070 dnttpointer field ; /* pointer to field or qualifier */
1071 dnttpointer nextfield ; /* pointer to next field */
1074 /* C++ virtual functions */
1076 struct dntt_type_vfunc {
1077 unsigned int extension: 1; /* always zero */
1078 unsigned int kind: 10; /* always DNTT_TYPE_VFUNC */
1079 unsigned int pure: 1; /* pure virtual function ? */
1080 unsigned int unused: 20;
1081 dnttpointer funcptr ; /* points to FUNCTION symbol */
1082 unsigned long vtbl_offset ; /* offset into vtbl for virtual */
1085 /* Not precisely sure what this is intended for - DDE ignores it */
1087 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
1098 * inherit members.
1101 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 {
1116 unsigned int extension: 1; /* always zero */
1117 unsigned int kind: 10; /* always DNTT_TYPE_FRIEND_CLASS */
1118 unsigned int unused: 21;
1119 dnttpointer classptr ; /* pointer to class DNTT */
1120 dnttpointer next ; /* next DNTT_FRIEND */
1123 struct dntt_type_friend_func {
1124 unsigned int extension: 1; /* always zero */
1125 unsigned int kind: 10; /* always DNTT_TYPE_FRIEND_FUNC */
1126 unsigned int unused: 21;
1127 dnttpointer funcptr ; /* pointer to function */
1128 dnttpointer classptr ; /* pointer to class DNTT */
1129 dnttpointer next ; /* next DNTT_FRIEND */
1130 unsigned long future[2] ; /* padding to 3-word block end */
1133 /* DDE appears to ignore the DNTT_TYPE_MODIFIER record.
1134 * It could perhaps be used to give better "ptype" output in GDB;
1135 * otherwise it is probably safe for GDB to ignore it also.
1138 struct dntt_type_modifier {
1139 unsigned int extension: 1; /* always zero */
1140 unsigned int kind: 10; /* always DNTT_TYPE_MODIFIER */
1141 unsigned int m_const: 1; /* const */
1142 unsigned int m_static: 1; /* static */
1143 unsigned int m_void: 1; /* void */
1144 unsigned int m_volatile: 1; /* volatile */
1145 unsigned int m_duplicate: 1; /* duplicate */
1146 unsigned int unused: 16;
1147 dnttpointer type ; /* subtype */
1148 unsigned long future ; /* padding to 3-word block end */
1151 /* I'm not sure what this was intended for - DDE ignores it */
1153 struct dntt_type_object_id {
1154 unsigned int extension: 1; /* always zero */
1155 unsigned int kind: 10; /* always DNTT_TYPE_OBJECT_ID */
1156 unsigned int indirect: 1; /* Is object_ident addr of addr? */
1157 unsigned int unused: 20;
1158 unsigned long object_ident ; /* object identifier */
1159 unsigned long offset ; /* offset to start of base class */
1160 dnttpointer next ; /* pointer to next K_OBJECT_ID */
1161 unsigned long segoffset ; /* for linker fixup */
1162 unsigned long future ; /* padding to 3-word block end */
1165 /* No separate dntt_type_memfunc; same as dntt_type_func */
1167 /* Symbol records to support templates. These only get used
1168 * in DDE's "describe" output (like GDB's "ptype").
1171 /* The TEMPLATE record is the header for a template-class.
1172 * Like the CLASS record, a TEMPLATE record has a memberlist that
1173 * points to a list of template members. It also has an arglist
1174 * pointing to a list of TEMPLATE_ARG records.
1177 struct dntt_type_template {
1178 unsigned int extension: 1; /* always zero */
1179 unsigned int kind: 10; /* always DNTT_TYPE_TEMPLATE */
1180 unsigned int abstract: 1; /* is this an abstract class? */
1181 unsigned int class_decl: 2; /* 0=class,1=union,2=struct */
1182 unsigned int unused: 18;
1183 dnttpointer memberlist ; /* ptr to chain of K_[GEN]FIELDs */
1184 long unused2 ; /* offset in obj of ptr to vtbl */
1185 dnttpointer parentlist ; /* ptr to K_INHERITANCE list */
1186 unsigned long bitlength ; /* total at this level */
1187 dnttpointer identlist ; /* ptr to chain of class ident's */
1188 dnttpointer friendlist ; /* ptr to K_FRIEND list */
1189 dnttpointer arglist ; /* ptr to argument list */
1190 dnttpointer expansions ; /* ptr to expansion list */
1193 /* Template-class arguments are a list of TEMPL_ARG records
1194 * chained together. The "name" field is the name of the formal.
1195 * E.g.:
1196 * template <class T> class q { ... };
1197 * Then "T" is the name of the formal argument.
1199 struct dntt_type_templ_arg {
1200 unsigned int extension: 1; /* always zero */
1201 unsigned int kind: 10; /* always DNTT_TYPE_TEMPL_ARG */
1202 unsigned int usagetype: 1; /* 0 type-name 1 expression */
1203 unsigned int unused: 20;
1204 vtpointer name ; /* name of argument */
1205 dnttpointer type ; /* for non type arguments */
1206 dnttpointer nextarg ; /* Next argument if any */
1207 long future[2] ; /* padding to 3-word block end */
1210 /* FUNC_TEMPLATE records are sort of like FUNCTION, but are emitted
1211 * for template member functions. E.g.,
1212 * template <class T> class q {
1214 void f();
1215 ...
1217 * Within the list of FIELDs/GENFIELDs defining the member list
1218 * of the template "q", "f" would appear as a FUNC_TEMPLATE.
1219 * We'll also see instances of FUNCTION "f" records for each
1220 * instantiation of the template.
1223 struct dntt_type_func_template {
1224 unsigned int extension: 1; /* always zero */
1225 unsigned int kind: 10; /* always DNTT_TYPE_FUNC_TEMPLATE */
1226 unsigned int public: 1; /* 1 => globally visible */
1227 unsigned int language: 4; /* type of language */
1228 unsigned int level: 5; /* nesting level (top level = 0)*/
1229 unsigned int optimize: 2; /* level of optimization */
1230 unsigned int varargs: 1; /* ellipses. Pascal/800 later */
1231 unsigned int info: 4; /* lang-specific stuff; F_xxxx */
1232 unsigned int inlined: 1;
1233 unsigned int localloc: 1; /* 0 at top, 1 at end of block */
1234 unsigned int unused: 2;
1235 vtpointer name ; /* name of function */
1236 vtpointer alias ; /* alternate name, if any */
1237 dnttpointer firstparam ; /* first FPARAM, if any */
1238 dnttpointer retval ; /* return type, if any */
1239 dnttpointer arglist ; /* ptr to argument list */
1242 /* LINK is apparently intended to link together function template
1243 * definitions with their instantiations. However, it is not clear
1244 * why this would be needed, except to provide the information on
1245 * a "ptype" command. And as far as I can tell, aCC does not
1246 * generate this record.
1249 struct dntt_type_link {
1250 unsigned int extension: 1; /* always zero */
1251 unsigned int kind: 10; /* always DNTT_TYPE_LINK */
1252 unsigned int linkKind: 4; /* always LINK_UNKNOWN */
1253 unsigned int unused: 17;
1254 long future1 ; /* expansion */
1255 dnttpointer ptr1 ; /* link from template */
1256 dnttpointer ptr2 ; /* to expansion */
1257 long future[2] ; /* padding to 3-word block end */
1260 /* end of C++ specific SOM's */
1262 /* DNTT_TYPE_DYN_ARRAY_DESC is unused by GDB */
1263 /* DNTT_TYPE_DESC_SUBRANGE is unused by GDB */
1264 /* DNTT_TYPE_BEGIN_EXT is unused by GDB */
1265 /* DNTT_TYPE_INLN is unused by GDB */
1266 /* DNTT_TYPE_INLN_LIST is unused by GDB */
1267 /* DNTT_TYPE_ALIAS is unused by GDB */
1269 struct dntt_type_doc_function {
1270 unsigned int extension: 1; /* always zero */
1271 unsigned int kind: 10; /* K_DOC_FUNCTION or */
1272 /* K_DOC_MEMFUNC */
1273 unsigned int global: 1; /* 1 => globally visible */
1274 unsigned int language: 4; /* type of language */
1275 unsigned int level: 5; /* nesting level (top level = 0)*/
1276 unsigned int optimize: 2; /* level of optimization */
1277 unsigned int varargs: 1; /* ellipses. Pascal/800 later */
1278 unsigned int info: 4; /* lang-specific stuff; F_xxxx */
1279 unsigned int inlined: 1;
1280 unsigned int localloc: 1; /* 0 at top, 1 at end of block */
1281 unsigned int expansion: 1; /* 1 = function expansion */
1282 unsigned int doc_clone: 1;
1283 vtpointer name; /* name of function */
1284 vtpointer alias; /* alternate name, if any */
1285 dnttpointer firstparam; /* first FPARAM, if any */
1286 sltpointer address; /* code and text locations */
1287 CORE_ADDR entryaddr; /* address of entry point */
1288 dnttpointer retval; /* return type, if any */
1289 CORE_ADDR lowaddr; /* lowest address of function */
1290 CORE_ADDR hiaddr; /* highest address of function */
1291 dnttpointer inline_list; /* pointer to first inline */
1292 ltpointer lt_offset; /* start of frag/cp line table */
1293 ctxtpointer ctxt_offset; /* start of context table for this routine */
1296 /* DNTT_TYPE_DOC_MEMFUNC is unused by GDB */
1298 /* DNTT_TYPE_GENERIC and DNTT_TYPE_BLOCK are convience structures
1299 so we can examine a DNTT entry in a generic fashion. */
1300 struct dntt_type_generic
1302 unsigned int word[9];
1305 struct dntt_type_block
1307 unsigned int extension: 1;
1308 unsigned int kind: 10;
1309 unsigned int unused: 21;
1310 unsigned int word[2];
1313 /* One entry in a DNTT (either the LNTT or GNTT).
1314 * This is a union of the above 60 or so structure definitions.
1316 union dnttentry
1318 struct dntt_type_srcfile dsfile;
1319 struct dntt_type_module dmodule;
1320 struct dntt_type_function dfunc;
1321 struct dntt_type_function dentry;
1322 struct dntt_type_begin dbegin;
1323 struct dntt_type_end dend;
1324 struct dntt_type_fparam dfparam;
1325 struct dntt_type_svar dsvar;
1326 struct dntt_type_dvar ddvar;
1327 struct dntt_type_const dconst;
1328 struct dntt_type_type dtype;
1329 struct dntt_type_type dtag;
1330 struct dntt_type_pointer dptr;
1331 struct dntt_type_enum denum;
1332 struct dntt_type_memenum dmember;
1333 struct dntt_type_set dset;
1334 struct dntt_type_subrange dsubr;
1335 struct dntt_type_array darray;
1336 struct dntt_type_struct dstruct;
1337 struct dntt_type_union dunion;
1338 struct dntt_type_field dfield;
1339 struct dntt_type_functype dfunctype;
1340 struct dntt_type_with dwith;
1341 struct dntt_type_function dblockdata;
1342 struct dntt_type_class_scope dclass_scope;
1343 struct dntt_type_pointer dreference;
1344 struct dntt_type_ptrmem dptrmem;
1345 struct dntt_type_ptrmemfunc dptrmemfunc;
1346 struct dntt_type_class dclass;
1347 struct dntt_type_genfield dgenfield;
1348 struct dntt_type_vfunc dvfunc;
1349 struct dntt_type_memaccess dmemaccess;
1350 struct dntt_type_inheritance dinheritance;
1351 struct dntt_type_friend_class dfriend_class;
1352 struct dntt_type_friend_func dfriend_func;
1353 struct dntt_type_modifier dmodifier;
1354 struct dntt_type_object_id dobject_id;
1355 struct dntt_type_template dtemplate;
1356 struct dntt_type_templ_arg dtempl_arg;
1357 struct dntt_type_func_template dfunc_template;
1358 struct dntt_type_link dlink;
1359 struct dntt_type_doc_function ddocfunc;
1360 struct dntt_type_generic dgeneric;
1361 struct dntt_type_block dblock;
1364 /* Source line entry types. */
1365 enum slttype
1367 SLT_NORMAL,
1368 SLT_SRCFILE,
1369 SLT_MODULE,
1370 SLT_FUNCTION,
1371 SLT_ENTRY,
1372 SLT_BEGIN,
1373 SLT_END,
1374 SLT_WITH,
1375 SLT_EXIT,
1376 SLT_ASSIST,
1377 SLT_MARKER,
1378 SLT_CLASS_SCOPE,
1379 SLT_INLN,
1380 SLT_NORMAL_OFFSET,
1383 /* A normal source line entry. Simply provides a mapping of a source
1384 line number to a code address.
1386 SLTDESC will always be SLT_NORMAL or SLT_EXIT. */
1388 struct slt_normal
1390 unsigned int sltdesc: 4;
1391 unsigned int line: 28;
1392 CORE_ADDR address;
1395 struct slt_normal_off
1397 unsigned int sltdesc: 4;
1398 unsigned int offset: 6;
1399 unsigned int line: 22;
1400 CORE_ADDR address;
1403 /* A special source line entry. Provides a mapping of a declaration
1404 to a line number. These entries point back into the DNTT which
1405 references them. */
1407 struct slt_special
1409 unsigned int sltdesc: 4;
1410 unsigned int line: 28;
1411 dnttpointer backptr;
1414 /* Used to describe nesting.
1416 For nested languages, an slt_assist entry must follow each SLT_FUNC
1417 entry in the SLT. The address field will point forward to the
1418 first slt_normal entry within the function's scope. */
1420 struct slt_assist
1422 unsigned int sltdesc: 4;
1423 unsigned int unused: 28;
1424 sltpointer address;
1427 struct slt_generic
1429 unsigned int word[2];
1432 union sltentry
1434 struct slt_normal snorm;
1435 struct slt_normal_off snormoff;
1436 struct slt_special sspec;
1437 struct slt_assist sasst;
1438 struct slt_generic sgeneric;
1441 /* $LINES$ declarations
1442 * This is the line table used for optimized code, which is only present
1443 * in the new $PROGRAM_INFO$ debug space.
1446 #define DST_LN_ESCAPE_FLAG1 15
1447 #define DST_LN_ESCAPE_FLAG2 14
1448 #define DST_LN_CTX_SPEC1 13
1449 #define DST_LN_CTX_SPEC2 12
1452 Escape function codes:
1454 typedef enum
1456 dst_ln_pad, /* pad byte */
1457 dst_ln_escape_1, /* reserved */
1458 dst_ln_dpc1_dln1, /* 1 byte line delta, 1 byte pc delta */
1459 dst_ln_dpc2_dln2, /* 2 bytes line delta, 2 bytes pc delta */
1460 dst_ln_pc4_ln4, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */
1461 dst_ln_dpc0_dln1, /* 1 byte line delta, pc delta = 0 */
1462 dst_ln_ln_off_1, /* statement escape, stmt # = 1 (2nd stmt on line) */
1463 dst_ln_ln_off, /* statement escape, stmt # = next byte */
1464 dst_ln_entry, /* entry escape, next byte is entry number */
1465 dst_ln_exit, /* exit escape */
1466 dst_ln_stmt_end, /* gap escape, 4 bytes pc delta */
1467 dst_ln_stmt_cp, /* current stmt is a critical point */
1468 dst_ln_escape_12, /* reserved */
1469 dst_ln_escape_13, /* this is an exception site record */
1470 dst_ln_nxt_byte, /* next byte contains the real escape code */
1471 dst_ln_end, /* end escape, final entry follows */
1472 dst_ln_escape1_END_OF_ENUM
1474 dst_ln_escape1_t;
1476 typedef enum
1478 dst_ln_ctx_1, /* next byte describes context switch with 5-bit */
1479 /* index into the image table and 3-bit run length. */
1480 /* If run length is 0, end with another cxt specifier or ctx_end */
1481 dst_ln_ctx_2, /* next 2 bytes switch context: 13 bit index, 3 bit run length */
1482 dst_ln_ctx_4, /* next 4 bytes switch context: 29 bit index, 3 bit run length */
1483 dst_ln_ctx_end, /* end current context */
1484 dst_ln_col_run_1, /* next byte is column position of start of next statement, */
1485 /* following byte is length of statement */
1486 dst_ln_col_run_2, /* next 2 bytes is column position of start of next statement, */
1487 /* following 2 bytes is length of statement */
1488 dst_ln_init_base1, /* next 4 bytes are absolute PC, followed by 1 byte of line number */
1489 dst_ln_init_base2, /* next 4 bytes are absolute PC, followed by 2 bytes of line number */
1490 dst_ln_init_base3, /* next 4 bytes are absolute PC, followed by 3 bytes of line number */
1491 dst_ln_escape2_END_OF_ENUM
1493 dst_ln_escape2_t;
1495 typedef union
1497 struct
1499 unsigned int pc_delta : 4; /* 4 bit pc delta */
1500 int ln_delta : 4; /* 4 bit line number delta */
1502 delta;
1504 struct
1506 unsigned int esc_flag : 4; /* alias for pc_delta */
1507 unsigned int esc_code : 4; /* escape function code (dst_ln_escape1_t, or ...2_t */
1509 esc;
1511 struct
1513 unsigned int esc_flag : 4; /* dst_ln_ctx_spec1, or dst_ln_ctx_spec2 */
1514 unsigned int run_length : 2;
1515 unsigned int ctx_index : 2; /* ...spec2 contains index; ...spec1, index - 4 */
1517 ctx_spec;
1519 char sdata; /* signed data byte */
1520 unsigned char udata; /* unsigned data byte */
1522 dst_ln_entry_t,
1523 *dst_ln_entry_ptr_t;
1525 /* Warning: although the above union occupies only 1 byte the compiler treats
1526 * it as having size 2 (the minimum size of a struct). Therefore a sequence of
1527 * dst_ln_entry_t's cannot be described as an array, and walking through such a
1528 * sequence requires convoluted code such as
1529 * ln_ptr = (dst_ln_entry_ptr_t) (char*) ln_ptr + 1
1530 * We regret the inconvenience. */
1532 /* Structure for interpreting the byte following a dst_ln_ctx1 entry */
1533 typedef struct {
1534 unsigned int ctx1_index : 5; /* 5 bit index into context table */
1535 unsigned int ctx1_run_length : 3; /* 3 bit run length */
1536 } dst_ln_ctx1_t,
1537 *dst_ln_ctx1_ptr_t;
1539 /* Structure for interpreting the bytes following a dst_ln_ctx2 entry */
1540 typedef struct {
1541 unsigned int ctx2_index : 13; /* 13 bit index into context table */
1542 unsigned int ctx2_run_length : 3; /* 3 bit run length */
1543 } dst_ln_ctx2_t,
1544 *dst_ln_ctx2_ptr_t;
1546 /* Structure for interpreting the bytes following a dst_ln_ctx4 entry */
1547 typedef struct {
1548 unsigned int ctx4_index : 29; /* 29 bit index into context table */
1549 unsigned int ctx4_run_length : 3; /* 3 bit run length */
1550 } dst_ln_ctx4_t,
1551 *dst_ln_ctx4_ptr_t;
1554 /* PXDB definitions.
1556 * PXDB is a post-processor which takes the executable file
1557 * and massages the debug information so that the debugger may
1558 * start up and run more efficiently. Some of the tasks
1559 * performed by PXDB are:
1561 * o Remove duplicate global type and variable information
1562 * from the GNTT,
1564 * o Append the GNTT onto the end of the LNTT and place both
1565 * back in the LNTT section,
1567 * o Build quick look-up tables (description follows) for
1568 * files, procedures, modules, and paragraphs (for Cobol),
1569 * placing these in the GNTT section,
1571 * o Reconstruct the header appearing in the header section
1572 * to access this information.
1574 * The "quick look-up" tables are in the $GNTT$ sub-space, in
1575 * the following order:
1577 * Procedures -sorted by address
1578 * Source files -sorted by address (of the
1579 * generated code from routines)
1580 * Modules -sorted by address
1581 * Classes -<unsorted?>
1582 * Address Alias -sorted by index <?>
1583 * Object IDs -sorted by object identifier
1585 * Most quick entries have (0-based) indices into the LNTT tables to
1586 * the full entries for the item it describes.
1588 * The post-PXDB header is in the $HEADER$ sub-space. Alas, it
1589 * occurs in different forms, depending on the optimization level
1590 * in the compilation step and whether PXDB was run or not. The
1591 * worst part is the forms aren't self-describing, so we'll have
1592 * to grovel in the bits to figure out what kind we're looking at
1593 * (see hp_get_header in hp-psymtab-read.c).
1596 /* PXDB versions
1598 #define PXDB_VERSION_CPLUSPLUS 1
1599 #define PXDB_VERSION_7_4 2
1600 #define PXDB_VERSION_CPP_30 3
1601 #define PXDB_VERSION_DDE_3_2A 4
1602 #define PXDB_VERSION_DDE_3_2 5
1603 #define PXDB_VERSION_DDE_4_0 6
1605 #define PXDB_VERSION_2_1 1
1607 /* Header version for the case that there is no DOC info
1608 * but the executable has been processed by pxdb (the easy
1609 * case, from "cc -g").
1611 typedef struct PXDB_struct {
1612 int pd_entries; /* # of entries in function look-up table */
1613 int fd_entries; /* # of entries in file look-up table */
1614 int md_entries; /* # of entries in module look-up table */
1615 unsigned int pxdbed : 1; /* 1 => file has been preprocessed */
1616 unsigned int bighdr : 1; /* 1 => this header contains 'time' word */
1617 unsigned int sa_header : 1;/* 1 => created by SA version of pxdb */
1618 /* used for version check in xdb */
1619 unsigned int inlined: 1; /* one or more functions have been inlined */
1620 unsigned int spare:12;
1621 short version; /* pxdb header version */
1622 int globals; /* index into the DNTT where GNTT begins */
1623 unsigned int time; /* modify time of file before being pxdbed */
1624 int pg_entries; /* # of entries in label look-up table */
1625 int functions; /* actual number of functions */
1626 int files; /* actual number of files */
1627 int cd_entries; /* # of entries in class look-up table */
1628 int aa_entries; /* # of entries in addr alias look-up table */
1629 int oi_entries; /* # of entries in object id look-up table */
1630 } PXDB_header, *PXDB_header_ptr;
1632 /* Header version for the case that there is no DOC info and the
1633 * executable has NOT been processed by pxdb.
1635 typedef struct XDB_header_struct {
1636 long gntt_length;
1637 long lntt_length;
1638 long slt_length;
1639 long vt_length;
1640 long xt_length;
1641 } XDB_header;
1643 /* Header version for the case that there is DOC info and the
1644 * executable has been processed by pxdb.
1646 typedef struct DOC_info_PXDB_header_struct {
1647 unsigned int xdb_header: 1; /* bit set if this is post-3.1 xdb */
1648 unsigned int doc_header: 1; /* bit set if this is doc-style header*/
1649 unsigned int version: 8; /* version of pxdb see defines
1650 * PXDB_VERSION_* in this file */
1651 unsigned int reserved_for_flags: 16;/* for future use; -- must be
1652 * set to zero
1654 unsigned int has_aux_pd_table: 1; /* $GNTT$ has aux PD table */
1655 unsigned int has_expr_table: 1; /* space has $EXPR$ */
1656 unsigned int has_range_table: 1; /* space has $RANGE$ */
1657 unsigned int has_context_table: 1; /* space has $SRC_CTXT$ */
1658 unsigned int has_lines_table: 1; /* space contains a $LINES$
1659 * subspace for line tables.
1661 unsigned int has_lt_offset_map: 1; /* space contains an lt_offset
1662 * subspace for line table mapping
1664 /* the following fields are the same as those in the PXDB_header in $DEBUG$ */
1665 int pd_entries; /* # of entries in function look-up table */
1666 int fd_entries; /* # of entries in file look-up table */
1667 int md_entries; /* # of entries in module look-up table */
1668 unsigned int pxdbed : 1; /* 1 => file has been preprocessed */
1669 unsigned int bighdr : 1; /* 1 => this header contains 'time' word */
1670 unsigned int sa_header : 1;/* 1 => created by SA version of pxdb */
1671 /* used for version check in xdb */
1672 unsigned int inlined: 1; /* one or more functions have been inlined */
1673 unsigned int spare : 28;
1674 int globals; /* index into the DNTT where GNTT begins */
1675 unsigned int time; /* modify time of file before being pxdbed */
1676 int pg_entries; /* # of entries in label look-up table */
1677 int functions; /* actual number of functions */
1678 int files; /* actual number of files */
1679 int cd_entries; /* # of entries in class look-up table */
1680 int aa_entries; /* # of entries in addr alias look-up table */
1681 int oi_entries; /* # of entries in object id look-up table */
1682 } DOC_info_PXDB_header;
1684 /* Header version for the case that there is DOC info and the
1685 * executable has NOT been processed by pxdb.
1687 typedef struct DOC_info_header_struct {
1688 unsigned int xdb_header: 1; /* bit set if this is post-3.1 xdb */
1689 unsigned int doc_header: 1; /* bit set if this is doc-style header*/
1690 unsigned int version: 8; /* version of debug/header
1691 format. For 10.0 the value
1692 will be 1. For "Davis" the
1693 value is 2.
1695 unsigned int reserved_for_flags: 18; /* for future use; -- must be
1696 set to zero
1698 unsigned int has_range_table: 1; /* space contains a $RANGE$
1699 subspace for variable ranges.
1701 unsigned int has_context_table: 1; /* space contains a $CTXT$
1702 subspace for context/inline
1703 table.
1705 unsigned int has_lines_table: 1; /* space contains a $LINES$
1706 subspace for line tables.
1708 unsigned int has_lt_offset_map: 1; /* space contains an lt_offset
1709 subspace for line table mapping
1712 long gntt_length; /* same as old header */
1713 long lntt_length; /* same as old header */
1714 long slt_length; /* same as old header */
1715 long vt_length; /* same as old header */
1716 long xt_length; /* same as old header */
1717 long ctxt_length; /* present only if version >= 2 */
1718 long range_length; /* present only if version >= 2 */
1719 long expr_length; /* present only if version >= 2 */
1721 } DOC_info_header;
1723 typedef union GenericDebugHeader_union
1725 PXDB_header no_doc;
1726 DOC_info_PXDB_header doc;
1727 XDB_header no_pxdb_no_doc;
1728 DOC_info_header no_pxdb_doc;
1729 } GenericDebugHeader;
1732 /* Procedure Descriptor:
1734 * An element of the procedure quick look-up table
1736 typedef struct quick_procedure {
1737 long isym; /* 0-based index of first symbol*/
1738 /* for procedure in $LNTT$, */
1739 /* i.e. the procedure itself */
1740 CORE_ADDR adrStart; /* memory adr of start of proc */
1741 CORE_ADDR adrEnd; /* memory adr of end of proc */
1742 char *sbAlias; /* alias name of procedure */
1743 char *sbProc; /* real name of procedure */
1744 CORE_ADDR adrBp; /* address of entry breakpoint */
1745 CORE_ADDR adrExitBp; /* address of exit breakpoint */
1746 int icd; /* member of this class (index) */
1747 unsigned int ipd; /* index of template for this */
1748 /* function (index) */
1749 unsigned int unused: 5;
1750 unsigned int no_lt_offset: 1;/* no entry in lt_offset table */
1751 unsigned int fTemplate: 1; /* function template */
1752 unsigned int fExpansion: 1; /* function expansion */
1753 unsigned int linked : 1; /* linked with other expansions */
1754 unsigned int duplicate: 1; /* clone of another procedure */
1755 unsigned int overloaded:1; /* overloaded function */
1756 unsigned int member: 1; /* class member function */
1757 unsigned int constructor:1; /* constructor function */
1758 unsigned int destructor:1; /* destructor function */
1759 unsigned int Static: 1; /* static function */
1760 unsigned int Virtual: 1; /* virtual function */
1761 unsigned int constant: 1; /* constant function */
1762 unsigned int pure: 1; /* pure (virtual) function */
1763 unsigned int language: 4; /* procedure's language */
1764 unsigned int inlined: 1; /* function has been inlined */
1765 unsigned int Operator: 1; /* operator function */
1766 unsigned int stub: 1; /* bodyless function */
1767 unsigned int optimize: 2; /* optimization level */
1768 unsigned int level: 5; /* nesting level (top=0) */
1769 } quick_procedure_entry, *quick_procedure_entry_ptr;
1771 /* Source File Descriptor:
1773 * An element of the source file quick look-up table
1775 typedef struct quick_source {
1776 long isym; /* 0-based index in $LNTT$ of */
1777 /* first symbol for this file */
1778 CORE_ADDR adrStart; /* mem adr of start of file's code */
1779 CORE_ADDR adrEnd; /* mem adr of end of file's code */
1780 char *sbFile; /* name of source file */
1781 unsigned int fHasDecl: 1; /* do we have a .d file? */
1782 unsigned int fWarned: 1; /* have warned about age problems? */
1783 unsigned int fSrcfile: 1; /* 0 => include 1=> source */
1784 unsigned short ilnMac; /* lines in file (0 if don't know) */
1785 int ipd; /* 0-based index of first procedure*/
1786 /* in this file, in the quick */
1787 /* look-up table of procedures */
1788 unsigned int *rgLn; /* line pointer array, if any */
1789 } quick_file_entry, *quick_file_entry_ptr;
1791 /* Module Descriptor:
1793 * An element of the module quick reference table
1795 typedef struct quick_module {
1796 long isym; /* 0-based index of first */
1797 /* symbol for module */
1798 CORE_ADDR adrStart; /* adr of start of mod. */
1799 CORE_ADDR adrEnd; /* adr of end of mod. */
1800 char *sbAlias; /* alias name of module */
1801 char *sbMod; /* real name of module */
1802 unsigned int imports: 1; /* module have any imports? */
1803 unsigned int vars_in_front: 1; /* module globals in front? */
1804 unsigned int vars_in_gaps: 1; /* module globals in gaps? */
1805 unsigned int language: 4; /* type of language */
1806 unsigned int unused : 25;
1807 unsigned int unused2; /* space for future stuff */
1808 } quick_module_entry, *quick_module_entry_ptr;
1810 /* Auxiliary Procedure Descriptor:
1812 * An element of the auxiliary procedure quick look-up table
1814 typedef struct quick_aux_procedure {
1815 long isym_inln; /* start on inline list for proc */
1816 long spare;
1817 } quick_aux_procedure_entry, *quick_aux_procedure_entry_ptr;
1819 /* Paragraph Descriptor:
1821 * An element of the paragraph quick look-up table
1823 typedef struct quick_paragraph {
1824 long isym; /* first symbol for label (index) */
1825 CORE_ADDR adrStart; /* memory adr of start of label */
1826 CORE_ADDR adrEnd; /* memory adr of end of label */
1827 char *sbLab; /* name of label */
1828 unsigned int inst; /* Used in xdb to store inst @ bp */
1829 unsigned int sect: 1; /* true = section, false = parag. */
1830 unsigned int unused: 31; /* future use */
1831 } quick_paragraph_entry, *quick_paragraph_entry_ptr;
1834 * Class Descriptor:
1836 * An element of the class quick look-up table
1838 typedef struct quick_class {
1839 char *sbClass; /* name of class */
1840 long isym; /* class symbol (tag) */
1841 unsigned int type : 2; /* 0=class, 1=union, 2=struct */
1842 unsigned int fTemplate : 1;/* class template */
1843 unsigned int expansion : 1;/* template expansion */
1844 unsigned int unused :28;
1845 sltpointer lowscope; /* beginning of defined scope */
1846 sltpointer hiscope; /* end of defined scope */
1847 } quick_class_entry, *quick_class_entry_ptr;
1849 /* Address Alias Entry
1851 * An element of the address alias quick look-up table
1853 typedef struct quick_alias {
1854 CORE_ADDR low;
1855 CORE_ADDR high;
1856 int index;
1857 unsigned int unused : 31;
1858 unsigned int alternate : 1; /* alternate unnamed aliases? */
1859 } quick_alias_entry, *quick_alias_entry_ptr;
1861 /* Object Identification Entry
1863 * An element of the object identification quick look-up table
1866 typedef struct quick_obj_ID {
1867 CORE_ADDR obj_ident; /* class identifier */
1868 long isym; /* class symbol */
1869 long offset; /* offset to object start */
1870 } quick_obj_ID_entry, *quick_obj_ID_entry_ptr;
1873 #endif /* HP_SYMTAB_INCLUDED */