2 /* Apollo object module DST (debug symbol table) description */
7 #if defined(apollo) && !defined(__GNUC__)
8 #define ALIGNED1 __attribute( (aligned(1)) )
10 /* Remove attribute directives from non-Apollo code: */
11 #define ALIGNED1 /* nil */
16 /* Identification of this version of the debug symbol table. Producers of the
17 debug symbol table must write these values into the version number field of
18 the compilation unit record in .blocks .
20 #define dst_version_major 1
21 #define dst_version_minor 3
25 ** Enumeration of debug record types appearing in .blocks and .symbols ...
30 dst_typ_comp_unit
, /* 1 */
31 dst_typ_section_tab
, /* 2 */
32 dst_typ_file_tab
, /* 3 */
33 dst_typ_block
, /* 4 */
36 dst_typ_pointer
, /* 7 */
37 dst_typ_array
, /* 8 */
38 dst_typ_subrange
, /* 9 */
40 dst_typ_implicit_enum
, /* 11 */
41 dst_typ_explicit_enum
, /* 12 */
42 dst_typ_short_rec
, /* 13 */
44 dst_typ_short_union
, /* 15 */
46 dst_typ_file
, /* 17 */
47 dst_typ_offset
, /* 18 */
48 dst_typ_alias
, /* 19 */
49 dst_typ_signature
, /* 20 */
51 dst_typ_old_label
, /* 22 */
52 dst_typ_scope
, /* 23 */
53 dst_typ_end_scope
, /* 24 */
56 dst_typ_string_tab
, /* 27 */
57 dst_typ_global_name_tab
, /* 28 */
58 dst_typ_forward
, /* 29 */
59 dst_typ_aux_size
, /* 30 */
60 dst_typ_aux_align
, /* 31 */
61 dst_typ_aux_field_size
, /* 32 */
62 dst_typ_aux_field_off
, /* 33 */
63 dst_typ_aux_field_align
, /* 34 */
64 dst_typ_aux_qual
, /* 35 */
65 dst_typ_aux_var_bound
, /* 36 */
66 dst_typ_extension
, /* 37 */
67 dst_typ_string
, /* 38 */
69 dst_typ_const
, /* 40 */
70 dst_typ_reference
, /* 41 */
71 dst_typ_record
, /* 42 */
72 dst_typ_union
, /* 43 */
73 dst_typ_aux_type_deriv
, /* 44 */
74 dst_typ_locpool
, /* 45 */
75 dst_typ_variable
, /* 46 */
76 dst_typ_label
, /* 47 */
77 dst_typ_entry
, /* 48 */
78 dst_typ_aux_lifetime
, /* 49 */
79 dst_typ_aux_ptr_base
, /* 50 */
80 dst_typ_aux_src_range
, /* 51 */
81 dst_typ_aux_reg_val
, /* 52 */
82 dst_typ_aux_unit_names
, /* 53 */
83 dst_typ_aux_sect_info
, /* 54 */
90 ** Dummy bounds for variably dimensioned arrays:
92 #define dst_dummy_array_size 100
96 ** Reference to another item in the symbol table.
98 ** The value of a dst_rel_offset_t is the relative offset from the start of the
99 ** referencing record to the start of the referenced record, string, etc.
101 ** The value of a NIL dst_rel_offset_t is zero.
104 typedef long dst_rel_offset_t ALIGNED1
;
107 /* FIXME: Here and many places we make assumptions about sizes of host
108 data types, structure layout, etc. Only needs to be fixed if we care
109 about cross-debugging, though. */
112 ** Section-relative reference.
114 ** The section index field is an index into the local compilation unit's
115 ** section table (see dst_rec_section_tab_t)--NOT into the object module
118 ** The sect_offset field is the offset in bytes into the section.
120 ** A NIL dst_sect_ref_t has a sect_index field of zero. Indexes originate
126 unsigned short sect_index
;
127 unsigned long sect_offset ALIGNED1
;
131 #define dst_sect_index_nil 0
132 #define dst_sect_index_origin 1
136 ** Source location descriptor.
138 ** The file_index field is an index into the local compilation unit's
139 ** file table (see dst_rec_file_tab_t).
141 ** A NIL dst_src_loc_t has a file_index field of zero. Indexes originate
147 boolean reserved
:1; /* reserved for future use */
148 int file_index
:11; /* index into .blocks source file list */
149 int line_number
:20; /* source line number */
153 #define dst_file_index_nil 0
154 #define dst_file_index_origin 1
158 ** Standard (primitive) type codes.
164 dst_int8_type
, /* 8 bit integer */
165 dst_int16_type
, /* 16 bit integer */
166 dst_int32_type
, /* 32 bit integer */
167 dst_uint8_type
, /* 8 bit unsigned integer */
168 dst_uint16_type
, /* 16 bit unsigned integer */
169 dst_uint32_type
, /* 32 bit unsigned integer */
170 dst_real32_type
, /* single precision ieee floatining point */
171 dst_real64_type
, /* double precision ieee floatining point */
172 dst_complex_type
, /* single precision complex */
173 dst_dcomplex_type
, /* double precision complex */
174 dst_bool8_type
, /* boolean =logical*1 */
175 dst_bool16_type
, /* boolean =logical*2 */
176 dst_bool32_type
, /* boolean =logical*4 */
177 dst_char_type
, /* 8 bit ascii character */
178 dst_string_type
, /* string of 8 bit ascii characters */
179 dst_ptr_type
, /* univ_pointer */
180 dst_set_type
, /* generic 256 bit set */
181 dst_proc_type
, /* generic procedure (signature not specified) */
182 dst_func_type
, /* generic function (signature not specified) */
183 dst_void_type
, /* c void type */
184 dst_uchar_type
, /* c unsigned char */
185 dst_std_type_END_OF_ENUM
191 ** General data type descriptor
193 ** If the user_defined_type bit is clear, then the type is a standard type, and
194 ** the remaining bits contain the dst_std_type_t of the type. If the bit is
195 ** set, then the type is defined in a separate dst record, which is referenced
196 ** by the remaining bits as a dst_rel_offset_t.
203 boolean user_defined_type
:1; /* tag field */
204 int must_be_zero
:23; /* 23 bits of pad */
205 dst_std_type_t dtc
:8; /* 8 bit primitive data */
211 boolean user_defined_type
:1; /* tag field */
212 int doffset
:31; /* offset to type record */
218 /* The user_type.doffset field is a 31-bit signed value. Some versions of C
219 do not support signed bit fields. The following macro will extract that
220 field as a signed value:
222 #define dst_user_type_offset(type_rec) \
223 ( ((int) ((type_rec).user_type.doffset << 1)) >> 1 )
226 /*================================================*/
227 /*========== RECORDS IN .blocks SECTION ==========*/
228 /*================================================*/
230 /*-----------------------
231 COMPILATION UNIT record
232 -----------------------
233 This must be the first record in each .blocks section.
234 Provides a set of information describing the output of a single compilation
235 and pointers to additional information for the compilation unit.
240 dst_pc_code_locs
, /* ranges in loc strings are pc ranges */
241 dst_comp_unit_END_OF_ENUM
243 dst_comp_unit_flag_t
;
247 dst_lang_unk
, /* unknown language */
248 dst_lang_pas
, /* Pascal */
249 dst_lang_ftn
, /* FORTRAN */
251 dst_lang_mod2
, /* Modula-2 */
252 dst_lang_asm_m68k
, /* 68K assembly language */
253 dst_lang_asm_a88k
, /* AT assembly language */
254 dst_lang_ada
, /* Ada */
255 dst_lang_cxx
, /* C++ */
264 unsigned char major_part
; /* = dst_version_major */
265 unsigned char minor_part
; /* = dst_version_minor */
267 version
; /* version of dst */
268 unsigned short flags
; /* mask of dst_comp_unit_flag_t */
269 unsigned short lang_type
; /* source language */
270 unsigned short number_of_blocks
; /* number of blocks records */
271 dst_rel_offset_t root_block_offset
; /* offset to root block (module?) */
272 dst_rel_offset_t section_table
/* offset to section table record */ ;
273 dst_rel_offset_t file_table
; /* offset to file table record */
274 unsigned long data_size
; /* total size of .blocks data */
276 dst_rec_comp_unit_t ALIGNED1
;
279 /*--------------------
282 There must be one section table associated with each compilation unit.
283 Other debug records refer to sections via their index in this table. The
284 section base addresses in the table are virtual addresses of the sections,
285 relocated by the linker.
290 unsigned short number_of_sections
; /* size of array: */
291 unsigned long section_base
[dst_dummy_array_size
] ALIGNED1
;
293 dst_rec_section_tab_t ALIGNED1
;
299 There must be one file table associated with each compilation unit describing
300 the source (and include) files used by each compilation unit. Other debug
301 records refer to files via their index in this table. The first entry is the
307 long dtm
; /* time last modified (time_$clock_t) */
308 dst_rel_offset_t noffset
; /* offset to name string for source file */
314 unsigned short number_of_files
; /* size of array: */
315 dst_file_desc_t files
[dst_dummy_array_size
] ALIGNED1
;
317 dst_rec_file_tab_t ALIGNED1
;
323 A name table record may appear as an auxiliary record to the file table,
324 providing additional qualification of the file indexes for languages that
325 need it (i.e. Ada). Name table entries parallel file table entries of the
331 unsigned short number_of_names
; /* size of array: */
332 dst_rel_offset_t names
[dst_dummy_array_size
] ALIGNED1
;
334 dst_rec_name_tab_t ALIGNED1
;
340 Describes a lexical program block--a procedure, function, module, etc.
343 /* Block types. These may be used in any way desired by the compiler writers.
344 The debugger uses them only to give a description to the user of the type of
345 a block. The debugger makes no other assumptions about the meaning of any
346 of these. For example, the fact that a block is executable (e.g., program)
347 or not (e.g., module) is expressed in block attributes (see below), not
348 guessed at from the block type.
352 dst_block_module
, /* some pascal = modula = ada types */
355 dst_block_function
, /* C function */
356 dst_block_subroutine
, /* some fortran block types */
357 dst_block_block_data
,
358 dst_block_stmt_function
,
359 dst_block_package
, /* a few particular to Ada */
360 dst_block_package_body
,
363 dst_block_file
, /* a C outer scope? */
364 dst_block_class
, /* C++ or Simula */
365 dst_block_END_OF_ENUM
369 /* Block attributes. This is the information used by the debugger to represent
370 the semantics of blocks.
374 dst_block_main_entry
, /* the block's entry point is a main entry into
375 the compilation unit */
376 dst_block_executable
, /* the block has an entry point */
377 dst_block_attr_END_OF_ENUM
381 /* Code range. Each block has associated with it one or more code ranges. An
382 individual code range is identified by a range of source (possibly nil) and
383 a range of executable code. For example, a block which has its executable
384 code spread over multiple sections will have one code range per section.
388 unsigned long code_size
; /* size of executable code (in bytes ) */
389 dst_sect_ref_t code_start
; /* starting address of executable code */
390 dst_sect_ref_t lines_start
; /* start of line number tables */
396 dst_block_type_t block_type
:8;
397 unsigned short flags
:8; /* mask of dst_block_attr_t flags */
398 dst_rel_offset_t sibling_block_off
; /* offset to next sibling block */
399 dst_rel_offset_t child_block_off
; /* offset to first contained block */
400 dst_rel_offset_t noffset
; /* offset to block name string */
401 dst_sect_ref_t symbols_start
; /* start of debug symbols */
402 unsigned short n_of_code_ranges
; /* size of array... */
403 dst_code_range_t code_ranges
[dst_dummy_array_size
] ALIGNED1
;
405 dst_rec_block_t ALIGNED1
;
408 /*--------------------------
409 AUX SECT INFO TABLE record
410 --------------------------
411 Appears as an auxiliary to a block record. Expands code range information
412 by providing references into additional, language-dependent sections for
413 information related to specific code ranges of the block. Sect info table
414 entries parallel code range array entries of the same index.
419 unsigned char tag
; /* currently can only be zero */
420 unsigned char number_of_refs
; /* size of array: */
421 dst_sect_ref_t refs
[dst_dummy_array_size
] ALIGNED1
;
423 dst_rec_sect_info_tab_t ALIGNED1
;
425 /*=================================================*/
426 /*========== RECORDS IN .symbols SECTION ==========*/
427 /*=================================================*/
432 Describes a symbolic constant.
437 float r
; /* real part */
438 float i
; /* imaginary part */
444 double dr
; /* real part */
445 double di
; /* imaginary part */
447 dst_double_complex_t
;
449 /* The following record provides a way of describing constant values with
450 non-standard type and no limit on size.
454 char char_data
[dst_dummy_array_size
];
455 short int_data
[dst_dummy_array_size
];
456 long long_data
[dst_dummy_array_size
];
460 /* Representation of the value of a general constant.
464 unsigned short length
; /* size of constant value (bytes) */
468 unsigned short kon_int8
;
470 long kon_int32 ALIGNED1
;
471 float kon_real ALIGNED1
;
472 double kon_dbl ALIGNED1
;
473 dst_complex_t kon_cplx ALIGNED1
;
474 dst_double_complex_t kon_dcplx ALIGNED1
;
476 dst_big_kon_t kon ALIGNED1
;
478 val
; /* value data of constant */
480 dst_const_t ALIGNED1
;
484 dst_rel_offset_t noffset
; /* offset to name string */
485 dst_src_loc_t src_loc
; /* file/line of const definition */
486 dst_type_t type_desc
; /* type of this (manifest) constant */
489 dst_rec_const_t ALIGNED1
;
494 Describes a program variable.
497 /* Variable attributes. These define certain variable semantics to the
502 dst_var_attr_read_only
, /* is read-only (a program literal) */
503 dst_var_attr_volatile
, /* same as compiler's VOLATILE attribute */
504 dst_var_attr_global
, /* is a global definition or reference */
505 dst_var_attr_compiler_gen
, /* is compiler-generated */
506 dst_var_attr_static
, /* has static location */
507 dst_var_attr_END_OF_ENUM
513 dst_rel_offset_t noffset
; /* offset to name string */
514 dst_rel_offset_t loffset
; /* offset to loc string */
515 dst_src_loc_t src_loc
; /* file/line of variable definition */
516 dst_type_t type_desc
; /* type descriptor */
517 unsigned short attributes
; /* mask of dst_var_attr_t flags */
519 dst_rec_variable_t ALIGNED1
;
525 Used by older compilers to describe a variable
530 dst_var_loc_unknown
, /* Actually defined as "unknown" */
531 dst_var_loc_abs
, /* Absolute address */
532 dst_var_loc_sect_off
, /* Absolute address as a section offset */
533 dst_var_loc_ind_sect_off
, /* An indexed section offset ???? */
534 dst_var_loc_reg
, /* register */
535 dst_var_loc_reg_rel
, /* register relative - usually fp */
536 dst_var_loc_ind_reg_rel
, /* Indexed register relative */
537 dst_var_loc_ftn_ptr_based
, /* Fortran pointer based */
538 dst_var_loc_pc_rel
, /* PC relative. Really. */
539 dst_var_loc_external
, /* External */
540 dst_var_loc_END_OF_ENUM
544 /* Locations come in two versions. The short, and the long. The difference
545 * between the short and the long is the addition of a statement number
546 * field to the start andend of the range of the long, and and unkown
547 * purpose field in the middle. Also, loc_type and loc_index aren't
548 * bitfields in the long version.
553 unsigned short loc_type
:4;
554 unsigned short loc_index
:12;
556 short start_line
; /* start_line and end_line? */
557 short end_line
; /* I'm guessing here. */
563 unsigned short loc_type
;
564 unsigned short loc_index
;
566 short unknown
; /* Always 0003 or 3b3c. Why? */
567 short start_statement
;
577 dst_rel_offset_t noffset
; /* offset to name string */
578 dst_src_loc_t src_loc
; /* file/line of description */
579 dst_type_t type_desc
; /* Type description */
580 unsigned short attributes
; /* mask of dst_var_attr_t flags */
581 unsigned short no_of_locs
:15; /* Number of locations */
582 unsigned short short_locs
:1; /* True if short locations. */
585 dst_var_loc_short_t shorts
[dst_dummy_array_size
];
586 dst_var_loc_long_t longs
[dst_dummy_array_size
];
595 Used by older compilers to describe a label
600 dst_rel_offset_t noffset
; /* offset to name string */
601 dst_src_loc_t src_loc
; /* file/line of description */
602 char location
[12]; /* location string */
604 dst_rec_old_label_t ALIGNED1
;
609 Describes a pointer type.
614 dst_rel_offset_t noffset
; /* offset to the name string for this type */
615 dst_src_loc_t src_loc
; /* file/line of definition */
616 dst_type_t type_desc
; /* base type of this pointer */
618 dst_rec_pointer_t ALIGNED1
;
624 Describes an array type.
626 Multidimensional arrays are described with a number of dst_rec_array_t
627 records, one per array dimension, each linked to the next through the
628 elem_type_desc.doffset field. Each record must have its multi_dim flag
631 If column_major is true (as with FORTRAN arrays) then the last array bound in
632 the declaration is the first array index in memory, which is the opposite of
633 the usual case (as with Pascal and C arrays).
635 Variable array bounds are described by auxiliary records; if aux_var_bound
636 records are present, the lo_bound and hi_bound fields of this record are
637 ignored by the debugger.
639 span_comp identifies one of the language-dependent ways in which the distance
640 between successive array elements (span) is calculated.
641 dst_use_span_field -- the span is the value of span field.
642 dst_compute_from_prev -- the span is the size of the previous dimension.
643 dst_compute_from_next -- the span is the size of the next dimension.
644 In the latter two cases, the span field contains an amount of padding to add
645 to the size of the appropriate dimension to calculate the span.
651 dst_compute_from_prev
,
652 dst_compute_from_next
,
653 dst_span_comp_END_OF_ENUM
659 dst_rel_offset_t noffset
; /* offset to name string */
660 dst_src_loc_t src_loc
; /* file/line of definition */
661 dst_type_t elem_type_desc
; /* array element type */
662 dst_type_t indx_type_desc
; /* array index type */
663 long lo_bound
; /* lower bound of index */
664 long hi_bound
; /* upper bound of index */
665 unsigned long span
; /* see above */
666 unsigned long size
; /* total array size (bytes) */
668 boolean is_packed
:1; /* true if packed array */
669 boolean is_signed
:1; /* true if packed elements are signed */
670 dst_span_comp_t span_comp
:2; /* how to compute span */
671 boolean column_major
:1;
672 unsigned short reserved
:2; /* must be zero */
673 unsigned short elem_size
:8; /* element size if packed (bits) */
675 dst_rec_array_t ALIGNED1
;
681 Describes a subrange type.
684 /* Variable subrange bounds are described by auxiliary records; if aux_var_bound
685 records are present, the lo_bound and hi_bound fields of this record are
686 ignored by the debugger.
691 dst_rel_offset_t noffset
; /* offset to name string */
692 dst_src_loc_t src_loc
; /* file/line of subrange definition */
693 dst_type_t type_desc
; /* parent type */
694 long lo_bound
; /* lower bound of subrange */
695 long hi_bound
; /* upper bound of subrange */
696 unsigned short size
; /* storage size (bytes) */
698 dst_rec_subrange_t ALIGNED1
;
704 Describes a string type.
707 /* Variable subrange bounds are described by auxiliary records; if aux_var_bound
708 records are present, the lo_bound and hi_bound fields of this record are
709 ignored by the debugger.
714 dst_rel_offset_t noffset
; /* offset to name string */
715 dst_src_loc_t src_loc
; /* file/line of string definition */
716 dst_type_t elem_type_desc
; /* element type */
717 dst_type_t indx_type_desc
; /* index type */
718 long lo_bound
; /* lower bound */
719 long hi_bound
; /* upper bound */
720 unsigned long size
; /* total string size (bytes) if fixed */
722 dst_rec_string_t ALIGNED1
;
728 Describes a set type.
733 dst_rel_offset_t noffset
; /* offset to name string */
734 dst_src_loc_t src_loc
; /* file/line of definition */
735 dst_type_t type_desc
; /* element type */
736 unsigned short nbits
; /* number of bits in set */
737 unsigned short size
; /* storage size (bytes) */
739 dst_rec_set_t ALIGNED1
;
742 /*-----------------------------
743 IMPLICIT ENUMERATION record
744 -----------------------------
745 Describes an enumeration type with implicit element values = 0, 1, 2, ...
751 dst_rel_offset_t noffset
; /* offset to name string */
752 dst_src_loc_t src_loc
; /* file/line of definition */
753 unsigned short nelems
; /* number of elements in enumeration */
754 unsigned short size
; /* storage size (bytes) */
755 /* offsets to name strings of elements 0, 1, 2, ... */
756 dst_rel_offset_t elem_noffsets
[dst_dummy_array_size
];
758 dst_rec_implicit_enum_t ALIGNED1
;
761 /*-----------------------------
762 EXPLICIT ENUMERATION record
763 -----------------------------
764 Describes an enumeration type with explicitly assigned element values
770 dst_rel_offset_t noffset
; /* offset to element name string */
771 long value
; /* element value */
777 dst_rel_offset_t noffset
; /* offset to name string */
778 dst_src_loc_t src_loc
; /* file/line of definition */
779 unsigned short nelems
; /* number of elements in enumeration */
780 unsigned short size
; /* storage size (bytes) */
781 /* name/value pairs, one describing each enumeration value: */
782 dst_enum_elem_t elems
[dst_dummy_array_size
];
784 dst_rec_explicit_enum_t ALIGNED1
;
787 /*-----------------------
788 RECORD / UNION record
789 -----------------------
790 Describes a record (struct) or union.
792 If the record is larger than 2**16 bytes then an attached aux record
793 specifies its size. Also, if the record is stored in short form then
794 attached records specify field offsets larger than 2**16 bytes.
796 Whether the fields[] array or sfields[] array is used is selected by
797 the dst_rec_type_t of the overall dst record.
801 Record field descriptor, short form. This form handles only fields which
802 are an even number of bytes long, located some number of bytes from the
807 dst_rel_offset_t noffset
; /* offset to field name string */
808 dst_type_t type_desc
; /* field type */
809 unsigned short foffset
; /* field offset from start of record (bytes) */
811 dst_short_field_t ALIGNED1
;
815 dst_rel_offset_t noffset
; /* offset to name string */
816 dst_type_t type_desc
; /* field type */
817 unsigned short foffset
; /* byte offset */
818 unsigned short is_packed
:1; /* True if field is packed */
819 unsigned short bit_offset
:6; /* Bit offset */
820 unsigned short size
:6; /* Size in bits */
821 unsigned short sign
:1; /* True if signed */
822 unsigned short pad
:2; /* Padding. Must be 0 */
824 dst_old_field_t ALIGNED1
;
826 /* Tag enumeration for long record field descriptor:
833 dst_field_END_OF_ENUM
838 Record field descriptor, long form. The format of the field information
839 is identified by the format_tag, which contains one of the above values.
840 The field_byte variant is equivalent to the short form of field descriptor.
841 The field_bit variant handles fields which are any number of bits long,
842 located some number of bits from the start of the record. The field_loc
843 variant allows the location of the field to be described by a general loc
848 dst_rel_offset_t noffset
; /* offset to name of field */
849 dst_type_t type_desc
; /* type of field */
854 dst_field_format_t format_tag
:2; /* dst_field_byte */
855 unsigned long offset
:30; /* offset of field in bytes */
860 dst_field_format_t format_tag
:2; /* dst_field_bit */
861 unsigned long nbits
:6; /* bit size of field */
862 unsigned long is_signed
:1; /* signed/unsigned attribute */
863 unsigned long bit_offset
:3; /* bit offset from byte boundary */
864 int pad
:4; /* must be zero */
865 unsigned short byte_offset
; /* offset of byte boundary */
870 dst_field_format_t format_tag
:2; /* dst_field_loc */
871 int loffset
:30; /* dst_rel_offset_t to loc string */
879 /* The field_loc.loffset field is a 30-bit signed value. Some versions of C do
880 not support signed bit fields. The following macro will extract that field
883 #define dst_field_loffset(field_rec) \
884 ( ((int) ((field_rec).f.field_loc.loffset << 2)) >> 2 )
889 dst_rel_offset_t noffset
; /* offset to record name string */
890 dst_src_loc_t src_loc
; /* file/line where this record is defined */
891 unsigned short size
; /* storage size (bytes) */
892 unsigned short nfields
; /* number of fields in this record */
895 dst_field_t fields
[dst_dummy_array_size
];
896 dst_short_field_t sfields
[dst_dummy_array_size
];
897 dst_old_field_t ofields
[dst_dummy_array_size
];
899 f
; /* array of fields */
901 dst_rec_record_t ALIGNED1
;
907 Describes a file type.
912 dst_rel_offset_t noffset
; /* offset to name string */
913 dst_src_loc_t src_loc
; /* file/line where type was defined */
914 dst_type_t type_desc
; /* file element type */
916 dst_rec_file_t ALIGNED1
;
922 Describes a Pascal offset type.
923 (This type, an undocumented Domain Pascal extension, is currently not
924 supported by the debugger)
929 dst_rel_offset_t noffset
; /* offset to the name string */
930 dst_src_loc_t src_loc
; /* file/line of definition */
931 dst_type_t area_type_desc
; /* area type */
932 dst_type_t base_type_desc
; /* base type */
933 long lo_bound
; /* low bound of the offset range */
934 long hi_bound
; /* high bound of the offset range */
935 long bias
; /* bias */
936 unsigned short scale
; /* scale factor */
937 unsigned short size
; /* storage size (bytes) */
939 dst_rec_offset_t ALIGNED1
;
945 Describes a type alias (e.g., typedef).
950 dst_rel_offset_t noffset
; /* offset to name string */
951 dst_src_loc_t src_loc
; /* file/line of definition */
952 dst_type_t type_desc
; /* parent type */
954 dst_rec_alias_t ALIGNED1
;
960 Describes a procedure/function type.
963 /* Enumeration of argument semantics. Note that most are mutually
968 dst_arg_attr_val
, /* passed by value */
969 dst_arg_attr_ref
, /* passed by reference */
970 dst_arg_attr_name
, /* passed by name */
971 dst_arg_attr_in
, /* readable in the callee */
972 dst_arg_attr_out
, /* writable in the callee */
973 dst_arg_attr_hidden
, /* not visible in the caller */
974 dst_arg_attr_END_OF_ENUM
978 /* Argument descriptor. Actually points to a variable record for most of the
983 dst_rel_offset_t var_offset
; /* offset to variable record */
984 unsigned short attributes
; /* a mask of dst_arg_attr_t flags */
990 dst_rel_offset_t noffset
; /* offset to name string */
991 dst_src_loc_t src_loc
; /* file/line of function definition */
992 dst_rel_offset_t result
; /* offset to function result variable record */
993 unsigned short nargs
; /* number of arguments */
994 dst_arg_t args
[dst_dummy_array_size
];
996 dst_rec_signature_t ALIGNED1
;
1001 Obsolete. Use the new ENTRY type instead.
1002 Old compilers may put this in as the first entry in a function,
1003 terminated by an end of scope entry.
1008 dst_rel_offset_t noffset
; /* Name offset */
1009 dst_src_loc_t start_line
; /* Starting line */
1010 dst_src_loc_t end_line
; /* Ending line */
1012 dst_rec_scope_t ALIGNED1
;
1017 Describes a procedure/function entry point. An entry record is to a
1018 signature record roughly as a variable record is to a type descriptor record.
1020 The entry_number field is keyed to the entry numbers in .lines -- the
1021 debugger locates the code location of an entry by searching the line
1022 number table for an entry numbered with the value of entry_number. The
1023 main entry is numbered zero.
1028 dst_rel_offset_t noffset
; /* offset to entry name string */
1029 dst_rel_offset_t loffset
; /* where to jump to call this entry */
1030 dst_src_loc_t src_loc
; /* file/line of definition */
1031 dst_rel_offset_t sig_desc
; /* offset to signature descriptor */
1032 unsigned int entry_number
:8;
1033 int pad
:8; /* must be zero */
1035 dst_rec_entry_t ALIGNED1
;
1037 /*-----------------------
1038 Old format ENTRY record
1039 -----------------------
1040 Supposedly obsolete but still used by some compilers.
1045 dst_rel_offset_t noffset
; /* Offset to entry name string */
1046 dst_src_loc_t src_loc
; /* Location in source */
1047 dst_rel_offset_t sig_desc
; /* Signature description */
1050 dst_rec_old_entry_t ALIGNED1
;
1055 Describes a program label.
1060 dst_rel_offset_t noffset
; /* offset to label string */
1061 dst_rel_offset_t loffset
; /* offset to loc string */
1062 dst_src_loc_t src_loc
; /* file/line of definition */
1064 dst_rec_label_t ALIGNED1
;
1067 /*-----------------------
1068 AUXILIARY SIZE record
1069 -----------------------
1070 May appear in the auxiliary record list of any type or variable record to
1071 modify the default size of the type or variable.
1076 unsigned long size
; /* size (bytes) */
1078 dst_rec_aux_size_t ALIGNED1
;
1081 /*-----------------------
1082 AUXILIARY ALIGN record
1083 -----------------------
1084 May appear in the auxiliary record list of any type or variable record to
1085 modify the default alignment of the type or variable.
1090 unsigned short alignment
; /* # of low order zero bits */
1092 dst_rec_aux_align_t ALIGNED1
;
1095 /*-----------------------------
1096 AUXILIARY FIELD SIZE record
1097 -----------------------------
1098 May appear in the auxiliary record list of any RECORD/UNION record to
1099 modify the default size of a field.
1104 unsigned short field_no
; /* field number */
1105 unsigned long size
; /* size (bits) */
1107 dst_rec_aux_field_size_t ALIGNED1
;
1111 /*-----------------------------
1112 AUXILIARY FIELD OFFSET record
1113 -----------------------------
1114 May appear in the auxiliary record list of any RECORD/UNION record to
1115 specify a field offset larger than 2**16.
1120 unsigned short field_no
; /* field number */
1121 unsigned long foffset
; /* offset */
1123 dst_rec_aux_field_off_t ALIGNED1
;
1126 /*-----------------------------
1127 AUXILIARY FIELD ALIGN record
1128 -----------------------------
1129 May appear in the auxiliary record list of any RECORD/UNION record to
1130 modify the default alignment of a field.
1135 unsigned short field_no
; /* field number */
1136 unsigned short alignment
; /* number of low order zero bits */
1138 dst_rec_aux_field_align_t ALIGNED1
;
1141 /*----------------------------
1142 AUXILIARY VAR BOUND record
1143 ----------------------------
1144 May appear in the auxiliary record list of any ARRAY, SUBRANGE or STRING
1145 record to describe a variable bound for the range of the type.
1150 dst_low_bound
, /* the low bound is variable */
1151 dst_high_bound
, /* the high bound is variable */
1152 dst_var_bound_END_OF_ENUM
1158 unsigned short which
; /* which bound */
1159 dst_rel_offset_t voffset ALIGNED1
; /* variable that defines bound */
1161 dst_rec_aux_var_bound_t ALIGNED1
;
1164 /*----------------------------------
1165 AUXILIARY TYPE DERIVATION record
1166 ----------------------------------
1167 May appear in the auxiliary record list of any RECORD/UNION record to denote
1168 class inheritance of that type from a parent type.
1170 Inheritance implies that it is possible to convert the inheritor type to the
1171 inherited type, retaining those fields which were inherited. To allow this,
1172 orig_field_no, a field number into the record type, is provided. If
1173 orig_is_pointer is false, then the start of the inherited record is located
1174 at the location of the field indexed by orig_field_no. If orig_is_pointer
1175 is true, then it is located at the address contained in the field indexed
1176 by orig_field_no (assumed to be a pointer).
1181 dst_type_t parent_type
; /* reference to inherited type */
1182 unsigned short orig_field_no
;
1183 boolean orig_is_pointer
:1;
1184 int unused
:15; /* must be zero */
1186 dst_rec_aux_type_deriv_t ALIGNED1
;
1189 /*------------------------------------
1190 AUXILIARY VARIABLE LIFETIME record
1191 ------------------------------------
1192 May appear in the auxiliary record list of a VARIABLE record to add location
1193 information for an additional variable lifetime.
1198 dst_rel_offset_t loffset
;
1200 dst_rec_aux_lifetime_t ALIGNED1
;
1203 /*-------------------------------
1204 AUXILIARY POINTER BASE record
1205 -------------------------------
1206 May appear in the auxiliary record list of a VARIABLE record to provide a
1207 pointer base to substitute for references to any such bases in the location
1208 string of the variable. A pointer base is another VARIABLE record. When
1209 the variable is evaluated by the debugger, it uses the current value of the
1210 pointer base variable in computing its location.
1212 This is useful for representing FORTRAN pointer-based variables.
1217 dst_rel_offset_t voffset
;
1219 dst_rec_aux_ptr_base_t ALIGNED1
;
1222 /*---------------------------------
1223 AUXILIARY REGISTER VALUE record
1224 ---------------------------------
1225 May appear in the auxiliary record list of an ENTRY record to specify
1226 a register that must be set to a specific value before jumping to the entry
1227 point in a debugger "call". The debugger must set the debuggee register,
1228 specified by the register code, to the value of the *address* to which the
1229 location string resolves. If the address is register-relative, then the
1230 call cannot be made unless the current stack frame is the lexical parent
1231 of the entry. An example of this is when a (Pascal) nested procedure
1232 contains references to its parent's variables, which it accesses through
1233 a static link register. The static link register must be set to some
1234 address relative to the parent's stack base register.
1239 unsigned short reg
; /* identifies register to set (isp enum) */
1240 dst_rel_offset_t loffset
; /* references a location string */
1242 dst_rec_aux_reg_val_t ALIGNED1
;
1245 /*==========================================================*/
1246 /*========== RECORDS USED IN .blocks AND .symbols ==========*/
1247 /*==========================================================*/
1249 /*---------------------
1251 ---------------------
1252 A string table record contains any number of null-terminated, variable length
1253 strings. The length field gives the size in bytes of the text field, which
1256 The global name table shares this format. This record appears in the
1257 .blocks section. Each string in the table identifies a global defined in
1258 the current compilation unit.
1260 The loc pool record shares this format as well. Loc strings are described
1266 unsigned long length
;
1267 char text
[dst_dummy_array_size
];
1269 dst_rec_string_tab_t ALIGNED1
;
1272 /*-----------------------
1273 AUXILIARY QUAL record
1274 -----------------------
1275 May appear in the auxiliary record list of any BLOCK, VARIABLE, or type record
1276 to provide it with a fully-qualified, language-dependent name.
1281 dst_rel_offset_t lang_qual_name
;
1283 dst_rec_aux_qual_t ALIGNED1
;
1289 Reference to a record somewhere else. This allows identical definitions in
1290 different scopes to share data.
1295 dst_rel_offset_t rec_off
;
1297 dst_rec_forward_t ALIGNED1
;
1300 /*-------------------------------
1301 AUXILIARY SOURCE RANGE record
1302 -------------------------------
1303 May appear in the auxiliary record list of any BLOCK record to specify a
1304 range of source lines over which the block is active.
1309 dst_src_loc_t first_line
; /* first source line */
1310 dst_src_loc_t last_line
; /* last source line */
1312 dst_rec_aux_src_range_t ALIGNED1
;
1315 /*------------------
1318 Provision for "foreign" records, such as might be generated by a non-Apollo
1319 compiler. Apollo software will ignore these.
1324 unsigned short rec_size
; /* record size (bytes) */
1325 unsigned short ext_type
; /* defined by whoever generates it */
1326 unsigned short ext_data
; /* place-holder for arbitrary amount of data */
1328 dst_rec_extension_t ALIGNED1
;
1332 ** DEBUG SYMBOL record -- The wrapper for all .blocks and .symbols records.
1334 ** This record ties together all previous .blocks and .symbols records
1335 ** together in a union with a common header. The rec_type field of the
1336 ** header identifies the record type. The rec_flags field currently only
1337 ** defines auxiliary record lists.
1339 ** If a record carries with it a non-null auxiliary record list, its
1340 ** dst_flag_has_aux_recs flag is set, and each of the records that follow
1341 ** it are treated as its auxiliary records, until the end of the compilation
1342 ** unit or scope is reached, or until an auxiliary record with its
1343 ** dst_flag_last_aux_rec flag set is reached.
1348 dst_flag_has_aux_recs
,
1349 dst_flag_last_aux_rec
,
1350 dst_rec_flag_END_OF_ENUM
1356 dst_rec_type_t rec_type
:8; /* record type */
1357 int rec_flags
:8; /* mask of dst_rec_flags_t */
1358 union /* switched on rec_type field above */
1360 /* dst_typ_pad requires no additional fields */
1361 dst_rec_comp_unit_t comp_unit_
;
1362 dst_rec_section_tab_t section_tab_
;
1363 dst_rec_file_tab_t file_tab_
;
1364 dst_rec_block_t block_
;
1366 dst_rec_pointer_t pointer_
;
1367 dst_rec_array_t array_
;
1368 dst_rec_subrange_t subrange_
;
1370 dst_rec_implicit_enum_t implicit_enum_
;
1371 dst_rec_explicit_enum_t explicit_enum_
;
1372 /* dst_typ_short_{rec,union} are represented by 'rec' (below) */
1373 dst_rec_file_t file_
;
1374 dst_rec_offset_t offset_
;
1375 dst_rec_alias_t alias_
;
1376 dst_rec_signature_t signature_
;
1377 dst_rec_old_label_t old_label_
;
1378 dst_rec_scope_t scope_
;
1379 /* dst_typ_end_scope requires no additional fields */
1380 dst_rec_string_tab_t string_tab_
;
1381 /* dst_typ_global_name_tab is represented by 'string_tab' (above) */
1382 dst_rec_forward_t forward_
;
1383 dst_rec_aux_size_t aux_size_
;
1384 dst_rec_aux_align_t aux_align_
;
1385 dst_rec_aux_field_size_t aux_field_size_
;
1386 dst_rec_aux_field_off_t aux_field_off_
;
1387 dst_rec_aux_field_align_t aux_field_align_
;
1388 dst_rec_aux_qual_t aux_qual_
;
1389 dst_rec_aux_var_bound_t aux_var_bound_
;
1390 dst_rec_extension_t extension_
;
1391 dst_rec_string_t string_
;
1392 dst_rec_const_t const_
;
1393 /* dst_typ_reference is represented by 'pointer' (above) */
1394 dst_rec_record_t record_
;
1395 /* dst_typ_union is represented by 'record' (above) */
1396 dst_rec_aux_type_deriv_t aux_type_deriv_
;
1397 /* dst_typ_locpool is represented by 'string_tab' (above) */
1398 dst_rec_variable_t variable_
;
1399 dst_rec_label_t label_
;
1400 dst_rec_entry_t entry_
;
1401 dst_rec_aux_lifetime_t aux_lifetime_
;
1402 dst_rec_aux_ptr_base_t aux_ptr_base_
;
1403 dst_rec_aux_src_range_t aux_src_range_
;
1404 dst_rec_aux_reg_val_t aux_reg_val_
;
1405 dst_rec_name_tab_t aux_unit_names_
;
1406 dst_rec_sect_info_tab_t aux_sect_info_
;
1410 dst_rec_t
, *dst_rec_ptr_t
;
1413 /*===============================================*/
1414 /*========== .lines SECTION DEFINITIONS =========*/
1415 /*===============================================*/
1417 The .lines section contains a sequence of line number tables. There is no
1418 record structure within the section. The start of the table for a routine
1419 is pointed to by the block record, and the end of the table is signaled by
1422 A line number table is a sequence of bytes. The default entry contains a line
1423 number delta (-7..+7) in the high 4 bits and a pc delta (0..15) in the low 4
1424 bits. Special cases, including when one or both of the values is too large
1425 to fit in 4 bits and other special cases are handled through escape entries.
1426 Escape entries are identified by the value 0x8 in the high 4 bits. The low 4
1427 bits are occupied by a function code. Some escape entries are followed by
1428 additional arguments, which may be bytes, words, or longwords. This data is
1431 The initial PC offset, file number and line number are zero. Normally, the
1432 table begins with a dst_ln_file escape which establishes the initial file
1433 and line number. All PC deltas are unsigned (thus the table is ordered by
1434 increasing PC); line number deltas are signed. The table ends with a
1435 dst_ln_end escape, which is followed by a final table entry whose PC delta
1436 gives the code size of the last statement.
1439 --------- ------------------------------------------------------------
1440 file Changes file state. The current source file remains constant
1441 until another file escape. Though the line number state is
1442 also updated by a file escape, a file escape does NOT
1443 constitute a line table entry.
1445 statement Alters the statement number of the next table entry. By
1446 default, all table entries refer to the first statement on a
1447 line. Statement number one is the second statement, and so on.
1449 entry Identifies the next table entry as the position of an entry
1450 point for the current block. The PC position should follow
1451 any procedure prologue code. An argument specifies the entry
1452 number, which is keyed to the entry number of the corresponding
1453 .symbols ENTRY record.
1455 exit Identifies the next table entry as the last position within
1456 the current block before a procedure epiloge and subsequent
1459 gap By default, the executable code corresponding to a table entry
1460 is assumed to extend to the beginning of the next table entry.
1461 If this is not the case--there is a "hole" in the table--then
1462 a gap escape should follow the first table entry to specify
1463 where the code for that entry ends.
1466 #define dst_ln_escape_flag -8
1469 Escape function codes:
1473 dst_ln_pad
, /* pad byte */
1474 dst_ln_file
, /* file escape. Next 4 bytes are a dst_src_loc_t */
1475 dst_ln_dln1_dpc1
, /* 1 byte line delta, 1 byte pc delta */
1476 dst_ln_dln2_dpc2
, /* 2 bytes line delta, 2 bytes pc delta */
1477 dst_ln_ln4_pc4
, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */
1478 dst_ln_dln1_dpc0
, /* 1 byte line delta, pc delta = 0 */
1479 dst_ln_ln_off_1
, /* statement escape, stmt # = 1 (2nd stmt on line) */
1480 dst_ln_ln_off
, /* statement escape, stmt # = next byte */
1481 dst_ln_entry
, /* entry escape, next byte is entry number */
1482 dst_ln_exit
, /* exit escape */
1483 dst_ln_stmt_end
, /* gap escape, 4 bytes pc delta */
1484 dst_ln_escape_11
, /* reserved */
1485 dst_ln_escape_12
, /* reserved */
1486 dst_ln_escape_13
, /* reserved */
1487 dst_ln_nxt_byte
, /* next byte contains the real escape code */
1488 dst_ln_end
, /* end escape, final entry follows */
1489 dst_ln_escape_END_OF_ENUM
1494 Line number table entry
1500 unsigned int ln_delta
:4; /* 4 bit line number delta */
1501 unsigned int pc_delta
:4; /* 4 bit pc delta */
1507 unsigned int esc_flag
:4; /* alias for ln_delta */
1508 dst_ln_escape_t esc_code
:4; /* escape function code */
1512 char sdata
; /* signed data byte */
1513 unsigned char udata
; /* unsigned data byte */
1516 *dst_ln_entry_ptr_t
,
1517 dst_ln_table_t
[dst_dummy_array_size
];
1519 /* The following macro will extract the ln_delta field as a signed value:
1521 #define dst_ln_ln_delta(ln_rec) \
1522 ( ((short) ((ln_rec).delta.ln_delta << 12)) >> 12 )
1527 typedef struct dst_sec_struct
1537 /* Macros for access to the data */
1539 #define DST_comp_unit(x) ((x)->rec_data.comp_unit_)
1540 #define DST_section_tab(x) ((x)->rec_data.section_tab_)
1541 #define DST_file_tab(x) ((x)->rec_data.file_tab_)
1542 #define DST_block(x) ((x)->rec_data.block_)
1543 #define DST_var(x) ((x)->rec_data.var_)
1544 #define DST_pointer(x) ((x)->rec_data.pointer_)
1545 #define DST_array(x) ((x)->rec_data.array_)
1546 #define DST_subrange(x) ((x)->rec_data.subrange_)
1547 #define DST_set(x) ((x)->rec_data.set_)
1548 #define DST_implicit_enum(x) ((x)->rec_data.implicit_enum_)
1549 #define DST_explicit_enum(x) ((x)->rec_data.explicit_enum_)
1550 #define DST_short_rec(x) ((x)->rec_data.record_)
1551 #define DST_short_union(x) ((x)->rec_data.record_)
1552 #define DST_file(x) ((x)->rec_data.file_)
1553 #define DST_offset(x) ((x)->rec_data.offset_)
1554 #define DST_alias(x) ((x)->rec_data.alias_)
1555 #define DST_signature(x) ((x)->rec_data.signature_)
1556 #define DST_old_label(x) ((x)->rec_data.old_label_)
1557 #define DST_scope(x) ((x)->rec_data.scope_)
1558 #define DST_string_tab(x) ((x)->rec_data.string_tab_)
1559 #define DST_global_name_tab(x) ((x)->rec_data.string_tab_)
1560 #define DST_forward(x) ((x)->rec_data.forward_)
1561 #define DST_aux_size(x) ((x)->rec_data.aux_size_)
1562 #define DST_aux_align(x) ((x)->rec_data.aux_align_)
1563 #define DST_aux_field_size(x) ((x)->rec_data.aux_field_size_)
1564 #define DST_aux_field_off(x) ((x)->rec_data.aux_field_off_)
1565 #define DST_aux_field_align(x) ((x)->rec_data.aux_field_align_)
1566 #define DST_aux_qual(x) ((x)->rec_data.aux_qual_)
1567 #define DST_aux_var_bound(x) ((x)->rec_data.aux_var_bound_)
1568 #define DST_extension(x) ((x)->rec_data.extension_)
1569 #define DST_string(x) ((x)->rec_data.string_)
1570 #define DST_const(x) ((x)->rec_data.const_)
1571 #define DST_reference(x) ((x)->rec_data.pointer_)
1572 #define DST_record(x) ((x)->rec_data.record_)
1573 #define DST_union(x) ((x)->rec_data.record_)
1574 #define DST_aux_type_deriv(x) ((x)->rec_data.aux_type_deriv_)
1575 #define DST_locpool(x) ((x)->rec_data.string_tab_)
1576 #define DST_variable(x) ((x)->rec_data.variable_)
1577 #define DST_label(x) ((x)->rec_data.label_)
1578 #define DST_entry(x) ((x)->rec_data.entry_)
1579 #define DST_aux_lifetime(x) ((x)->rec_data.aux_lifetime_)
1580 #define DST_aux_ptr_base(x) ((x)->rec_data.aux_ptr_base_)
1581 #define DST_aux_src_range(x) ((x)->rec_data.aux_src_range_)
1582 #define DST_aux_reg_val(x) ((x)->rec_data.aux_reg_val_)
1583 #define DST_aux_unit_names(x) ((x)->rec_data.aux_unit_names_)
1584 #define DST_aux_sect_info(x) ((x)->rec_data.aux_sect_info_)
1588 * Type codes for loc strings. I'm not entirely certain about all of
1589 * these, but they seem to work.
1590 * troy@cbme.unsw.EDU.AU
1591 * If you find a variable whose location can't be decoded, you should
1592 * find out it's code using "dstdump -s filename". It will record an
1593 * entry for the variable, and give a text representation of what
1594 * the locstring means. Before that explaination there will be a
1595 * number. In the LOCSTRING table, that number will appear before
1596 * the start of the location string. Location string codes are
1597 * five bit codes with a 3 bit argument. Check the high 5 bits of
1598 * the one byte code, and figure out where it goes in here.
1599 * Then figure out exactly what the meaning is and code it in
1602 * Note that ranged locs mean that the variable is in different locations
1603 * depending on the current PC. We ignore these because (a) gcc can't handle
1604 * them, and (b), If you don't use high levels of optimisation they won't
1609 dst_lsc_end
, /* End of string */
1610 dst_lsc_indirect
, /* Indirect through previous. Arg == 6 */
1611 /* Or register ax (x=arg) */
1612 dst_lsc_dreg
, /* register dx (x=arg) */
1614 dst_lsc_section
, /* Section (arg+1) */
1617 dst_lsc_add
, /* Add (arg+1)*2 */
1618 dst_lsc_sub
, /* Subtract (arg+1)*2 */
1621 dst_lsc_sec_byte
, /* Section of next byte+1 */
1622 dst_lsc_add_byte
, /* Add next byte (arg == 5) or next word
1625 dst_lsc_sub_byte
, /* Subtract next byte. (arg == 1) or next
1628 dst_lsc_sbreg
, /* Stack base register (frame pointer). Arg==0 */
1630 dst_lsc_ranged
, /* location is pc dependent */
1647 dst_loc_string_code_t
;
1649 /* If the following occurs after an addition/subtraction, that addition
1650 * or subtraction should be multiplied by 256. It's a complete byte, not
1654 #define dst_multiply_256 ((char) 0x73)
1661 dst_loc_header_t ALIGNED1
;
1665 dst_loc_header_t header
;
1668 dst_loc_entry_t ALIGNED1
;
1671 #endif /* apollo_dst_h */