aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-07-18 14:08:27 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-07-18 14:08:27 +0300
commitaa1bbaed45300f5d459c3b697fc691b52152cbfb (patch)
treef4c244515507815a2482d5f15124a41084b38d6d
parentea5343af6188763b2641fc292a33548cb0381256 (diff)
downloadmagi-aa1bbaed45300f5d459c3b697fc691b52152cbfb.tar
magi-aa1bbaed45300f5d459c3b697fc691b52152cbfb.tar.xz
magi-aa1bbaed45300f5d459c3b697fc691b52152cbfb.zip
Debugging docs.
-rw-r--r--man/magi.341
1 files changed, 41 insertions, 0 deletions
diff --git a/man/magi.3 b/man/magi.3
index 32b0c92..0ac4b78 100644
--- a/man/magi.3
+++ b/man/magi.3
@@ -157,6 +157,47 @@ code is in
field of
.B magi_request
structure. For other modules error codes seem to be overkill.
+.SH DEBUGGING
+To debug your CGI scripts with
+.I gdb
+you can include signal.h:
+.P
+.RS
+.nf
+#include <signal.h>
+.fi
+.RE
+.P
+and stop your script in the beginning with:
+.P
+.RS
+.nf
+raise(SIGSTOP);
+.fi
+.RE
+.P
+Then compile your script and place it in directory which is handled by your
+CGI server.
+Check timeout settings for CGI scripts on your server and make it big enough,
+since the server will kill your script by timeout.
+Now make request to your server and run the following in the shell:
+.P
+.RS
+.nf
+gdb name_of_your_executable `pgrep name_of_your_executable`
+.fi
+.RE
+.P
+This will connect
+.I gdb
+to your running CGI script. It will be paused by SIGSTOP, so you will be able
+to setup your breakpoints. In order to continue run:
+.P
+.RS
+.nf
+continue
+.fi
+.RE
.SH COMPATIBILTY
Sine
.B magi