Re: Apache::DB patch
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] = Devel-ptkdb-1.1074-patch Description: Binary data
Re: Apache::DB patch
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:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: Apache::DB patch
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; }); } 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: [EMAIL PROTECTED] - [EMAIL PROTECTED] =
Re: Apache::DB patch
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. 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:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Apache::DB patch
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. To enable ptkdb I add the directive: PerlSetVar PerlTkDB On in preferred place of my httpd.conf. For example: Location /someplace IfDefine PERLDB PerlSetVar PerlTkDB On PerlFixupHandler Apache::DB /IfDefine SetHandler perl-script PerlHandler Apache::MyModule /Location then start Apache with: % httpd -D PERLDB If Devel::ptkdb isn't installed, then default debug libraries (perl5db.pl) are loaded. ---CUT HERE--- --- DB.pm Thu Feb 28 16:45:29 2002 +++ DB.pm-patched Thu Feb 28 16:31:12 2002 @@ -26,7 +26,9 @@ init(); -require 'Apache/perl5db.pl'; +unless ( $r-dir_config('PerlTkDB') eval(require 'Devel/ptkdb.pm') ) { +require 'Apache/perl5db.pl'; +} $DB::single = 1; if (ref $r) { ---CUT HERE--- (run the patch in the same directory of Apache/DB.pm) Any comment will be appreciated. Enrico = Enrico Sorcinelli - Gruppo E-Comm - Italia On Line S.p.a. E-Mail: [EMAIL PROTECTED] - [EMAIL PROTECTED] =
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:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/