vmsdbg.h 6.4 KB

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