]>
Commit | Line | Data |
---|---|---|
8ee0532b JL |
1 | /* Definitions and structures for reading debug symbols from the |
2 | native HP C compiler. | |
3 | ||
4 | Written by the Center for Software Science at the University of Utah | |
5 | and by Cygnus Support. | |
6 | ||
7 | Copyright 1994 Free Software Foundation, Inc. | |
8 | ||
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. | |
13 | ||
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. | |
18 | ||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
22 | ||
23 | #ifndef HP_SYMTAB_INCLUDED | |
24 | #define HP_SYMTAB_INCLUDED | |
25 | ||
26 | /* General information: | |
27 | ||
28 | This header file defines and describes only the basic data structures | |
29 | necessary to read debug symbols produced by the HP C compiler using the | |
30 | SOM object file format. Definitions and structures used by other compilers | |
31 | for other languages or object file formats may be missing. | |
32 | (For a full description of the debug format, ftp hpux-symtab.h from | |
33 | jaguar.cs.utah.edu:/dist). | |
34 | ||
35 | ||
36 | Debug symbols are contained entirely within an unloadable space called | |
37 | $DEBUG$. $DEBUG$ contains several subspaces which group related | |
38 | debug symbols. | |
39 | ||
40 | $GNTT$ contains information for global variables, types and contants. | |
41 | ||
42 | $LNTT$ contains information for procedures (including nesting), scoping | |
43 | information, local variables, types, and constants. | |
44 | ||
45 | $SLT$ contains source line information so that code addresses may be | |
46 | mapped to source lines. | |
47 | ||
48 | $VT$ contains various strings and constants for named objects (variables, | |
49 | typedefs, functions, etc). Strings are stored as null-terminated character | |
50 | lists. Constants always begin on word boundaries. The first byte of | |
51 | the VT must be zero (a null string). | |
52 | ||
53 | $XT$ is not currently used by GDB. | |
54 | ||
55 | Many structures within the subspaces point to other structures within | |
56 | the same subspace, or to structures within a different subspace. These | |
57 | pointers are represented as a structure index from the beginning of | |
58 | the appropriate subspace. */ | |
59 | ||
60 | /* Used to describe where a constant is stored. */ | |
61 | enum location_type | |
62 | { | |
63 | LOCATION_IMMEDIATE, | |
64 | LOCATION_PTR, | |
65 | LOCATION_VT, | |
66 | }; | |
67 | ||
68 | /* Languages supported by this debug format. Within the data structures | |
69 | this type is limited to 4 bits for a maximum of 16 languages. */ | |
70 | enum hp_language | |
71 | { | |
72 | HP_LANGUAGE_UNKNOWN, | |
73 | HP_LANGUAGE_C, | |
74 | HP_LANGUAGE_F77, | |
75 | HP_LANGUAGE_PASCAL, | |
76 | HP_LANGUAGE_COBOL, | |
77 | HP_LANGUAGE_BASIC, | |
78 | HP_LANGUAGE_ADA, | |
79 | HP_LANGUAGE_CPLUSPLUS, | |
80 | }; | |
81 | ||
82 | ||
83 | /* Basic data types available in this debug format. Within the data | |
84 | structures this type is limited to 5 bits for a maximum of 32 basic | |
85 | data types. */ | |
86 | enum hp_type | |
87 | { | |
88 | HP_TYPE_UNDEFINED, | |
89 | HP_TYPE_BOOLEAN, | |
90 | HP_TYPE_CHAR, | |
91 | HP_TYPE_INT, | |
92 | HP_TYPE_UNSIGNED_INT, | |
93 | HP_TYPE_REAL, | |
94 | HP_TYPE_COMPLEX, | |
95 | HP_TYPE_STRING200, | |
96 | HP_TYPE_LONGSTRING200, | |
97 | HP_TYPE_TEXT, | |
98 | HP_TYPE_FLABEL, | |
99 | HP_TYPE_FTN_STRING_SPEC, | |
100 | HP_TYPE_MOD_STRING_SPEC, | |
101 | HP_TYPE_PACKED_DECIMAL, | |
102 | HP_TYPE_REAL_3000, | |
103 | HP_TYPE_MOD_STRING_3000, | |
104 | HP_TYPE_ANYPOINTER, | |
105 | HP_TYPE_GLOBAL_ANYPOINTER, | |
106 | HP_TYPE_LOCAL_ANYPOINTER, | |
107 | HP_TYPE_COMPLEXS3000, | |
108 | HP_TYPE_FTN_STRING_S300_COMPAT, | |
109 | HP_TYPE_FTN_STRING_VAX_COMPAT, | |
110 | HP_TYPE_BOOLEAN_S300_COMPAT, | |
111 | HP_TYPE_BOOLEAN_VAX_COMPAT, | |
112 | HP_TYPE_WIDE_CHAR, | |
113 | HP_TYPE_LONG, | |
114 | HP_TYPE_UNSIGNED_LONG, | |
115 | HP_TYPE_DOUBLE, | |
116 | HP_TYPE_TEMPLATE_ARG, | |
117 | }; | |
118 | ||
119 | /* An immediate name and type table entry. | |
120 | ||
121 | extension and immediate will always be one. | |
122 | global will always be zero. | |
123 | hp_type is the basic type this entry describes. | |
124 | bitlength is the length in bits for the basic type. */ | |
125 | struct dnttp_immediate | |
126 | { | |
127 | unsigned int extension: 1; | |
128 | unsigned int immediate: 1; | |
129 | unsigned int global: 1; | |
130 | enum hp_type type: 5; | |
131 | unsigned int bitlength: 24; | |
132 | }; | |
133 | ||
134 | /* A nonimmediate name and type table entry. | |
135 | ||
136 | extension will always be one. | |
137 | immediate will always be zero. | |
138 | if global is zero, this entry points into the LNTT | |
139 | if global is one, this entry points into the GNTT | |
140 | index is the index within the GNTT or LNTT for this entry. */ | |
141 | struct dnttp_nonimmediate | |
142 | { | |
143 | unsigned int extension: 1; | |
144 | unsigned int immediate: 1; | |
145 | unsigned int global: 1; | |
146 | unsigned int index: 29; | |
147 | }; | |
148 | ||
149 | /* A pointer to an entry in the GNTT and LNTT tables. It has two | |
150 | forms depending on the type being described. | |
151 | ||
152 | The immediate form is used for simple entries and is one | |
153 | word. | |
154 | ||
155 | The nonimmediate form is used for complex entries and contains | |
156 | an index into the LNTT or GNTT which describes the entire type. | |
157 | ||
158 | If a dnttpointer is -1, then it is a NIL entry. */ | |
159 | ||
160 | #define DNTTNIL (-1) | |
161 | typedef union dnttpointer | |
162 | { | |
163 | struct dnttp_immediate dntti; | |
164 | struct dnttp_nonimmediate dnttp; | |
165 | int word; | |
166 | } dnttpointer; | |
167 | ||
168 | /* An index into the source line table. As with dnttpointers, a sltpointer | |
169 | of -1 indicates a NIL entry. */ | |
170 | #define SLTNIL (-1) | |
171 | typedef int sltpointer; | |
172 | ||
173 | /* Unsigned byte offset into the VT. */ | |
174 | typedef unsigned int vtpointer; | |
175 | ||
176 | /* A DNTT entry (used within the GNTT and LNTT). | |
177 | ||
178 | DNTT entries are variable sized objects, but are always a multiple | |
179 | of 3 words (we call each group of 3 words a "block"). | |
180 | ||
181 | The first bit in each block is an extension bit. This bit is zero | |
182 | for the first block of a DNTT entry. If the entry requires more | |
183 | than one block, then this bit is set to one in all blocks after | |
184 | the first one. */ | |
185 | ||
186 | /* Each DNTT entry describes a particular debug symbol (beginning of | |
187 | a source file, a function, variables, structures, etc. | |
188 | ||
189 | The type of the DNTT entry is stored in the "kind" field within the | |
190 | DNTT entry itself. */ | |
191 | ||
192 | enum dntt_entry_type | |
193 | { | |
194 | DNTT_TYPE_NIL = -1, | |
195 | DNTT_TYPE_SRCFILE, | |
196 | DNTT_TYPE_MODULE, | |
197 | DNTT_TYPE_FUNCTION, | |
198 | DNTT_TYPE_ENTRY, | |
199 | DNTT_TYPE_BEGIN, | |
200 | DNTT_TYPE_END, | |
201 | DNTT_TYPE_IMPORT, | |
202 | DNTT_TYPE_LABEL, | |
203 | DNTT_TYPE_FPARAM, | |
204 | DNTT_TYPE_SVAR, | |
205 | DNTT_TYPE_DVAR, | |
206 | DNTT_TYPE_HOLE1, | |
207 | DNTT_TYPE_CONST, | |
208 | DNTT_TYPE_TYPEDEF, | |
209 | DNTT_TYPE_TAGDEF, | |
210 | DNTT_TYPE_POINTER, | |
211 | DNTT_TYPE_ENUM, | |
212 | DNTT_TYPE_MEMENUM, | |
213 | DNTT_TYPE_SET, | |
214 | DNTT_TYPE_SUBRANGE, | |
215 | DNTT_TYPE_ARRAY, | |
216 | DNTT_TYPE_STRUCT, | |
217 | DNTT_TYPE_UNION, | |
218 | DNTT_TYPE_FIELD, | |
219 | DNTT_TYPE_VARIANT, | |
220 | DNTT_TYPE_FILE, | |
221 | DNTT_TYPE_FUNCTYPE, | |
222 | DNTT_TYPE_WITH, | |
223 | DNTT_TYPE_COMMON, | |
224 | DNTT_TYPE_COBSTRUCT, | |
225 | DNTT_TYPE_XREF, | |
226 | DNTT_TYPE_SA, | |
227 | DNTT_TYPE_MACRO, | |
228 | DNTT_TYPE_BLOCKDATA, | |
229 | DNTT_TYPE_CLASS_SCOPE, | |
230 | DNTT_TYPE_REFERENCE, | |
231 | DNTT_TYPE_PTRMEM, | |
232 | DNTT_TYPE_PTRMEMFUNC, | |
233 | DNTT_TYPE_CLASS, | |
234 | DNTT_TYPE_GENFIELD, | |
235 | DNTT_TYPE_VFUNC, | |
236 | DNTT_TYPE_MEMACCESS, | |
237 | DNTT_TYPE_INHERITANCE, | |
238 | DNTT_TYPE_FRIEND_CLASS, | |
239 | DNTT_TYPE_FRIEND_FUNC, | |
240 | DNTT_TYPE_MODIFIER, | |
241 | DNTT_TYPE_OBJECT_ID, | |
242 | DNTT_TYPE_MEMFUNC, | |
243 | DNTT_TYPE_TEMPLATE, | |
244 | DNTT_TYPE_TEMPLATE_ARG, | |
245 | DNTT_TYPE_FUNC_TEMPLATE, | |
246 | DNTT_TYPE_LINK, | |
247 | DNTT_TYPE_MAX, | |
248 | }; | |
249 | ||
250 | /* DNTT_TYPE_SRCFILE: | |
251 | ||
252 | One DNTT_TYPE_SRCFILE symbol is output for the start of each source | |
253 | file and at the begin and end of an included file. A DNTT_TYPE_SRCFILE | |
254 | entry is also output before each DNTT_TYPE_FUNC symbol so that debuggers | |
255 | can determine what file a function was defined in. | |
256 | ||
257 | LANGUAGE describes the source file's language. | |
258 | ||
259 | NAME points to an VT entry providing the source file's name. | |
260 | ||
261 | Note the name used for DNTT_TYPE_SRCFILE entries are exactly as seen | |
262 | by the compiler (ie they may be relative or absolute). C include files | |
263 | via <> inclusion must use absolute paths. | |
264 | ||
265 | ADDRESS points to an SLT entry from which line number and code locations | |
266 | may be determined. */ | |
267 | ||
268 | struct dntt_type_srcfile | |
269 | { | |
270 | unsigned int extension: 1; | |
271 | enum dntt_entry_type kind: 10; | |
272 | enum hp_language language: 4; | |
273 | unsigned int unused: 17; | |
274 | vtpointer name; | |
275 | sltpointer address; | |
276 | }; | |
277 | ||
278 | /* DNTT_TYPE_MODULE: | |
279 | ||
280 | A DNTT_TYPE_MODULE symbol is emitted for the start of a pascal | |
281 | module or C source file. | |
282 | ||
283 | Each DNTT_TYPE_MODULE must have an associated DNTT_TYPE_END symbol. | |
284 | ||
285 | NAME points to a VT entry providing the module's name. Note C | |
286 | source files are considered nameless modules. | |
287 | ||
288 | ALIAS point to a VT entry providing a secondary name. | |
289 | ||
290 | ADDRESS points to an SLT entry from which line number and code locations | |
291 | may be determined. */ | |
292 | ||
293 | struct dntt_type_module | |
294 | { | |
295 | unsigned int extension: 1; | |
296 | enum dntt_entry_type kind: 10; | |
297 | unsigned int unused: 21; | |
298 | vtpointer name; | |
299 | vtpointer alias; | |
300 | dnttpointer unused2; | |
301 | sltpointer address; | |
302 | }; | |
303 | ||
304 | /* DNTT_TYPE_FUNCTION: | |
305 | ||
306 | A DNTT_TYPE_FUNCTION symbol is emitted for each function definition; | |
307 | a DNTT_TYPE_ENTRY symbols is used for secondary entry points. Both | |
308 | symbols used the dntt_type_function structure. | |
309 | ||
310 | Each DNTT_TYPE_FUNCTION must have a matching DNTT_TYPE_END. | |
311 | ||
312 | GLOBAL is nonzero if the function has global scope. | |
313 | ||
314 | LANGUAGE describes the function's source language. | |
315 | ||
316 | OPT_LEVEL describes the optimization level the function was compiled | |
317 | with. | |
318 | ||
319 | VARARGS is nonzero if the function uses varargs. | |
320 | ||
321 | NAME points to a VT entry providing the function's name. | |
322 | ||
323 | ALIAS points to a VT entry providing a secondary name for the function. | |
324 | ||
325 | FIRSTPARAM points to a LNTT entry which describes the parameter list. | |
326 | ||
327 | ADDRESS points to an SLT entry from which line number and code locations | |
328 | may be determined. | |
329 | ||
330 | ENTRYADDR is the memory address corresponding the the function's entry point | |
331 | ||
332 | RETVAL points to a LNTT entry describing the function's return value. | |
333 | ||
334 | LOWADDR is the lowest memory address associated with this function. | |
335 | ||
336 | HIADDR is the highest memory address associated with this function. */ | |
337 | ||
338 | struct dntt_type_function | |
339 | { | |
340 | unsigned int extension: 1; | |
341 | enum dntt_entry_type kind: 10; | |
342 | unsigned int global: 1; | |
343 | enum hp_language language: 4; | |
344 | unsigned int nest_level: 5; | |
345 | unsigned int opt_level: 2; | |
346 | unsigned int varargs: 1; | |
347 | unsigned int lang_info: 4; | |
348 | unsigned int inlined: 1; | |
349 | unsigned int localalloc: 1; | |
350 | unsigned int expansion: 1; | |
351 | unsigned int unused: 1; | |
352 | vtpointer name; | |
353 | vtpointer alias; | |
354 | dnttpointer firstparam; | |
355 | sltpointer address; | |
356 | CORE_ADDR entryaddr; | |
357 | dnttpointer retval; | |
358 | CORE_ADDR lowaddr; | |
359 | CORE_ADDR hiaddr; | |
360 | }; | |
361 | ||
362 | /* DNTT_TYPE_BEGIN: | |
363 | ||
364 | A DNTT_TYPE_BEGIN symbol is emitted to begin a new nested scope. | |
365 | Every DNTT_TYPE_BEGIN symbol must have a matching DNTT_TYPE_END symbol. | |
366 | ||
367 | CLASSFLAG is nonzero if this is the beginning of a c++ class definition. | |
368 | ||
369 | ADDRESS points to an SLT entry from which line number and code locations | |
370 | may be determined. */ | |
371 | ||
372 | struct dntt_type_begin | |
373 | { | |
374 | unsigned int extension: 1; | |
375 | enum dntt_entry_type kind: 10; | |
376 | unsigned int classflag: 1; | |
377 | unsigned int unused: 20; | |
378 | sltpointer address; | |
379 | }; | |
380 | ||
381 | /* DNTT_TYPE_END: | |
382 | ||
383 | A DNTT_TYPE_END symbol is emitted when closing a scope started by | |
384 | a DNTT_TYPE_MODULE, DNTT_TYPE_FUNCTION, and DNTT_TYPE_BEGIN symbols. | |
385 | ||
386 | ENDKIND describes what type of scope the DNTT_TYPE_END is closing | |
387 | (DNTT_TYPE_MODULE, DNTT_TYPE_BEGIN, etc). | |
388 | ||
389 | CLASSFLAG is nonzero if this is the end of a c++ class definition. | |
390 | ||
391 | ADDRESS points to an SLT entry from which line number and code locations | |
392 | may be determined. | |
393 | ||
394 | BEGINSCOPE points to the LNTT entry which opened the scope. */ | |
395 | ||
396 | struct dntt_type_end | |
397 | { | |
398 | unsigned int extension: 1; | |
399 | enum dntt_entry_type kind: 10; | |
400 | enum dntt_entry_type endkind: 10; | |
401 | unsigned int classflag: 1; | |
402 | unsigned int unused: 10; | |
403 | sltpointer address; | |
404 | dnttpointer beginscope; | |
405 | }; | |
406 | ||
407 | /* DNTT_TYPE_IMPORT is unused by GDB. */ | |
408 | /* DNTT_TYPE_LABEL is unused by GDB. */ | |
409 | ||
410 | /* DNTT_TYPE_FPARAM: | |
411 | ||
412 | A DNTT_TYPE_FPARAM symbol is emitted for a function argument. When | |
413 | chained together the symbols represent an argument list for a function. | |
414 | ||
415 | REGPARAM is nonzero if this parameter was passed in a register. | |
416 | ||
417 | INDIRECT is nonzero if this parameter is a pointer to the parameter | |
418 | (pass by reference or pass by value for large items). | |
419 | ||
420 | LONGADDR is nonzero if the parameter is a 64bit pointer. | |
421 | ||
422 | NAME is a pointer into the VT for the parameter's name. | |
423 | ||
424 | LOCATION describes where the parameter is stored. Depending on the | |
425 | parameter type LOCATION could be a register number, or an offset | |
426 | from the stack pointer. | |
427 | ||
428 | TYPE points to a NTT entry describing the type of this parameter. | |
429 | ||
430 | NEXTPARAM points to the LNTT entry describing the next parameter. */ | |
431 | ||
432 | struct dntt_type_fparam | |
433 | { | |
434 | unsigned int extension: 1; | |
435 | enum dntt_entry_type kind: 10; | |
436 | unsigned int regparam: 1; | |
437 | unsigned int indirect: 1; | |
438 | unsigned int longaddr: 1; | |
439 | unsigned int copyparam: 1; | |
440 | unsigned int dflt: 1; | |
441 | unsigned int unused: 16; | |
442 | vtpointer name; | |
443 | int location; | |
444 | dnttpointer type; | |
445 | dnttpointer nextparam; | |
446 | int misc; | |
447 | }; | |
448 | ||
449 | /* DNTT_TYPE_SVAR: | |
450 | ||
451 | A DNTT_TYPE_SVAR is emitted to describe a variable in static storage. | |
452 | ||
453 | GLOBAL is nonzero if the variable has global scope. | |
454 | ||
455 | INDIRECT is nonzero if the variable is a pointer to an object. | |
456 | ||
457 | LONGADDR is nonzero if the variable is in long pointer space. | |
458 | ||
459 | STATICMEM is nonzero if the variable is a member of a class. | |
460 | ||
461 | A_UNION is nonzero if the variable is an anonymous union member. | |
462 | ||
463 | NAME is a pointer into the VT for the variable's name. | |
464 | ||
465 | LOCATION provides the memory address for the variable. | |
466 | ||
467 | TYPE is a pointer into either the GNTT or LNTT which describes | |
468 | the type of this variable. */ | |
469 | ||
470 | struct dntt_type_svar | |
471 | { | |
472 | unsigned int extension: 1; | |
473 | enum dntt_entry_type kind: 10; | |
474 | unsigned int global: 1; | |
475 | unsigned int indirect: 1; | |
476 | unsigned int longaddr: 1; | |
477 | unsigned int staticmem: 1; | |
478 | unsigned int a_union: 1; | |
479 | unsigned int unused: 16; | |
480 | vtpointer name; | |
481 | CORE_ADDR location; | |
482 | dnttpointer type; | |
483 | unsigned int offset; | |
484 | unsigned int displacement; | |
485 | }; | |
486 | ||
487 | /* DNTT_TYPE_DVAR: | |
488 | ||
489 | A DNTT_TYPE_DVAR is emitted to describe automatic variables and variables | |
490 | held in registers. | |
491 | ||
492 | GLOBAL is nonzero if the variable has global scope. | |
493 | ||
494 | INDIRECT is nonzero if the variable is a pointer to an object. | |
495 | ||
496 | REGVAR is nonzero if the variable is in a register. | |
497 | ||
498 | A_UNION is nonzero if the variable is an anonymous union member. | |
499 | ||
500 | NAME is a pointer into the VT for the variable's name. | |
501 | ||
502 | LOCATION provides the memory address or register number for the variable. | |
503 | ||
504 | TYPE is a pointer into either the GNTT or LNTT which describes | |
505 | the type of this variable. */ | |
506 | ||
507 | struct dntt_type_dvar | |
508 | { | |
509 | unsigned int extension: 1; | |
510 | enum dntt_entry_type kind: 10; | |
511 | unsigned int global: 1; | |
512 | unsigned int indirect: 1; | |
513 | unsigned int regvar: 1; | |
514 | unsigned int a_union: 1; | |
515 | unsigned int unused: 17; | |
516 | vtpointer name; | |
517 | int location; | |
518 | dnttpointer type; | |
519 | unsigned int offset; | |
520 | }; | |
521 | ||
522 | /* DNTT_TYPE_CONST: | |
523 | ||
524 | A DNTT_TYPE_CONST symbol is emitted for program constants. | |
525 | ||
526 | GLOBAL is nonzero if the constant has global scope. | |
527 | ||
528 | INDIRECT is nonzero if the constant is a pointer to an object. | |
529 | ||
530 | LOCATION_TYPE describes where to find the constant's value | |
531 | (in the VT, memory, or embedded in an instruction). | |
532 | ||
533 | CLASSMEM is nonzero if the constant is a member of a class. | |
534 | ||
535 | NAME is a pointer into the VT for the constant's name. | |
536 | ||
537 | LOCATION provides the memory address, register number or pointer | |
538 | into the VT for the constant's value. | |
539 | ||
540 | TYPE is a pointer into either the GNTT or LNTT which describes | |
541 | the type of this variable. */ | |
542 | ||
543 | struct dntt_type_const | |
544 | { | |
545 | unsigned int extension: 1; | |
546 | enum dntt_entry_type kind: 10; | |
547 | unsigned int global: 1; | |
548 | unsigned int indirect: 1; | |
549 | enum location_type: 3; | |
550 | unsigned int classmem: 1; | |
551 | unsigned int unused: 15; | |
552 | vtpointer name; | |
553 | CORE_ADDR location; | |
554 | dnttpointer type; | |
555 | unsigned int offset; | |
556 | unsigned int displacement; | |
557 | }; | |
558 | ||
559 | /* DNTT_TYPE_TYPEDEF and DNTT_TYPE_TAGDEF: | |
560 | ||
561 | The same structure is used to describe typedefs and tagdefs. | |
562 | ||
563 | DNTT_TYPE_TYPEDEFS are associated with C "typedefs". | |
564 | ||
565 | DNTT_TYPE_TAGDEFs are associated with C "struct", "union", and "enum" | |
566 | tags, which may have the same name as a typedef in the same scope. | |
567 | ||
568 | GLOBAL is nonzero if the typedef/tagdef has global scope. | |
569 | ||
570 | TYPEINFO is used to determine if full type information is available | |
571 | for a tag. (usually 1, but can be zero for opaque types in C). | |
572 | ||
573 | NAME is a pointer into the VT for the constant's name. | |
574 | ||
575 | TYPE points to the underlying type for the typedef/tagdef in the | |
576 | GNTT or LNTT. */ | |
577 | ||
578 | struct dntt_type_type | |
579 | { | |
580 | unsigned int extension: 1; | |
581 | enum dntt_entry_type kind: 10; | |
582 | unsigned int global: 1; | |
583 | unsigned int typeinfo: 1; | |
584 | unsigned int unused: 19; | |
585 | vtpointer name; | |
586 | dnttpointer type; | |
587 | }; | |
588 | ||
589 | /* DNTT_TYPE_POINTER: | |
590 | ||
591 | Used to describe a pointer to an underlying type. | |
592 | ||
593 | POINTSTO is a pointer into the GNTT or LNTT for the type which this | |
594 | pointer points to. | |
595 | ||
596 | BITLENGTH is the length of the pointer (not the underlying type). */ | |
597 | ||
598 | struct dntt_type_pointer | |
599 | { | |
600 | unsigned int extension: 1; | |
601 | enum dntt_entry_type kind: 10; | |
602 | unsigned int unused: 21; | |
603 | dnttpointer pointsto; | |
604 | unsigned int bitlength; | |
605 | }; | |
606 | ||
607 | ||
608 | /* DNTT_TYPE_ENUM: | |
609 | ||
610 | Used to describe enumerated types. | |
611 | ||
612 | FIRSTMEM is a pointer to a DNTT_TYPE_MEMENUM in the GNTT/LNTT which | |
613 | describes the first member (and contains a pointer to the chain of | |
614 | members). | |
615 | ||
616 | BITLENGTH is the number of bits used to hold the values of the enum's | |
617 | members. */ | |
618 | ||
619 | struct dntt_type_enum | |
620 | { | |
621 | unsigned int extension: 1; | |
622 | enum dntt_entry_type kind: 10; | |
623 | unsigned int unused: 21; | |
624 | dnttpointer firstmem; | |
625 | unsigned int bitlength; | |
626 | }; | |
627 | ||
628 | /* DNTT_TYPE_MEMENUM | |
629 | ||
630 | Used to describe members of an enumerated type. | |
631 | ||
632 | CLASSMEM is nonzero if this member is part of a class. | |
633 | ||
634 | NAME points into the VT for the name of this member. | |
635 | ||
636 | VALUE is the value of this enumeration member. | |
637 | ||
638 | NEXTMEM points to the next DNTT_TYPE_MEMENUM in the chain. */ | |
639 | ||
640 | struct dntt_type_memenum | |
641 | { | |
642 | unsigned int extension: 1; | |
643 | enum dntt_entry_type kind: 10; | |
644 | unsigned int classmem: 1; | |
645 | unsigned int unused: 20; | |
646 | vtpointer name; | |
647 | unsigned int value; | |
648 | dnttpointer nextmem; | |
649 | }; | |
650 | ||
651 | /* DNTT_TYPE_SET | |
652 | ||
653 | DECLARATION describes the bitpacking of the set. | |
654 | ||
655 | SUBTYPE points to a DNTT entry describing the type of the members. | |
656 | ||
657 | BITLENGTH is the size of the set. */ | |
658 | ||
659 | struct dntt_type_set | |
660 | { | |
661 | unsigned int extension: 1; | |
662 | enum dntt_entry_type kind: 10; | |
663 | unsigned int declaration: 2; | |
664 | unsigned int unused: 19; | |
665 | dnttpointer subtype; | |
666 | unsigned int bitlength; | |
667 | }; | |
668 | ||
669 | /* DNTT_TYPE_SUBRANGE | |
670 | ||
671 | DYN_LOW describes the lower bound of the subrange: | |
672 | ||
673 | 00 for a constant lower bound (found in LOWBOUND). | |
674 | ||
675 | 01 for a dynamic lower bound with the lower bound found in the the | |
676 | memory address pointed to by LOWBOUND. | |
677 | ||
678 | 10 for a dynamic lower bound described by an variable found in the | |
679 | DNTT/LNTT (LOWBOUND would be a pointer into the DNTT/LNTT). | |
680 | ||
681 | DYN_HIGH is similar to DYN_LOW, except it describes the upper bound. | |
682 | ||
683 | SUBTYPE points to the type of the subrange. | |
684 | ||
685 | BITLENGTH is the length in bits needed to describe the subrange's | |
686 | values. */ | |
687 | ||
688 | struct dntt_type_subrange | |
689 | { | |
690 | unsigned int extension: 1; | |
691 | enum dntt_entry_type kind: 10; | |
692 | unsigned int dyn_low: 2; | |
693 | unsigned int dyn_high: 2; | |
694 | unsigned int unused: 17; | |
695 | int lowbound; | |
696 | int highbound; | |
697 | dnttpointer subtype; | |
698 | unsigned int bitlength; | |
699 | }; | |
700 | ||
701 | /* DNTT_TYPE_ARRAY | |
702 | ||
703 | DECLARATION describes the bit packing used in the array. | |
704 | ||
705 | ARRAYISBYTES is nonzero if the field in arraylength describes the | |
706 | length in bytes rather than in bits. A value of zero is used to | |
707 | describe an array with size 2**32. | |
708 | ||
709 | ELEMISBYTES is nonzero if the length if each element in the array | |
710 | is describes in bytes rather than bits. A value of zero is used | |
711 | to an element with size 2**32. | |
712 | ||
713 | ELEMORDER is nonzero if the elements are indexed in increasing order. | |
714 | ||
715 | JUSTIFIED if the elements are left justified to index zero. | |
716 | ||
717 | ARRAYLENGTH is the length of the array. | |
718 | ||
719 | INDEXTYPE is a DNTT pointer to the type used to index the array. | |
720 | ||
721 | ELEMTYPE is a DNTT pointer to the type for the array elements. | |
722 | ||
723 | ELEMLENGTH is the length of each element in the array (including | |
724 | any padding). | |
725 | ||
726 | Multi-dimensional arrays are represented by ELEMTYPE pointing to | |
727 | another DNTT_TYPE_ARRAY. */ | |
728 | ||
729 | struct dntt_type_array | |
730 | { | |
731 | unsigned int extension: 1; | |
732 | enum dntt_entry_type kind: 10; | |
733 | unsigned int declaration: 2; | |
734 | unsigned int dyn_low: 2; | |
735 | unsigned int dyn_high: 2; | |
736 | unsigned int arrayisbytes: 1; | |
737 | unsigned int elemisbytes: 1; | |
738 | unsigned int elemorder: 1; | |
739 | unsigned int justified: 1; | |
740 | unsigned int unused: 11; | |
741 | unsigned int arraylength; | |
742 | dnttpointer indextype; | |
743 | dnttpointer elemtype; | |
744 | unsigned int elemlength; | |
745 | }; | |
746 | ||
747 | /* DNTT_TYPE_STRUCT | |
748 | ||
749 | DNTT_TYPE_STRUCT is used to describe a C structure. | |
750 | ||
751 | DECLARATION describes the bitpacking used. | |
752 | ||
753 | FIRSTFIELD is a DNTT pointer to the first field of the structure | |
754 | (each field contains a pointer to the next field, walk the list | |
755 | to access all fields of the structure). | |
756 | ||
757 | VARTAGFIELD and VARLIST are used for Pascal variant records. | |
758 | ||
759 | BITLENGTH is the size of the structure in bits. */ | |
760 | ||
761 | struct dntt_type_struct | |
762 | { | |
763 | unsigned int extension: 1; | |
764 | enum dntt_entry_type kind: 10; | |
765 | unsigned int declaration: 2; | |
766 | unsigned int unused: 19; | |
767 | dnttpointer firstfield; | |
768 | dnttpointer vartagfield; | |
769 | dnttpointer varlist; | |
770 | unsigned int bitlength; | |
771 | }; | |
772 | ||
773 | /* DNTT_TYPE_UNION | |
774 | ||
775 | DNTT_TYPE_UNION is used to describe a C union. | |
776 | ||
777 | FIRSTFIELD is a DNTT pointer to the beginning of the field chain. | |
778 | ||
779 | BITLENGTH is the size of the union in bits. */ | |
780 | ||
781 | struct dntt_type_union | |
782 | { | |
783 | unsigned int extension: 1; | |
784 | enum dntt_entry_type kind: 10; | |
785 | unsigned int unused: 21; | |
786 | dnttpointer firstfield; | |
787 | unsigned int bitlength; | |
788 | }; | |
789 | ||
790 | /* DNTT_TYPE_FIELD | |
791 | ||
792 | DNTT_TYPE_FIELD describes one field in a structure or union. | |
793 | ||
794 | VISIBILITY is used to describe the visibility of the field | |
795 | (for c++. public = 0, protected = 1, private = 2). | |
796 | ||
797 | A_UNION is nonzero if this field is a member of an anonymous union. | |
798 | ||
799 | STATICMEM is nonzero if this field is a static member of a template. | |
800 | ||
801 | NAME is a pointer into the VT for the name of the field. | |
802 | ||
803 | BITOFFSET gives the offset of this field in bits from the beginning | |
804 | of the structure or union this field is a member of. | |
805 | ||
806 | TYPE is a DNTT pointer to the type describing this field. | |
807 | ||
808 | BITLENGTH is the size of the entry in bits. | |
809 | ||
810 | NEXTFIELD is a DNTT pointer to the next field in the chain. */ | |
811 | ||
812 | struct dntt_type_field | |
813 | { | |
814 | unsigned int extension: 1; | |
815 | enum dntt_entry_type kind: 10; | |
816 | unsigned int visibility: 2; | |
817 | unsigned int a_union: 1; | |
818 | unsigned int staticmem: 1; | |
819 | unsigned int unused: 17; | |
820 | vtpointer name; | |
821 | unsigned int bitoffset; | |
822 | dnttpointer type; | |
823 | unsigned int bitlength; | |
824 | dnttpointer nextfield; | |
825 | }; | |
826 | ||
827 | /* DNTT_TYPE_VARIANT is unused by GDB. */ | |
828 | /* DNTT_TYPE_FILE is unused by GDB. */ | |
829 | ||
830 | /* DNTT_TYPE_COMMON is unused by GDB. */ | |
831 | /* DNTT_TYPE_LINK is unused by GDB. */ | |
832 | /* DNTT_TYPE_FFUNC_LINK is unused by GDB. */ | |
833 | /* DNTT_TYPE_TEMPLATE is unused by GDB. */ | |
834 | ||
835 | /* DNTT_TYPE_FUNCTYPE | |
836 | ||
837 | VARARGS is nonzero if this function uses varargs. | |
838 | ||
839 | FIRSTPARAM is a DNTT pointer to the first entry in the parameter | |
840 | chain. | |
841 | ||
842 | RETVAL is a DNTT pointer to the type of the return value. */ | |
843 | ||
844 | struct dntt_type_functype | |
845 | { | |
846 | unsigned int extension: 1; | |
847 | enum dntt_entry_type kind: 10; | |
848 | unsigned int varargs: 1; | |
849 | unsigned int info: 4; | |
850 | unsigned int unused: 16; | |
851 | unsigned int bitlength; | |
852 | dnttpointer firstparam; | |
853 | dnttpointer retval; | |
854 | }; | |
855 | ||
856 | /* DNTT_TYPE_WITH is unued by GDB. */ | |
857 | /* DNTT_TYPE_COBSTRUCT is unused by GDB. */ | |
858 | /* DNTT_TYPE_MODIFIER is unused by GDB. */ | |
859 | /* DNTT_TYPE_GENFIELD is unused by GDB. */ | |
860 | /* DNTT_TYPE_MEMACCESS is unused by GDB. */ | |
861 | /* DNTT_TYPE_VFUNC is unused by GDB. */ | |
862 | /* DNTT_TYPE_CLASS_SCOPE is unused by GDB. */ | |
863 | /* DNTT_TYPE_FRIEND_CLASS is unused by GDB. */ | |
864 | /* DNTT_TYPE_FRIEND_FUNC is unused by GDB. */ | |
865 | /* DNTT_TYPE_CLASS unused by GDB. */ | |
866 | /* DNTT_TYPE_TEMPLATE unused by GDB. */ | |
867 | /* DNTT_TYPE_TEMPL_ARG is unused by GDB. */ | |
868 | /* DNTT_TYPE_PTRMEM not used by GDB */ | |
869 | /* DNTT_TYPE_INHERITANCE is unused by GDB. */ | |
870 | /* DNTT_TYPE_OBJECT_ID is unused by GDB. */ | |
871 | /* DNTT_TYPE_XREF is unused by GDB. */ | |
872 | /* DNTT_TYPE_SA is unused by GDB. */ | |
873 | ||
874 | /* DNTT_TYPE_GENERIC and DNTT_TYPE_BLOCK are convience structures | |
875 | so we can examine a DNTT entry in a generic fashion. */ | |
876 | struct dntt_type_generic | |
877 | { | |
878 | unsigned int word[9]; | |
879 | }; | |
880 | ||
881 | struct dntt_type_block | |
882 | { | |
883 | unsigned int extension: 1; | |
884 | enum dntt_entry_type kind: 10; | |
885 | unsigned int unused: 21; | |
886 | unsigned int word[2]; | |
887 | }; | |
888 | ||
889 | /* One entry in a DNTT (either the LNTT or GNTT). */ | |
890 | union dnttentry | |
891 | { | |
892 | struct dntt_type_srcfile dsfile; | |
893 | struct dntt_type_module dmodule; | |
894 | struct dntt_type_function dfunc; | |
895 | struct dntt_type_function dentry; | |
896 | struct dntt_type_begin dbegin; | |
897 | struct dntt_type_end dend; | |
898 | struct dntt_type_fparam dfparam; | |
899 | struct dntt_type_svar dsvar; | |
900 | struct dntt_type_dvar ddvar; | |
901 | struct dntt_type_const dconst; | |
902 | struct dntt_type_type dtype; | |
903 | struct dntt_type_type dtag; | |
904 | struct dntt_type_pointer dptr; | |
905 | struct dntt_type_enum denum; | |
906 | struct dntt_type_memenum dmember; | |
907 | struct dntt_type_set dset; | |
908 | struct dntt_type_subrange dsubr; | |
909 | struct dntt_type_array darray; | |
910 | struct dntt_type_struct dstruct; | |
911 | struct dntt_type_union dunion; | |
912 | struct dntt_type_field dfield; | |
913 | struct dntt_type_functype dfunctype; | |
914 | struct dntt_type_generic dgeneric; | |
915 | struct dntt_type_block dblock; | |
916 | }; | |
917 | ||
918 | /* Source line entry types. */ | |
919 | enum slttype | |
920 | { | |
921 | SLT_NORMAL, | |
922 | SLT_SRCFILE, | |
923 | SLT_MODULE, | |
924 | SLT_FUNCTION, | |
925 | SLT_ENTRY, | |
926 | SLT_BEGIN, | |
927 | SLT_END, | |
928 | SLT_WITH, | |
929 | SLT_EXIT, | |
930 | SLT_ASSIST, | |
931 | SLT_MARKER, | |
932 | }; | |
933 | ||
934 | /* A normal source line entry. Simply provides a mapping of a source | |
935 | line number to a code address. | |
936 | ||
937 | SLTDESC will always be SLT_NORMAL or SLT_EXIT. */ | |
938 | ||
939 | struct slt_normal | |
940 | { | |
941 | enum slttype sltdesc: 4; | |
942 | unsigned int line: 28; | |
943 | CORE_ADDR address; | |
944 | }; | |
945 | ||
946 | /* A special source line entry. Provides a mapping of a declaration | |
947 | to a line number. These entries point back into the DNTT which | |
948 | references them. */ | |
949 | ||
950 | struct slt_special | |
951 | { | |
952 | enum slttype sltdesc: 4; | |
953 | unsigned int line: 28; | |
954 | dnttpointer backptr; | |
955 | }; | |
956 | ||
957 | /* Used to describe nesting. | |
958 | ||
959 | For nested languages, an slt_assist entry must follow each SLT_FUNC | |
960 | entry in the SLT. The address field will point forward to the | |
961 | first slt_normal entry within the function's scope. */ | |
962 | ||
963 | struct slt_assist | |
964 | { | |
965 | enum slttype sltdesc: 4; | |
966 | unsigned int unused: 28; | |
967 | sltpointer address; | |
968 | }; | |
969 | ||
970 | struct slt_generic | |
971 | { | |
972 | unsigned int word[2]; | |
973 | }; | |
974 | ||
975 | union sltentry | |
976 | { | |
977 | struct slt_normal snorm; | |
978 | struct slt_special sspec; | |
979 | struct slt_assist sasst; | |
980 | struct slt_generic sgeneric; | |
981 | }; | |
982 | ||
983 | #endif /* HP_SYMTAB_INCLUDED */ |