summaryrefslogtreecommitdiff
path: root/share/doc/gfortran/Debugging-Options.html
blob: 51ea8d4d26bc01f319e221429d20be41882117d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1999-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>The GNU Fortran Compiler: Debugging Options</title>

<meta name="description" content="The GNU Fortran Compiler: Debugging Options">
<meta name="keywords" content="The GNU Fortran Compiler: Debugging Options">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Invoking-GNU-Fortran.html#Invoking-GNU-Fortran" rel="up" title="Invoking GNU Fortran">
<link href="Directory-Options.html#Directory-Options" rel="next" title="Directory Options">
<link href="Error-and-Warning-Options.html#Error-and-Warning-Options" rel="previous" title="Error and Warning Options">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Debugging-Options"></a>
<div class="header">
<p>
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="previous">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>
</div>
<hr>
<a name="Options-for-debugging-your-program-or-GNU-Fortran"></a>
<h3 class="section">2.5 Options for debugging your program or GNU Fortran</h3>
<a name="index-options_002c-debugging"></a>
<a name="index-debugging-information-options"></a>

<p>GNU Fortran has various special options that are used for debugging
either your program or the GNU Fortran compiler.
</p>
<dl compact="compact">
<dd><a name="index-fdump_002dfortran_002doriginal"></a>
</dd>
<dt><code>-fdump-fortran-original</code></dt>
<dd><p>Output the internal parse tree after translating the source program
into internal representation.  This option is mostly useful for
debugging the GNU Fortran compiler itself. The output generated by
this option might change between releases. This option may also
generate internal compiler errors for features which have only
recently been added.
</p>
<a name="index-fdump_002dfortran_002doptimized"></a>
</dd>
<dt><code>-fdump-fortran-optimized</code></dt>
<dd><p>Output the parse tree after front-end optimization.  Mostly useful for
debugging the GNU Fortran compiler itself. The output generated by
this option might change between releases.  This option may also
generate internal compiler errors for features which have only
recently been added.
</p>
<a name="index-fdump_002dparse_002dtree"></a>
</dd>
<dt><code>-fdump-parse-tree</code></dt>
<dd><p>Output the internal parse tree after translating the source program
into internal representation.  Mostly useful for debugging the GNU
Fortran compiler itself. The output generated by this option might
change between releases. This option may also generate internal
compiler errors for features which have only recently been added. This
option is deprecated; use <code>-fdump-fortran-original</code> instead.
</p>
<a name="index-fdebug_002daux_002dvars"></a>
</dd>
<dt><code>-fdebug-aux-vars</code></dt>
<dd><p>Renames internal variables created by the gfortran front end and makes
them accessible to a debugger.  The name of the internal variables then
start with upper-case letters followed by an underscore.  This option is
useful for debugging the compiler&rsquo;s code generation together with
<code>-fdump-tree-original</code> and enabling debugging of the executable
program by using <code>-g</code> or <code>-ggdb3</code>.
</p>
<a name="index-fdump_002dfortran_002dglobal"></a>
</dd>
<dt><code>-fdump-fortran-global</code></dt>
<dd><p>Output a list of the global identifiers after translating into
middle-end representation. Mostly useful for debugging the GNU Fortran
compiler itself. The output generated by this option might change
between releases.  This option may also generate internal compiler
errors for features which have only recently been added.
</p>
<a name="index-ffpe_002dtrap_003dlist"></a>
</dd>
<dt><code>-ffpe-trap=<var>list</var></code></dt>
<dd><p>Specify a list of floating point exception traps to enable.  On most
systems, if a floating point exception occurs and the trap for that
exception is enabled, a SIGFPE signal will be sent and the program
being aborted, producing a core file useful for debugging.  <var>list</var>
is a (possibly empty) comma-separated list of the following
exceptions: &lsquo;<samp>invalid</samp>&rsquo; (invalid floating point operation, such as
<code>SQRT(-1.0)</code>), &lsquo;<samp>zero</samp>&rsquo; (division by zero), &lsquo;<samp>overflow</samp>&rsquo;
(overflow in a floating point operation), &lsquo;<samp>underflow</samp>&rsquo; (underflow
in a floating point operation), &lsquo;<samp>inexact</samp>&rsquo; (loss of precision
during operation), and &lsquo;<samp>denormal</samp>&rsquo; (operation performed on a
denormal value).  The first five exceptions correspond to the five
IEEE 754 exceptions, whereas the last one (&lsquo;<samp>denormal</samp>&rsquo;) is not
part of the IEEE 754 standard but is available on some common
architectures such as x86.
</p>
<p>The first three exceptions (&lsquo;<samp>invalid</samp>&rsquo;, &lsquo;<samp>zero</samp>&rsquo;, and
&lsquo;<samp>overflow</samp>&rsquo;) often indicate serious errors, and unless the program
has provisions for dealing with these exceptions, enabling traps for
these three exceptions is probably a good idea.
</p>
<p>If the option is used more than once in the command line, the lists will
be joined: &rsquo;<code>ffpe-trap=</code><var>list1</var> <code>ffpe-trap=</code><var>list2</var>&rsquo;
is equivalent to <code>ffpe-trap=</code><var>list1</var>,<var>list2</var>.
</p>
<p>Note that once enabled an exception cannot be disabled (no negative form).
</p>
<p>Many, if not most, floating point operations incur loss of precision
due to rounding, and hence the <code>ffpe-trap=inexact</code> is likely to
be uninteresting in practice.
</p>
<p>By default no exception traps are enabled.
</p>
<a name="index-ffpe_002dsummary_003dlist"></a>
</dd>
<dt><code>-ffpe-summary=<var>list</var></code></dt>
<dd><p>Specify a list of floating-point exceptions, whose flag status is printed
to <code>ERROR_UNIT</code> when invoking <code>STOP</code> and <code>ERROR STOP</code>.
<var>list</var> can be either &lsquo;<samp>none</samp>&rsquo;, &lsquo;<samp>all</samp>&rsquo; or a comma-separated list
of the following exceptions: &lsquo;<samp>invalid</samp>&rsquo;, &lsquo;<samp>zero</samp>&rsquo;, &lsquo;<samp>overflow</samp>&rsquo;,
&lsquo;<samp>underflow</samp>&rsquo;, &lsquo;<samp>inexact</samp>&rsquo; and &lsquo;<samp>denormal</samp>&rsquo;. (See
<samp>-ffpe-trap</samp> for a description of the exceptions.)
</p>
<p>If the option is used more than once in the command line, only the
last one will be used.
</p>
<p>By default, a summary for all exceptions but &lsquo;<samp>inexact</samp>&rsquo; is shown.
</p>
<a name="index-fno_002dbacktrace"></a>
<a name="index-backtrace"></a>
<a name="index-trace"></a>
</dd>
<dt><code>-fno-backtrace</code></dt>
<dd><p>When a serious runtime error is encountered or a deadly signal is
emitted (segmentation fault, illegal instruction, bus error,
floating-point exception, and the other POSIX signals that have the
action &lsquo;<samp>core</samp>&rsquo;), the Fortran runtime library tries to output a
backtrace of the error. <code>-fno-backtrace</code> disables the backtrace
generation. This option only has influence for compilation of the
Fortran main program.
</p>
</dd>
</dl>

<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
debugging options.
</p>
<hr>
<div class="header">
<p>
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="previous">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>
</div>



</body>
</html>