Can anyone tell me the best way to debug a cgi program?
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Debugging CGI
Collapse
X
-
Debugging CGI
Scotty, First, you probably need to limit the number of CGI job down to 1 by start the server instance as STRTCPSVR SERVER(*HTTP) HTTPSVR(YOURINST '-maxat 1'). Otherwise, it is hard to catch the right job to debug if your server is busy. Next, you need to find out the job number that serve the CGI request then issue STRSRVJOB with job number/user/job name like you would for dedugging the batch job. After that do the STRDBG and add at least one break point that will always get execute. Press the command 12 then go to your browser and request that CGI page. At this point, switch back to the green screen then you should the program is stop at that break point. One thing you might want to watch for is the time limit for CGI to response. If you stay in the debug too long and exceed the time limit the server will take over and response to the browser. Shawn Fu
Comment