* [gentoo-user] Perl server-side debug
@ 2008-08-04 17:51 felix
2008-08-07 8:29 ` Gregory SACRE
0 siblings, 1 reply; 3+ messages in thread
From: felix @ 2008-08-04 17:51 UTC (permalink / raw
To: gentoo-user
I have a non-gentoo question here, but my problems are probably partly
flavored by using gentoo at home and something else at work.
Here is a page on debugging perl server-side code under Apache:
http://perl.apache.org/docs/1.0/guide/debug.html#Interactive_mod_perl_Debugging
It has two steps: starting apache with -X (run on the console in the
foreground, don't fork or start any children, handle incoming requests
directly one at a time) and adding configuration to use Apache::DB.
My problem is that I am trying to do this on a server not entirely
under my comlete control; it writes a configuration file from a
template which I can change, but a lot of internal logic deals with
Mason, and I can't just go changing everything to make this work. I
can start my own server, that is not the problem, it's that I must
keep its original behavior intact, including using Mason.
One of the puzzles is that the web page in question apparently is
using a pretty old version of perl5db.pl, 1.0402, which has different
perldb commands than I am used to: 'w' for a "window" of source
listing, where I am used to 'l' for "list". Both my home gentoo
system and this foreign system I am using are 1.28.
Or perhaps this web page is written for Windows users of some sort,
and Windows perl has differences from the real version :-)
Does anyone have any experience with this server-side debugging process?
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-user] Perl server-side debug
2008-08-04 17:51 [gentoo-user] Perl server-side debug felix
@ 2008-08-07 8:29 ` Gregory SACRE
2008-08-07 14:32 ` felix
0 siblings, 1 reply; 3+ messages in thread
From: Gregory SACRE @ 2008-08-07 8:29 UTC (permalink / raw
To: gentoo-user
Well, to be honest, I am developing a server side Perl application on
my Gentoo box. Everything is local and I just transfer the sources to
their Window$ server.
So far, the only debugging method I used for my Perl script is a "tail
-f /var/log/apache2/error_log". It was not verbose, but at least 90%
of the time, it was giving me where the problem occured, so it was not
that hard to figure out what happened.
But this method depends on the fact that you have access to the logs,
which might not be possible in your case.
What I tried to do also in my developing is to keep separate the web
specific parts from the logic ones. This helped me in a sense that
most of the "logic" scripts can be executed from the command line with
some parameters (as they are independent from where they are called)
and therefore be tested on the spot. The web specific part is
generally related to display and not that often keen on errors :-)
HTH,
Gregory
On Mon, Aug 4, 2008 at 7:51 PM, <felix@crowfix.com> wrote:
> I have a non-gentoo question here, but my problems are probably partly
> flavored by using gentoo at home and something else at work.
>
> Here is a page on debugging perl server-side code under Apache:
>
> http://perl.apache.org/docs/1.0/guide/debug.html#Interactive_mod_perl_Debugging
>
> It has two steps: starting apache with -X (run on the console in the
> foreground, don't fork or start any children, handle incoming requests
> directly one at a time) and adding configuration to use Apache::DB.
>
> My problem is that I am trying to do this on a server not entirely
> under my comlete control; it writes a configuration file from a
> template which I can change, but a lot of internal logic deals with
> Mason, and I can't just go changing everything to make this work. I
> can start my own server, that is not the problem, it's that I must
> keep its original behavior intact, including using Mason.
>
> One of the puzzles is that the web page in question apparently is
> using a pretty old version of perl5db.pl, 1.0402, which has different
> perldb commands than I am used to: 'w' for a "window" of source
> listing, where I am used to 'l' for "list". Both my home gentoo
> system and this foreign system I am using are 1.28.
>
> Or perhaps this web page is written for Windows users of some sort,
> and Windows perl has differences from the real version :-)
>
> Does anyone have any experience with this server-side debugging process?
>
> --
> ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
> Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
> GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
> I've found a solution to Fermat's Last Theorem but I see I've run out of room o
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-user] Perl server-side debug
2008-08-07 8:29 ` Gregory SACRE
@ 2008-08-07 14:32 ` felix
0 siblings, 0 replies; 3+ messages in thread
From: felix @ 2008-08-07 14:32 UTC (permalink / raw
To: gentoo-user
Most of the time I can figure out bugs from the error logs. Sometimes
the errors are so meaningless, especially when SOAP is involved, that
I end up sprinkling dozens of prints around the sources to see what
comes up, narrow it down, rinse and repeat, and eventually find the
bug and take out all the prints. It's a right royal pain in the arse.
This mod_perl debug is a major improvement, but it has its own
drawbacks. A lot of the code I am stuck with uses Mason, and Mason
apparently splits it up into little chunks to eval so it is hard to
read the source in any reasonable fashion. One major help is "use
DB;" which lets me add "$DB::single = 1" where I want the debugger to
break. Even then, client timeouts play havoc with the whole mess.
What I would dearly love would be a SOAP server debugger which worked
thru the client interface, a remote control debugger so to speak. But
that sounds like a pretty tricky thing to implement without gaping
security holes, and it would probaby have the same timeout issues.
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-07 14:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-04 17:51 [gentoo-user] Perl server-side debug felix
2008-08-07 8:29 ` Gregory SACRE
2008-08-07 14:32 ` felix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox