Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-03

Debugging CGI web apps

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

How do others debug CGI web apps written in Object Pascal? Yesterday I spent a significant amount of time debugging a few difficult problems. It took much longer than expected. Even though the CGI apps are written in Object Pascal I couldn't use GDB to step through the code (if one can, please let me know), so i had to solely rely on logfile output.

Is there a better way of debugging CGI applications? Note I am not using any web-type framework. I'm using very limited features of PWU - most output is simply by writeln('...') statements, but our CGI apps do use Cookies, OOP, Database Access etc..

I have Kylix 3 Enterprise at my disposal as well. Could that maybe be used to help debug CGI apps? Though this might be more work than I would wish for, because I doubt our code is Kylix compatible.

Is it at all possible to step through CGI apps with GDB?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
Hi, How do others debug CGI web apps written in Object Pascal? Yesterday I spent a significant amount of time debugging a few difficult problems. It took much longer than expected. Even though the CGI apps are written in Object Pascal I couldn't use GDB to step through the code (if one can, please let me know), so i had to solely rely on logfile output.

Well, I'm currently very busy with CGI, and I use dbugintf and the debug server app from Lazarus. Works like a charm for me.

Show quoted text 11 lines
Is there a better way of debugging CGI applications? Note I am not using any web-type framework. I'm using very limited features of PWU - most output is simply by writeln('...') statements, but our CGI apps do use Cookies, OOP, Database Access etc.. I have Kylix 3 Enterprise at my disposal as well. Could that maybe be used to help debug CGI apps? Though this might be more work than I would wish for, because I doubt our code is Kylix compatible. Is it at all possible to step through CGI apps with GDB?

Not directly.
You can use the embedded server created by Joost van der sluis, (see his webdesign package) or use a fastcgi app: as soon as it is started, connect gdb to it, with the -p option.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt

Michael Van Canneyt het geskryf:

Well, I'm currently very busy with CGI, and I use dbugintf and the debug server app from Lazarus. Works like a charm for me.

I'm using something similar - the "poor mans debug interface". :-)

  $ tail -F /tmp/myapp.log
You can use the embedded server created by Joost van der sluis, (see his webdesign package)

I was also thinking in these lines, but then couldn't figure out how an embedded server is actually going to help?

or use a fastcgi app: as soon as it is started, connect gdb to it, with the -p option.

Oh, this sounds good. fastcgi is always running CGI too, unlike standard CGI. I must really take a look at this - it should help my database connections too. Thanks.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 15 lines
Michael Van Canneyt het geskryf: > > Well, I'm currently very busy with CGI, and I use dbugintf and the > debug server app from Lazarus. Works like a charm for me. I'm using something similar - the "poor mans debug interface". :-) $ tail -F /tmp/myapp.log > You can use the embedded server created by Joost van der sluis, (see his > webdesign package) I was also thinking in these lines, but then couldn't figure out how an embedded server is actually going to help?

If you used fcl-web, then the modules are simply compiled in the embedded server...

Michael.

Reply by email