xref: /openbsd/gnu/usr.bin/gcc/gcc/vmsdbg.h (revision c87b03e5)
1*c87b03e5Sespie /* Definitions for the data structures and codes used in VMS debugging.
2*c87b03e5Sespie    Copyright (C) 2001 Free Software Foundation, Inc.
3*c87b03e5Sespie 
4*c87b03e5Sespie This file is part of GCC.
5*c87b03e5Sespie 
6*c87b03e5Sespie GCC is free software; you can redistribute it and/or modify it under
7*c87b03e5Sespie the terms of the GNU General Public License as published by the Free
8*c87b03e5Sespie Software Foundation; either version 2, or (at your option) any later
9*c87b03e5Sespie version.
10*c87b03e5Sespie 
11*c87b03e5Sespie GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12*c87b03e5Sespie WARRANTY; without even the implied warranty of MERCHANTABILITY or
13*c87b03e5Sespie FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14*c87b03e5Sespie for more details.
15*c87b03e5Sespie 
16*c87b03e5Sespie You should have received a copy of the GNU General Public License
17*c87b03e5Sespie along with GCC; see the file COPYING.  If not, write to the Free
18*c87b03e5Sespie Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19*c87b03e5Sespie 02111-1307, USA.  */
20*c87b03e5Sespie 
21*c87b03e5Sespie #ifndef GCC_VMSDBG_H
22*c87b03e5Sespie #define GCC_VMSDBG_H 1
23*c87b03e5Sespie 
24*c87b03e5Sespie /*  We define types and constants used in VMS Debug output.  Note that the
25*c87b03e5Sespie     structs only approximate the output that is written.  We write the output
26*c87b03e5Sespie     explicitly, field by field.  This output would only agree with the
27*c87b03e5Sespie     structs in this file if no padding were done.  The sizes after each
28*c87b03e5Sespie     struct are the size actually written, which is usually smaller than the
29*c87b03e5Sespie     size of the struct.  */
30*c87b03e5Sespie 
31*c87b03e5Sespie /* Header type codes.  */
32*c87b03e5Sespie typedef enum _DST_TYPE {DST_K_SOURCE = 155, DST_K_PROLOG = 162,
33*c87b03e5Sespie 			DST_K_BLKBEG = 176, DST_K_BLKEND = 177,
34*c87b03e5Sespie 			DST_K_LINE_NUM = 185, DST_K_MODBEG = 188,
35*c87b03e5Sespie 			DST_K_MODEND = 189, DST_K_RTNBEG = 190,
36*c87b03e5Sespie 			DST_K_RTNEND = 191} DST_DTYPE;
37*c87b03e5Sespie 
38*c87b03e5Sespie /* Header.  */
39*c87b03e5Sespie 
40*c87b03e5Sespie typedef struct _DST_HEADER
41*c87b03e5Sespie {
42*c87b03e5Sespie   union
43*c87b03e5Sespie     {
44*c87b03e5Sespie       unsigned short int dst_w_length;
45*c87b03e5Sespie       unsigned short int dst_x_length;
46*c87b03e5Sespie     } dst__header_length;
47*c87b03e5Sespie   union
48*c87b03e5Sespie     {
49*c87b03e5Sespie       ENUM_BITFIELD (_DST_TYPE) dst_w_type : 16;
50*c87b03e5Sespie       ENUM_BITFIELD (_DST_TYPE) dst_x_type : 16;
51*c87b03e5Sespie     } dst__header_type;
52*c87b03e5Sespie } DST_HEADER;
53*c87b03e5Sespie #define DST_K_DST_HEADER_SIZE sizeof 4
54*c87b03e5Sespie 
55*c87b03e5Sespie /* Language type codes.  */
56*c87b03e5Sespie typedef enum _DST_LANGUAGE {DST_K_FORTRAN = 1, DST_K_C = 7, DST_K_ADA = 9,
57*c87b03e5Sespie 			    DST_K_UNKNOWN = 10, DST_K_CXX = 15} DST_LANGUAGE;
58*c87b03e5Sespie 
59*c87b03e5Sespie /* Module header (a module is the result of a single compilation).  */
60*c87b03e5Sespie 
61*c87b03e5Sespie typedef struct _DST_MODULE_BEGIN
62*c87b03e5Sespie {
63*c87b03e5Sespie   DST_HEADER dst_a_modbeg_header;
64*c87b03e5Sespie   struct
65*c87b03e5Sespie     {
66*c87b03e5Sespie       unsigned dst_v_modbeg_hide : 1;
67*c87b03e5Sespie       unsigned dst_v_modbeg_version : 1;
68*c87b03e5Sespie       unsigned dst_v_modbeg_unused : 6;
69*c87b03e5Sespie     } dst_b_modbeg_flags;
70*c87b03e5Sespie   unsigned char dst_b_modbeg_unused;
71*c87b03e5Sespie   DST_LANGUAGE dst_l_modbeg_language;
72*c87b03e5Sespie   unsigned short int dst_w_version_major;
73*c87b03e5Sespie   unsigned short int dst_w_version_minor;
74*c87b03e5Sespie   unsigned char dst_b_modbeg_name;
75*c87b03e5Sespie } DST_MODULE_BEGIN;
76*c87b03e5Sespie #define DST_K_MODBEG_SIZE 15
77*c87b03e5Sespie 
78*c87b03e5Sespie /* Module trailer.  */
79*c87b03e5Sespie 
80*c87b03e5Sespie typedef struct _DST_MB_TRLR
81*c87b03e5Sespie {
82*c87b03e5Sespie   unsigned char dst_b_compiler;
83*c87b03e5Sespie } DST_MB_TRLR;
84*c87b03e5Sespie 
85*c87b03e5Sespie #define DST_K_MB_TRLR_SIZE 1
86*c87b03e5Sespie 
87*c87b03e5Sespie #define DST_K_VERSION_MAJOR 1
88*c87b03e5Sespie #define DST_K_VERSION_MINOR 13
89*c87b03e5Sespie 
90*c87b03e5Sespie typedef struct _DST_MODULE_END
91*c87b03e5Sespie {
92*c87b03e5Sespie   DST_HEADER dst_a_modend_header;
93*c87b03e5Sespie } DST_MODULE_END;
94*c87b03e5Sespie #define DST_K_MODEND_SIZE sizeof 4
95*c87b03e5Sespie 
96*c87b03e5Sespie /* Routine header.  */
97*c87b03e5Sespie 
98*c87b03e5Sespie typedef struct _DST_ROUTINE_BEGIN
99*c87b03e5Sespie {
100*c87b03e5Sespie   DST_HEADER dst_a_rtnbeg_header;
101*c87b03e5Sespie   struct
102*c87b03e5Sespie     {
103*c87b03e5Sespie       unsigned dst_v_rtnbeg_unused : 4;
104*c87b03e5Sespie       unsigned dst_v_rtnbeg_unalloc : 1;
105*c87b03e5Sespie       unsigned dst_v_rtnbeg_prototype : 1;
106*c87b03e5Sespie       unsigned dst_v_rtnbeg_inlined : 1;
107*c87b03e5Sespie       unsigned dst_v_rtnbeg_no_call : 1;
108*c87b03e5Sespie     } dst_b_rtnbeg_flags;
109*c87b03e5Sespie   int *dst_l_rtnbeg_address;
110*c87b03e5Sespie   int *dst_l_rtnbeg_pd_address;
111*c87b03e5Sespie   unsigned char dst_b_rtnbeg_name;
112*c87b03e5Sespie } DST_ROUTINE_BEGIN;
113*c87b03e5Sespie #define DST_K_RTNBEG_SIZE 14
114*c87b03e5Sespie 
115*c87b03e5Sespie /* Routine trailer */
116*c87b03e5Sespie 
117*c87b03e5Sespie typedef struct _DST_ROUTINE_END
118*c87b03e5Sespie {
119*c87b03e5Sespie   DST_HEADER dst_a_rtnend_header;
120*c87b03e5Sespie   char dst_b_rtnend_unused;
121*c87b03e5Sespie   unsigned int dst_l_rtnend_size;
122*c87b03e5Sespie } DST_ROUTINE_END;
123*c87b03e5Sespie #define DST_K_RTNEND_SIZE 9
124*c87b03e5Sespie 
125*c87b03e5Sespie /* Block header.  */
126*c87b03e5Sespie 
127*c87b03e5Sespie typedef struct _DST_BLOCK_BEGIN
128*c87b03e5Sespie {
129*c87b03e5Sespie   DST_HEADER dst_a_blkbeg_header;
130*c87b03e5Sespie   unsigned char dst_b_blkbeg_unused;
131*c87b03e5Sespie   int *dst_l_blkbeg_address;
132*c87b03e5Sespie   unsigned char dst_b_blkbeg_name;
133*c87b03e5Sespie } DST_BLOCK_BEGIN;
134*c87b03e5Sespie #define DST_K_BLKBEG_SIZE 10
135*c87b03e5Sespie 
136*c87b03e5Sespie /* Block trailer.  */
137*c87b03e5Sespie 
138*c87b03e5Sespie typedef struct _DST_BLOCK_END
139*c87b03e5Sespie {
140*c87b03e5Sespie   DST_HEADER dst_a_blkend_header;
141*c87b03e5Sespie   unsigned char dst_b_blkend_unused;
142*c87b03e5Sespie   unsigned int dst_l_blkend_size;
143*c87b03e5Sespie } DST_BLOCK_END;
144*c87b03e5Sespie #define DST_K_BLKEND_SIZE 9
145*c87b03e5Sespie 
146*c87b03e5Sespie /* Line number header.  */
147*c87b03e5Sespie 
148*c87b03e5Sespie typedef struct _DST_LINE_NUM_HEADER
149*c87b03e5Sespie {
150*c87b03e5Sespie   DST_HEADER dst_a_line_num_header;
151*c87b03e5Sespie } DST_LINE_NUM_HEADER;
152*c87b03e5Sespie #define DST_K_LINE_NUM_HEADER_SIZE 4
153*c87b03e5Sespie 
154*c87b03e5Sespie /* PC to Line number correlation.  */
155*c87b03e5Sespie 
156*c87b03e5Sespie typedef struct _DST_PCLINE_COMMANDS
157*c87b03e5Sespie {
158*c87b03e5Sespie   char dst_b_pcline_command;
159*c87b03e5Sespie   union
160*c87b03e5Sespie     {
161*c87b03e5Sespie       unsigned int dst_l_pcline_unslong;
162*c87b03e5Sespie       unsigned short int dst_w_pcline_unsword;
163*c87b03e5Sespie       unsigned char dst_b_pcline_unsbyte;
164*c87b03e5Sespie     } dst_a_pcline_access_fields;
165*c87b03e5Sespie } DST_PCLINE_COMMANDS;
166*c87b03e5Sespie 
167*c87b03e5Sespie /* PC and Line number correlation codes.  */
168*c87b03e5Sespie 
169*c87b03e5Sespie #define DST_K_PCLINE_COMMANDS_SIZE 5
170*c87b03e5Sespie #define DST_K_PCLINE_COMMANDS_SIZE_MIN 2
171*c87b03e5Sespie #define DST_K_PCLINE_COMMANDS_SIZE_MAX 5
172*c87b03e5Sespie #define DST_K_DELTA_PC_LOW -128
173*c87b03e5Sespie #define DST_K_DELTA_PC_HIGH 0
174*c87b03e5Sespie #define DST_K_DELTA_PC_W 1
175*c87b03e5Sespie #define DST_K_INCR_LINUM 2
176*c87b03e5Sespie #define DST_K_INCR_LINUM_W 3
177*c87b03e5Sespie #define DST_K_SET_LINUM 9
178*c87b03e5Sespie #define DST_K_SET_ABS_PC 16
179*c87b03e5Sespie #define DST_K_DELTA_PC_L 17
180*c87b03e5Sespie #define DST_K_INCR_LINUM_L 18
181*c87b03e5Sespie #define DST_K_SET_LINUM_B 19
182*c87b03e5Sespie #define DST_K_SET_LINUM_L 20
183*c87b03e5Sespie 
184*c87b03e5Sespie /* Source file correlation header.  */
185*c87b03e5Sespie 
186*c87b03e5Sespie typedef struct _DST_SOURCE_CORR
187*c87b03e5Sespie {
188*c87b03e5Sespie   DST_HEADER dst_a_source_corr_header;
189*c87b03e5Sespie } DST_SOURCE_CORR;
190*c87b03e5Sespie #define DST_K_SOURCE_CORR_HEADER_SIZE 4
191*c87b03e5Sespie 
192*c87b03e5Sespie /* Source file correlation codes.  */
193*c87b03e5Sespie 
194*c87b03e5Sespie #define DST_K_SRC_DECLFILE 1
195*c87b03e5Sespie #define DST_K_SRC_SETFILE 2
196*c87b03e5Sespie #define DST_K_SRC_SETREC_L 3
197*c87b03e5Sespie #define DST_K_SRC_SETREC_W 4
198*c87b03e5Sespie #define DST_K_SRC_SETLNUM_L 5
199*c87b03e5Sespie #define DST_K_SRC_SETLNUM_W 6
200*c87b03e5Sespie #define DST_K_SRC_INCRLNUM_B 7
201*c87b03e5Sespie #define DST_K_SRC_DEFLINES_W 10
202*c87b03e5Sespie #define DST_K_SRC_DEFLINES_B 11
203*c87b03e5Sespie #define DST_K_SRC_FORMFEED 16
204*c87b03e5Sespie #define DST_K_SRC_MIN_CMD 1
205*c87b03e5Sespie #define DST_K_SRC_MAX_CMD 16
206*c87b03e5Sespie 
207*c87b03e5Sespie /* Source file header.  */
208*c87b03e5Sespie 
209*c87b03e5Sespie typedef struct _DST_SRC_COMMAND
210*c87b03e5Sespie {
211*c87b03e5Sespie   unsigned char dst_b_src_command;
212*c87b03e5Sespie   union
213*c87b03e5Sespie     {
214*c87b03e5Sespie       struct
215*c87b03e5Sespie 	{
216*c87b03e5Sespie 	  unsigned char dst_b_src_df_length;
217*c87b03e5Sespie 	  unsigned char dst_b_src_df_flags;
218*c87b03e5Sespie 	  unsigned short int dst_w_src_df_fileid;
219*c87b03e5Sespie #ifdef HAVE_LONG_LONG
220*c87b03e5Sespie 	  long long dst_q_src_df_rms_cdt;
221*c87b03e5Sespie #else
222*c87b03e5Sespie #ifdef HAVE___INT64
223*c87b03e5Sespie 	  __int64 dst_q_src_df_rms_cdt;
224*c87b03e5Sespie #endif
225*c87b03e5Sespie #endif
226*c87b03e5Sespie 	  unsigned int dst_l_src_df_rms_ebk;
227*c87b03e5Sespie 	  unsigned short int dst_w_src_df_rms_ffb;
228*c87b03e5Sespie 	  unsigned char dst_b_src_df_rms_rfo;
229*c87b03e5Sespie 	  unsigned char dst_b_src_df_filename;
230*c87b03e5Sespie 	} dst_a_src_decl_src;
231*c87b03e5Sespie       unsigned int dst_l_src_unslong;
232*c87b03e5Sespie       unsigned short int dst_w_src_unsword;
233*c87b03e5Sespie       unsigned char dst_b_src_unsbyte;
234*c87b03e5Sespie     } dst_a_src_cmd_fields;
235*c87b03e5Sespie } DST_SRC_COMMAND;
236*c87b03e5Sespie #define DST_K_SRC_COMMAND_SIZE 21
237*c87b03e5Sespie 
238*c87b03e5Sespie /* Source file trailer.  */
239*c87b03e5Sespie 
240*c87b03e5Sespie typedef struct _DST_SRC_CMDTRLR
241*c87b03e5Sespie {
242*c87b03e5Sespie   unsigned char dst_b_src_df_libmodname;
243*c87b03e5Sespie } DST_SRC_CMDTRLR;
244*c87b03e5Sespie #define DST_K_SRC_CMDTRLR_SIZE 1
245*c87b03e5Sespie 
246*c87b03e5Sespie /* Prolog header.  */
247*c87b03e5Sespie 
248*c87b03e5Sespie typedef struct _DST_PROLOG
249*c87b03e5Sespie {
250*c87b03e5Sespie   DST_HEADER dst_a_prolog_header;
251*c87b03e5Sespie   unsigned int dst_l_prolog_bkpt_addr;
252*c87b03e5Sespie } DST_PROLOG;
253*c87b03e5Sespie #define DST_K_PROLOG_SIZE 8
254*c87b03e5Sespie 
255*c87b03e5Sespie #endif /* GCC_VMSDBG_H */
256