On Tue, 05 Mar 2002 10:00:56 +0800
Stas Bekman <[EMAIL PROTECTED]> wrote:

> Enrico Sorcinelli wrote:
> > On Fri, 01 Mar 2002 11:16:15 +0800
> > Stas Bekman <[EMAIL PROTECTED]> wrote:
> > 
> > 
> >>Enrico Sorcinelli wrote:
> >>
> >>>Hi all,
> >>>I started to use Apache::DB (0.06) to interactively debug under mod_perl using 
>ptkdb. I see that is necessary to modify Apache/DB.pm but, after this, the debugger 
>will be run always under ptkdb. The little patch I propose to Apache/DB.pm is to 
>improve Apache to dinamically switch from command line to GUI (ptkdb) interface by 
>configuring this in httpd.conf.
> >>>
> >>Hi Enrico,
> >>
> >>Does it actually work for you? My previous experience with it wasn't so 
> >>good. I was manually loading Devel/ptkdb.pm instead of Apache/perl5db.pl
> >>and it'll work for the first request, but then will hang. I see that 
> >>ptkdb hasn't changed since the last time I've tried it. May be it's a 
> >>newer perlTk that works better now?
> >>
> >>
> > 
> > Dear Stas,
> > I know the hang problem (I've started to hack the ptkdb code but it is enough 
>complex...)
> > However I find the GUI debugger useful. My TEMPORARY workaround is:
> > 
> > 1) Initially (and if possible) I've used a brutal 'kill 9 $$' code in cleanup 
>handler
> > 
> >     if (ref $r) {
> >     $SIG{INT} = \&DB::catch;
> >     $r->register_cleanup(sub { 
> >         $SIG{INT} = \&DB::ApacheSIGINT();
> > 
> >>>>      kill 9, $$ if $ptkdb;
> >>>>
> >     });
> >     }
> 
> Yup, tried that, but I didn't like that approach.

I agree with you, was only a drastic and immediate solution!

> 
> > then now
> > 
> > 2) I use the ptkdb 'File' menu command "Close Window and Run" (but I've added this 
>in the button bar) instead of "Run". In this case at the end of code, the debugger 
>won't hang and the window will closed. Note that if there are breakpoint, the window 
>will be closed and re-opened and all breakpoint are maintained (it is more convenient 
>to use 'Close Window and Run' only after last breakpoint).
> 
> Cool! Any chance you can submit a patch to the author of ptkdb so we can 
> all benefit from this trick? CC'ing mod_perl list will be useful too.

I've attached the patch to this e-mail. Also I will submit to the author asap.
Note: the patch only add a short cut for "Close Window and Run" as "Run and Exit" in 
main button bar (type 'patch -p0 < Devel-ptkdb-1.1074-patch' in the same dir of 
Devel/ptkdb.pm)

> 
> I wish someone with perl/Tk knowledge could solve the hanging problem.
> 

I wish me too!
After a brief ptkdb.pm code analysis, I've seen that the debugger seems to hang, after 
last 'Run' command, in Tk::DoOneEvent(0) call (main_loop sub, line 2922).

Yours

        Enrico


=========================================================
Enrico Sorcinelli - Gruppo E-Comm - Italia On Line S.p.a.
E-Mail: [EMAIL PROTECTED] - [EMAIL PROTECTED]
=========================================================


Attachment: Devel-ptkdb-1.1074-patch
Description: Binary data

Reply via email to