SDB-and-DWARF.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>GNU Compiler Collection (GCC) Internals: SDB and DWARF</title>
  20. <meta name="description" content="GNU Compiler Collection (GCC) Internals: SDB and DWARF">
  21. <meta name="keywords" content="GNU Compiler Collection (GCC) Internals: SDB and DWARF">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Debugging-Info.html#Debugging-Info" rel="up" title="Debugging Info">
  30. <link href="VMS-Debug.html#VMS-Debug" rel="next" title="VMS Debug">
  31. <link href="File-Names-and-DBX.html#File-Names-and-DBX" rel="prev" title="File Names and DBX">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style:oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="SDB-and-DWARF"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="VMS-Debug.html#VMS-Debug" accesskey="n" rel="next">VMS Debug</a>, Previous: <a href="File-Names-and-DBX.html#File-Names-and-DBX" accesskey="p" rel="prev">File Names and DBX</a>, Up: <a href="Debugging-Info.html#Debugging-Info" accesskey="u" rel="up">Debugging Info</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="Macros-for-SDB-and-DWARF-Output"></a>
  69. <h4 class="subsection">17.21.5 Macros for SDB and DWARF Output</h4>
  70. <p>Here are macros for SDB and DWARF output.
  71. </p>
  72. <dl>
  73. <dt><a name="index-SDB_005fDEBUGGING_005fINFO"></a>Macro: <strong>SDB_DEBUGGING_INFO</strong></dt>
  74. <dd><p>Define this macro to 1 if GCC should produce COFF-style debugging output
  75. for SDB in response to the <samp>-g</samp> option.
  76. </p></dd></dl>
  77. <dl>
  78. <dt><a name="index-DWARF2_005fDEBUGGING_005fINFO"></a>Macro: <strong>DWARF2_DEBUGGING_INFO</strong></dt>
  79. <dd><p>Define this macro if GCC should produce dwarf version 2 format
  80. debugging output in response to the <samp>-g</samp> option.
  81. </p>
  82. <dl>
  83. <dt><a name="index-TARGET_005fDWARF_005fCALLING_005fCONVENTION"></a>Target Hook: <em>int</em> <strong>TARGET_DWARF_CALLING_CONVENTION</strong> <em>(const_tree <var>function</var>)</em></dt>
  84. <dd><p>Define this to enable the dwarf attribute <code>DW_AT_calling_convention</code> to
  85. be emitted for each function. Instead of an integer return the enum
  86. value for the <code>DW_CC_</code> tag.
  87. </p></dd></dl>
  88. <p>To support optional call frame debugging information, you must also
  89. define <code>INCOMING_RETURN_ADDR_RTX</code> and either set
  90. <code>RTX_FRAME_RELATED_P</code> on the prologue insns if you use RTL for the
  91. prologue, or call <code>dwarf2out_def_cfa</code> and <code>dwarf2out_reg_save</code>
  92. as appropriate from <code>TARGET_ASM_FUNCTION_PROLOGUE</code> if you don&rsquo;t.
  93. </p></dd></dl>
  94. <dl>
  95. <dt><a name="index-DWARF2_005fFRAME_005fINFO"></a>Macro: <strong>DWARF2_FRAME_INFO</strong></dt>
  96. <dd><p>Define this macro to a nonzero value if GCC should always output
  97. Dwarf 2 frame information. If <code>TARGET_EXCEPT_UNWIND_INFO</code>
  98. (see <a href="Exception-Region-Output.html#Exception-Region-Output">Exception Region Output</a>) returns <code>UI_DWARF2</code>, and
  99. exceptions are enabled, GCC will output this information not matter
  100. how you define <code>DWARF2_FRAME_INFO</code>.
  101. </p></dd></dl>
  102. <dl>
  103. <dt><a name="index-TARGET_005fDEBUG_005fUNWIND_005fINFO"></a>Target Hook: <em>enum unwind_info_type</em> <strong>TARGET_DEBUG_UNWIND_INFO</strong> <em>(void)</em></dt>
  104. <dd><p>This hook defines the mechanism that will be used for describing frame
  105. unwind information to the debugger. Normally the hook will return
  106. <code>UI_DWARF2</code> if DWARF 2 debug information is enabled, and
  107. return <code>UI_NONE</code> otherwise.
  108. </p>
  109. <p>A target may return <code>UI_DWARF2</code> even when DWARF 2 debug information
  110. is disabled in order to always output DWARF 2 frame information.
  111. </p>
  112. <p>A target may return <code>UI_TARGET</code> if it has ABI specified unwind tables.
  113. This will suppress generation of the normal debug frame unwind information.
  114. </p></dd></dl>
  115. <dl>
  116. <dt><a name="index-DWARF2_005fASM_005fLINE_005fDEBUG_005fINFO"></a>Macro: <strong>DWARF2_ASM_LINE_DEBUG_INFO</strong></dt>
  117. <dd><p>Define this macro to be a nonzero value if the assembler can generate Dwarf 2
  118. line debug info sections. This will result in much more compact line number
  119. tables, and hence is desirable if it works.
  120. </p></dd></dl>
  121. <dl>
  122. <dt><a name="index-TARGET_005fWANT_005fDEBUG_005fPUB_005fSECTIONS"></a>Target Hook: <em>bool</em> <strong>TARGET_WANT_DEBUG_PUB_SECTIONS</strong></dt>
  123. <dd><p>True if the <code>.debug_pubtypes</code> and <code>.debug_pubnames</code> sections should be emitted. These sections are not used on most platforms, and in particular GDB does not use them.
  124. </p></dd></dl>
  125. <dl>
  126. <dt><a name="index-TARGET_005fDELAY_005fSCHED2"></a>Target Hook: <em>bool</em> <strong>TARGET_DELAY_SCHED2</strong></dt>
  127. <dd><p>True if sched2 is not to be run at its normal place.
  128. This usually means it will be run as part of machine-specific reorg.
  129. </p></dd></dl>
  130. <dl>
  131. <dt><a name="index-TARGET_005fDELAY_005fVARTRACK"></a>Target Hook: <em>bool</em> <strong>TARGET_DELAY_VARTRACK</strong></dt>
  132. <dd><p>True if vartrack is not to be run at its normal place.
  133. This usually means it will be run as part of machine-specific reorg.
  134. </p></dd></dl>
  135. <dl>
  136. <dt><a name="index-TARGET_005fNO_005fREGISTER_005fALLOCATION"></a>Target Hook: <em>bool</em> <strong>TARGET_NO_REGISTER_ALLOCATION</strong></dt>
  137. <dd><p>True if register allocation and the passes
  138. following it should not be run. Usually true only for virtual assembler
  139. targets.
  140. </p></dd></dl>
  141. <dl>
  142. <dt><a name="index-ASM_005fOUTPUT_005fDWARF_005fDELTA"></a>Macro: <strong>ASM_OUTPUT_DWARF_DELTA</strong> <em>(<var>stream</var>, <var>size</var>, <var>label1</var>, <var>label2</var>)</em></dt>
  143. <dd><p>A C statement to issue assembly directives that create a difference
  144. <var>lab1</var> minus <var>lab2</var>, using an integer of the given <var>size</var>.
  145. </p></dd></dl>
  146. <dl>
  147. <dt><a name="index-ASM_005fOUTPUT_005fDWARF_005fVMS_005fDELTA"></a>Macro: <strong>ASM_OUTPUT_DWARF_VMS_DELTA</strong> <em>(<var>stream</var>, <var>size</var>, <var>label1</var>, <var>label2</var>)</em></dt>
  148. <dd><p>A C statement to issue assembly directives that create a difference
  149. between the two given labels in system defined units, e.g. instruction
  150. slots on IA64 VMS, using an integer of the given size.
  151. </p></dd></dl>
  152. <dl>
  153. <dt><a name="index-ASM_005fOUTPUT_005fDWARF_005fOFFSET"></a>Macro: <strong>ASM_OUTPUT_DWARF_OFFSET</strong> <em>(<var>stream</var>, <var>size</var>, <var>label</var>, <var>offset</var>, <var>section</var>)</em></dt>
  154. <dd><p>A C statement to issue assembly directives that create a
  155. section-relative reference to the given <var>label</var> plus <var>offset</var>, using
  156. an integer of the given <var>size</var>. The label is known to be defined in the
  157. given <var>section</var>.
  158. </p></dd></dl>
  159. <dl>
  160. <dt><a name="index-ASM_005fOUTPUT_005fDWARF_005fPCREL"></a>Macro: <strong>ASM_OUTPUT_DWARF_PCREL</strong> <em>(<var>stream</var>, <var>size</var>, <var>label</var>)</em></dt>
  161. <dd><p>A C statement to issue assembly directives that create a self-relative
  162. reference to the given <var>label</var>, using an integer of the given <var>size</var>.
  163. </p></dd></dl>
  164. <dl>
  165. <dt><a name="index-ASM_005fOUTPUT_005fDWARF_005fDATAREL"></a>Macro: <strong>ASM_OUTPUT_DWARF_DATAREL</strong> <em>(<var>stream</var>, <var>size</var>, <var>label</var>)</em></dt>
  166. <dd><p>A C statement to issue assembly directives that create a reference to the
  167. given <var>label</var> relative to the dbase, using an integer of the given <var>size</var>.
  168. </p></dd></dl>
  169. <dl>
  170. <dt><a name="index-ASM_005fOUTPUT_005fDWARF_005fTABLE_005fREF"></a>Macro: <strong>ASM_OUTPUT_DWARF_TABLE_REF</strong> <em>(<var>label</var>)</em></dt>
  171. <dd><p>A C statement to issue assembly directives that create a reference to
  172. the DWARF table identifier <var>label</var> from the current section. This
  173. is used on some systems to avoid garbage collecting a DWARF table which
  174. is referenced by a function.
  175. </p></dd></dl>
  176. <dl>
  177. <dt><a name="index-TARGET_005fASM_005fOUTPUT_005fDWARF_005fDTPREL"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_OUTPUT_DWARF_DTPREL</strong> <em>(FILE *<var>file</var>, int <var>size</var>, rtx <var>x</var>)</em></dt>
  178. <dd><p>If defined, this target hook is a function which outputs a DTP-relative
  179. reference to the given TLS symbol of the specified size.
  180. </p></dd></dl>
  181. <dl>
  182. <dt><a name="index-PUT_005fSDB_005f"></a>Macro: <strong>PUT_SDB_</strong> <em>&hellip;</em></dt>
  183. <dd><p>Define these macros to override the assembler syntax for the special
  184. SDB assembler directives. See <samp>sdbout.c</samp> for a list of these
  185. macros and their arguments. If the standard syntax is used, you need
  186. not define them yourself.
  187. </p></dd></dl>
  188. <dl>
  189. <dt><a name="index-SDB_005fDELIM"></a>Macro: <strong>SDB_DELIM</strong></dt>
  190. <dd><p>Some assemblers do not support a semicolon as a delimiter, even between
  191. SDB assembler directives. In that case, define this macro to be the
  192. delimiter to use (usually &lsquo;<samp>\n</samp>&rsquo;). It is not necessary to define
  193. a new set of <code>PUT_SDB_<var>op</var></code> macros if this is the only change
  194. required.
  195. </p></dd></dl>
  196. <dl>
  197. <dt><a name="index-SDB_005fALLOW_005fUNKNOWN_005fREFERENCES"></a>Macro: <strong>SDB_ALLOW_UNKNOWN_REFERENCES</strong></dt>
  198. <dd><p>Define this macro to allow references to unknown structure,
  199. union, or enumeration tags to be emitted. Standard COFF does not
  200. allow handling of unknown references, MIPS ECOFF has support for
  201. it.
  202. </p></dd></dl>
  203. <dl>
  204. <dt><a name="index-SDB_005fALLOW_005fFORWARD_005fREFERENCES"></a>Macro: <strong>SDB_ALLOW_FORWARD_REFERENCES</strong></dt>
  205. <dd><p>Define this macro to allow references to structure, union, or
  206. enumeration tags that have not yet been seen to be handled. Some
  207. assemblers choke if forward tags are used, while some require it.
  208. </p></dd></dl>
  209. <dl>
  210. <dt><a name="index-SDB_005fOUTPUT_005fSOURCE_005fLINE"></a>Macro: <strong>SDB_OUTPUT_SOURCE_LINE</strong> <em>(<var>stream</var>, <var>line</var>)</em></dt>
  211. <dd><p>A C statement to output SDB debugging information before code for line
  212. number <var>line</var> of the current source file to the stdio stream
  213. <var>stream</var>. The default is to emit an <code>.ln</code> directive.
  214. </p></dd></dl>
  215. <hr>
  216. <div class="header">
  217. <p>
  218. Next: <a href="VMS-Debug.html#VMS-Debug" accesskey="n" rel="next">VMS Debug</a>, Previous: <a href="File-Names-and-DBX.html#File-Names-and-DBX" accesskey="p" rel="prev">File Names and DBX</a>, Up: <a href="Debugging-Info.html#Debugging-Info" accesskey="u" rel="up">Debugging Info</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  219. </div>
  220. </body>
  221. </html>