You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Stas Bekman <st...@stason.org> on 2002/03/01 04:16:15 UTC

Re: Apache::DB patch

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?





_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: Apache::DB patch

Posted by Stas Bekman <st...@stason.org>.
Enrico Sorcinelli wrote:

>>>
>>>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)

Thanks Enrico!

Can you please email me/list the outcome of this submission to the 
author of ptkdb. If nothing happens I'll simply include the patch in the 
guide, but I really hope that the module gets fixed.

>>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).

Any mod_perl/Tk gurus to look at the problem?


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: Apache::DB patch

Posted by Enrico Sorcinelli <e....@pisa.iol.it>.
On Tue, 05 Mar 2002 10:00:56 +0800
Stas Bekman <st...@stason.org> wrote:

> Enrico Sorcinelli wrote:
> > On Fri, 01 Mar 2002 11:16:15 +0800
> > Stas Bekman <st...@stason.org> 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: e.sorcinelli@pisa.iol.it - enrico@sorcinelli.it
=========================================================



Re: Apache::DB patch

Posted by Stas Bekman <st...@stason.org>.
Enrico Sorcinelli wrote:
> On Fri, 01 Mar 2002 11:16:15 +0800
> Stas Bekman <st...@stason.org> 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.

> 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 wish someone with perl/Tk knowledge could solve the hanging problem.

Thanks Enrico!



-- 


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: Apache::DB patch

Posted by Enrico Sorcinelli <e....@pisa.iol.it>.
On Fri, 01 Mar 2002 11:16:15 +0800
Stas Bekman <st...@stason.org> 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;
	});
    }

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).

	Enrico


=========================================================
Enrico Sorcinelli - Gruppo E-Comm - Italia On Line S.p.a.
E-Mail: e.sorcinelli@pisa.iol.it - enrico@sorcinelli.it
=========================================================