Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

DWARF.html 12KB

3 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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-2020 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 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>DWARF (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="DWARF (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="DWARF (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  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.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="DWARF"></a>
  62. <div class="header">
  63. <p>
  64. 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>
  65. </div>
  66. <hr>
  67. <a name="Macros-for-DWARF-Output"></a>
  68. <h4 class="subsection">18.21.5 Macros for DWARF Output</h4>
  69. <p>Here are macros for DWARF output.
  70. </p>
  71. <dl>
  72. <dt><a name="index-DWARF2_005fDEBUGGING_005fINFO"></a>Macro: <strong>DWARF2_DEBUGGING_INFO</strong></dt>
  73. <dd><p>Define this macro if GCC should produce dwarf version 2 format
  74. debugging output in response to the <samp>-g</samp> option.
  75. </p>
  76. <dl>
  77. <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>
  78. <dd><p>Define this to enable the dwarf attribute <code>DW_AT_calling_convention</code> to
  79. be emitted for each function. Instead of an integer return the enum
  80. value for the <code>DW_CC_</code> tag.
  81. </p></dd></dl>
  82. <p>To support optional call frame debugging information, you must also
  83. define <code>INCOMING_RETURN_ADDR_RTX</code> and either set
  84. <code>RTX_FRAME_RELATED_P</code> on the prologue insns if you use RTL for the
  85. prologue, or call <code>dwarf2out_def_cfa</code> and <code>dwarf2out_reg_save</code>
  86. as appropriate from <code>TARGET_ASM_FUNCTION_PROLOGUE</code> if you don&rsquo;t.
  87. </p></dd></dl>
  88. <dl>
  89. <dt><a name="index-DWARF2_005fFRAME_005fINFO"></a>Macro: <strong>DWARF2_FRAME_INFO</strong></dt>
  90. <dd><p>Define this macro to a nonzero value if GCC should always output
  91. Dwarf 2 frame information. If <code>TARGET_EXCEPT_UNWIND_INFO</code>
  92. (see <a href="Exception-Region-Output.html#Exception-Region-Output">Exception Region Output</a>) returns <code>UI_DWARF2</code>, and
  93. exceptions are enabled, GCC will output this information not matter
  94. how you define <code>DWARF2_FRAME_INFO</code>.
  95. </p></dd></dl>
  96. <dl>
  97. <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>
  98. <dd><p>This hook defines the mechanism that will be used for describing frame
  99. unwind information to the debugger. Normally the hook will return
  100. <code>UI_DWARF2</code> if DWARF 2 debug information is enabled, and
  101. return <code>UI_NONE</code> otherwise.
  102. </p>
  103. <p>A target may return <code>UI_DWARF2</code> even when DWARF 2 debug information
  104. is disabled in order to always output DWARF 2 frame information.
  105. </p>
  106. <p>A target may return <code>UI_TARGET</code> if it has ABI specified unwind tables.
  107. This will suppress generation of the normal debug frame unwind information.
  108. </p></dd></dl>
  109. <dl>
  110. <dt><a name="index-DWARF2_005fASM_005fLINE_005fDEBUG_005fINFO"></a>Macro: <strong>DWARF2_ASM_LINE_DEBUG_INFO</strong></dt>
  111. <dd><p>Define this macro to be a nonzero value if the assembler can generate Dwarf 2
  112. line debug info sections. This will result in much more compact line number
  113. tables, and hence is desirable if it works.
  114. </p></dd></dl>
  115. <dl>
  116. <dt><a name="index-DWARF2_005fASM_005fVIEW_005fDEBUG_005fINFO"></a>Macro: <strong>DWARF2_ASM_VIEW_DEBUG_INFO</strong></dt>
  117. <dd><p>Define this macro to be a nonzero value if the assembler supports view
  118. assignment and verification in <code>.loc</code>. If it does not, but the
  119. user enables location views, the compiler may have to fallback to
  120. internal line number tables.
  121. </p></dd></dl>
  122. <dl>
  123. <dt><a name="index-TARGET_005fRESET_005fLOCATION_005fVIEW"></a>Target Hook: <em>int</em> <strong>TARGET_RESET_LOCATION_VIEW</strong> <em>(rtx_insn *<var></var>)</em></dt>
  124. <dd><p>This hook, if defined, enables -ginternal-reset-location-views, and
  125. uses its result to override cases in which the estimated min insn
  126. length might be nonzero even when a PC advance (i.e., a view reset)
  127. cannot be taken for granted.
  128. </p>
  129. <p>If the hook is defined, it must return a positive value to indicate
  130. the insn definitely advances the PC, and so the view number can be
  131. safely assumed to be reset; a negative value to mean the insn
  132. definitely does not advance the PC, and os the view number must not
  133. be reset; or zero to decide based on the estimated insn length.
  134. </p>
  135. <p>If insn length is to be regarded as reliable, set the hook to
  136. <code>hook_int_rtx_insn_0</code>.
  137. </p></dd></dl>
  138. <dl>
  139. <dt><a name="index-TARGET_005fWANT_005fDEBUG_005fPUB_005fSECTIONS"></a>Target Hook: <em>bool</em> <strong>TARGET_WANT_DEBUG_PUB_SECTIONS</strong></dt>
  140. <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.
  141. </p></dd></dl>
  142. <dl>
  143. <dt><a name="index-TARGET_005fDELAY_005fSCHED2"></a>Target Hook: <em>bool</em> <strong>TARGET_DELAY_SCHED2</strong></dt>
  144. <dd><p>True if sched2 is not to be run at its normal place.
  145. This usually means it will be run as part of machine-specific reorg.
  146. </p></dd></dl>
  147. <dl>
  148. <dt><a name="index-TARGET_005fDELAY_005fVARTRACK"></a>Target Hook: <em>bool</em> <strong>TARGET_DELAY_VARTRACK</strong></dt>
  149. <dd><p>True if vartrack is not to be run at its normal place.
  150. This usually means it will be run as part of machine-specific reorg.
  151. </p></dd></dl>
  152. <dl>
  153. <dt><a name="index-TARGET_005fNO_005fREGISTER_005fALLOCATION"></a>Target Hook: <em>bool</em> <strong>TARGET_NO_REGISTER_ALLOCATION</strong></dt>
  154. <dd><p>True if register allocation and the passes
  155. following it should not be run. Usually true only for virtual assembler
  156. targets.
  157. </p></dd></dl>
  158. <dl>
  159. <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>
  160. <dd><p>A C statement to issue assembly directives that create a difference
  161. <var>lab1</var> minus <var>lab2</var>, using an integer of the given <var>size</var>.
  162. </p></dd></dl>
  163. <dl>
  164. <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>
  165. <dd><p>A C statement to issue assembly directives that create a difference
  166. between the two given labels in system defined units, e.g. instruction
  167. slots on IA64 VMS, using an integer of the given size.
  168. </p></dd></dl>
  169. <dl>
  170. <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>
  171. <dd><p>A C statement to issue assembly directives that create a
  172. section-relative reference to the given <var>label</var> plus <var>offset</var>, using
  173. an integer of the given <var>size</var>. The label is known to be defined in the
  174. given <var>section</var>.
  175. </p></dd></dl>
  176. <dl>
  177. <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>
  178. <dd><p>A C statement to issue assembly directives that create a self-relative
  179. reference to the given <var>label</var>, using an integer of the given <var>size</var>.
  180. </p></dd></dl>
  181. <dl>
  182. <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>
  183. <dd><p>A C statement to issue assembly directives that create a reference to the
  184. given <var>label</var> relative to the dbase, using an integer of the given <var>size</var>.
  185. </p></dd></dl>
  186. <dl>
  187. <dt><a name="index-ASM_005fOUTPUT_005fDWARF_005fTABLE_005fREF"></a>Macro: <strong>ASM_OUTPUT_DWARF_TABLE_REF</strong> <em>(<var>label</var>)</em></dt>
  188. <dd><p>A C statement to issue assembly directives that create a reference to
  189. the DWARF table identifier <var>label</var> from the current section. This
  190. is used on some systems to avoid garbage collecting a DWARF table which
  191. is referenced by a function.
  192. </p></dd></dl>
  193. <dl>
  194. <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>
  195. <dd><p>If defined, this target hook is a function which outputs a DTP-relative
  196. reference to the given TLS symbol of the specified size.
  197. </p></dd></dl>
  198. <hr>
  199. <div class="header">
  200. <p>
  201. 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>
  202. </div>
  203. </body>
  204. </html>