Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 155e56b

Browse files
committed
Update documentation suggestions for debugging the backend.
Tom Lane, with minor adjustments by me.
1 parent b6f9834 commit 155e56b

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

doc/src/sgml/installation.sgml

+17-4
Original file line numberDiff line numberDiff line change
@@ -1415,10 +1415,23 @@ su - postgres
14151415

14161416
<note>
14171417
<para>
1418-
Server developers should consider using the configure options
1419-
<option>--enable-cassert</> and <option>--enable-debug</> to enhance the
1420-
ability to detect and debug server errors. Your debugger might
1421-
also require specific compiler flags to produce useful output.
1418+
When developing code inside the server, it is recommended to
1419+
use the configure options <option>--enable-cassert</> (which
1420+
turns on many run-time error checks) and <option>--enable-debug</>
1421+
(which improves the usefulness of debugging tools).
1422+
</para>
1423+
1424+
<para>
1425+
If using GCC, it is best to build with an optimization level of
1426+
at least <option>-O1</>, because using no optimization
1427+
(<option>-O0</>) disables some important compiler warnings (such
1428+
as the use of uninitialized variables). However, non-zero
1429+
optimization levels can complicate debugging because stepping
1430+
through compiled code will usually not match up one-to-one with
1431+
source code lines. If you get confused while trying to debug
1432+
optimized code, recompile the specific files of interest with
1433+
<option>-O0</>. An easy way to do this is by passing an option
1434+
to <application>make</>: <command>gmake PROFILE=-O0 file.o</>.
14221435
</para>
14231436
</note>
14241437
</step>

0 commit comments

Comments
 (0)