Debugging CGI programs

John Birch jbb at kdevelop.org
Thu Mar 1 21:44:49 GMT 2001


On Fri, 02 Mar 2001 10:31, Daniel Lynes wrote:
> On Friday 16 February 2001 03:12, Harsha wrote:
> > I need to trace and debug a CGI program written in C. The C programs sets
> > cookies via HTTP headers. If the program were being executed in a
> > browser, the cookies would have been saved.
> >
> > But here, the output is seen on STDOUT, and hence I cant trace thru the
> > program was I want it.
> >
> > Is there a browser tool which we could add on to KDevelop and redirect
> > the output (while debugging) to the browser so that I can debug the
> > program intercatively?
>
> Put a sleep( 20 ) or so into the CGI source, rebuild, put it on the web
> site. Then try to access it.  When it's running, tell the KDevelop debugger
> to attach to that process ID.
>
> And voila...you've got debugging, baby!
>
> hehe
>
> I love the GNU debugger for tasks like this (I'm guessing KDevelop uses gdb
> under the hood...just never checked.)

yup that's right we use gdb
you could also put a while around the sleep based on a bool var then when you 
attach change the bool in the debugger so it breaks out of the while. That 
way you don't have to be quick... :-)

jbb

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list