Debugging-Options.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1999-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>The GNU Fortran Compiler: Debugging Options</title>
  20. <meta name="description" content="The GNU Fortran Compiler: Debugging Options">
  21. <meta name="keywords" content="The GNU Fortran Compiler: Debugging Options">
  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="Invoking-GNU-Fortran.html#Invoking-GNU-Fortran" rel="up" title="Invoking GNU Fortran">
  30. <link href="Directory-Options.html#Directory-Options" rel="next" title="Directory Options">
  31. <link href="Error-and-Warning-Options.html#Error-and-Warning-Options" rel="prev" title="Error and Warning Options">
  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="Debugging-Options"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="Directory-Options.html#Directory-Options" accesskey="n" rel="next">Directory Options</a>, Previous: <a href="Error-and-Warning-Options.html#Error-and-Warning-Options" accesskey="p" rel="prev">Error and Warning Options</a>, Up: <a href="Invoking-GNU-Fortran.html#Invoking-GNU-Fortran" accesskey="u" rel="up">Invoking GNU Fortran</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="Options-for-debugging-your-program-or-GNU-Fortran"></a>
  69. <h3 class="section">2.5 Options for debugging your program or GNU Fortran</h3>
  70. <a name="index-options_002c-debugging"></a>
  71. <a name="index-debugging-information-options"></a>
  72. <p>GNU Fortran has various special options that are used for debugging
  73. either your program or the GNU Fortran compiler.
  74. </p>
  75. <dl compact="compact">
  76. <dt><code>-fdump-fortran-original</code></dt>
  77. <dd><a name="index-fdump_002dfortran_002doriginal"></a>
  78. <p>Output the internal parse tree after translating the source program
  79. into internal representation. Only really useful for debugging the
  80. GNU Fortran compiler itself.
  81. </p>
  82. </dd>
  83. <dt><code>-fdump-fortran-optimized</code></dt>
  84. <dd><a name="index-fdump_002dfortran_002doptimized"></a>
  85. <p>Output the parse tree after front-end optimization. Only really
  86. useful for debugging the GNU Fortran compiler itself.
  87. </p>
  88. </dd>
  89. <dt><code>-fdump-parse-tree</code></dt>
  90. <dd><a name="index-fdump_002dparse_002dtree"></a>
  91. <p>Output the internal parse tree after translating the source program
  92. into internal representation. Only really useful for debugging the
  93. GNU Fortran compiler itself. This option is deprecated; use
  94. <code>-fdump-fortran-original</code> instead.
  95. </p>
  96. </dd>
  97. <dt><code>-ffpe-trap=<var>list</var></code></dt>
  98. <dd><a name="index-ffpe_002dtrap_003dlist"></a>
  99. <p>Specify a list of floating point exception traps to enable. On most
  100. systems, if a floating point exception occurs and the trap for that
  101. exception is enabled, a SIGFPE signal will be sent and the program
  102. being aborted, producing a core file useful for debugging. <var>list</var>
  103. is a (possibly empty) comma-separated list of the following
  104. exceptions: &lsquo;<samp>invalid</samp>&rsquo; (invalid floating point operation, such as
  105. <code>SQRT(-1.0)</code>), &lsquo;<samp>zero</samp>&rsquo; (division by zero), &lsquo;<samp>overflow</samp>&rsquo;
  106. (overflow in a floating point operation), &lsquo;<samp>underflow</samp>&rsquo; (underflow
  107. in a floating point operation), &lsquo;<samp>inexact</samp>&rsquo; (loss of precision
  108. during operation), and &lsquo;<samp>denormal</samp>&rsquo; (operation performed on a
  109. denormal value). The first five exceptions correspond to the five
  110. IEEE 754 exceptions, whereas the last one (&lsquo;<samp>denormal</samp>&rsquo;) is not
  111. part of the IEEE 754 standard but is available on some common
  112. architectures such as x86.
  113. </p>
  114. <p>The first three exceptions (&lsquo;<samp>invalid</samp>&rsquo;, &lsquo;<samp>zero</samp>&rsquo;, and
  115. &lsquo;<samp>overflow</samp>&rsquo;) often indicate serious errors, and unless the program
  116. has provisions for dealing with these exceptions, enabling traps for
  117. these three exceptions is probably a good idea.
  118. </p>
  119. <p>Many, if not most, floating point operations incur loss of precision
  120. due to rounding, and hence the <code>ffpe-trap=inexact</code> is likely to
  121. be uninteresting in practice.
  122. </p>
  123. <p>By default no exception traps are enabled.
  124. </p>
  125. </dd>
  126. <dt><code>-ffpe-summary=<var>list</var></code></dt>
  127. <dd><a name="index-ffpe_002dsummary_003dlist"></a>
  128. <p>Specify a list of floating-point exceptions, whose flag status is printed
  129. to <code>ERROR_UNIT</code> when invoking <code>STOP</code> and <code>ERROR STOP</code>.
  130. <var>list</var> can be either &lsquo;<samp>none</samp>&rsquo;, &lsquo;<samp>all</samp>&rsquo; or a comma-separated list
  131. of the following exceptions: &lsquo;<samp>invalid</samp>&rsquo;, &lsquo;<samp>zero</samp>&rsquo;, &lsquo;<samp>overflow</samp>&rsquo;,
  132. &lsquo;<samp>underflow</samp>&rsquo;, &lsquo;<samp>inexact</samp>&rsquo; and &lsquo;<samp>denormal</samp>&rsquo;. (See
  133. <samp>-ffpe-trap</samp> for a description of the exceptions.)
  134. </p>
  135. <p>By default, a summary for all exceptions but &lsquo;<samp>inexact</samp>&rsquo; is shown.
  136. </p>
  137. </dd>
  138. <dt><code>-fno-backtrace</code></dt>
  139. <dd><a name="index-fno_002dbacktrace"></a>
  140. <a name="index-backtrace"></a>
  141. <a name="index-trace"></a>
  142. <p>When a serious runtime error is encountered or a deadly signal is
  143. emitted (segmentation fault, illegal instruction, bus error,
  144. floating-point exception, and the other POSIX signals that have the
  145. action &lsquo;<samp>core</samp>&rsquo;), the Fortran runtime library tries to output a
  146. backtrace of the error. <code>-fno-backtrace</code> disables the backtrace
  147. generation. This option only has influence for compilation of the
  148. Fortran main program.
  149. </p>
  150. </dd>
  151. </dl>
  152. <p>See <a href="http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-Options">Options for Debugging Your Program or GCC</a> in <cite>Using the GNU Compiler Collection (GCC)</cite>, for more information on
  153. debugging options.
  154. </p>
  155. <hr>
  156. <div class="header">
  157. <p>
  158. Next: <a href="Directory-Options.html#Directory-Options" accesskey="n" rel="next">Directory Options</a>, Previous: <a href="Error-and-Warning-Options.html#Error-and-Warning-Options" accesskey="p" rel="prev">Error and Warning Options</a>, Up: <a href="Invoking-GNU-Fortran.html#Invoking-GNU-Fortran" accesskey="u" rel="up">Invoking GNU Fortran</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>
  159. </div>
  160. </body>
  161. </html>