diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2020-07-18 14:08:27 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2020-07-18 14:08:27 +0300 |
commit | aa1bbaed45300f5d459c3b697fc691b52152cbfb (patch) | |
tree | f4c244515507815a2482d5f15124a41084b38d6d | |
parent | ea5343af6188763b2641fc292a33548cb0381256 (diff) | |
download | magi-aa1bbaed45300f5d459c3b697fc691b52152cbfb.tar magi-aa1bbaed45300f5d459c3b697fc691b52152cbfb.tar.xz magi-aa1bbaed45300f5d459c3b697fc691b52152cbfb.zip |
Debugging docs.
-rw-r--r-- | man/magi.3 | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -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 |