diff options
author | Bruce Momjian <bruce@momjian.us> | 2011-12-02 17:08:33 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2011-12-02 17:09:56 -0500 |
commit | 155e56bd970d4f386fd3ca903eadc2b8d3ee0276 (patch) | |
tree | 9d8acbec4126d39e5a09b9be695b2bd214a1054b /doc/src | |
parent | b6f9834a9e8dfab1bd503ec0357bb812a18018a2 (diff) | |
download | postgresql-155e56bd970d4f386fd3ca903eadc2b8d3ee0276.tar.gz postgresql-155e56bd970d4f386fd3ca903eadc2b8d3ee0276.zip |
Update documentation suggestions for debugging the backend.
Tom Lane, with minor adjustments by me.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/installation.sgml | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 113596138ef..75fb7838949 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1415,10 +1415,23 @@ su - postgres <note> <para> - Server developers should consider using the configure options - <option>--enable-cassert</> and <option>--enable-debug</> to enhance the - ability to detect and debug server errors. Your debugger might - also require specific compiler flags to produce useful output. + When developing code inside the server, it is recommended to + use the configure options <option>--enable-cassert</> (which + turns on many run-time error checks) and <option>--enable-debug</> + (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> </note> </step> |