mirror of
https://github.com/postgres/postgres.git
synced 2025-05-06 19:59:18 +03:00
Update documentation suggestions for debugging the backend.
Tom Lane, with minor adjustments by me.
This commit is contained in:
parent
b6f9834a9e
commit
155e56bd97
@ -1415,10 +1415,23 @@ su - postgres
|
|||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
Server developers should consider using the configure options
|
When developing code inside the server, it is recommended to
|
||||||
<option>--enable-cassert</> and <option>--enable-debug</> to enhance the
|
use the configure options <option>--enable-cassert</> (which
|
||||||
ability to detect and debug server errors. Your debugger might
|
turns on many run-time error checks) and <option>--enable-debug</>
|
||||||
also require specific compiler flags to produce useful output.
|
(which improves the usefulness of debugging tools).
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
If using GCC, it is best to build with an optimization level of
|
||||||
|
at least <option>-O1</>, because using no optimization
|
||||||
|
(<option>-O0</>) disables some important compiler warnings (such
|
||||||
|
as the use of uninitialized variables). However, non-zero
|
||||||
|
optimization levels can complicate debugging because stepping
|
||||||
|
through compiled code will usually not match up one-to-one with
|
||||||
|
source code lines. If you get confused while trying to debug
|
||||||
|
optimized code, recompile the specific files of interest with
|
||||||
|
<option>-O0</>. An easy way to do this is by passing an option
|
||||||
|
to <application>make</>: <command>gmake PROFILE=-O0 file.o</>.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
</step>
|
</step>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user