From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William L Brown Newsgroups: gmane.emacs.help Subject: Debugging Perl with Emacs / perldb Date: Sun, 01 Aug 2010 09:34:27 -0400 Message-ID: <1280669667.6187.6641.camel@parvathi.addtoit.com> Reply-To: bbrown@addtoit.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1280755954 20757 80.91.229.12 (2 Aug 2010 13:32:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Aug 2010 13:32:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 02 15:32:30 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ofv81-0001mE-2p for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Aug 2010 15:32:29 +0200 Original-Received: from localhost ([127.0.0.1]:39870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ofv7x-0005EP-0L for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Aug 2010 09:32:25 -0400 Original-Received: from [140.186.70.92] (port=49065 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfbQf-0001qN-Nj for help-gnu-emacs@gnu.org; Sun, 01 Aug 2010 12:30:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfYvc-0003Hd-MC for help-gnu-emacs@gnu.org; Sun, 01 Aug 2010 09:50:15 -0400 Original-Received: from govinda.solana.com ([198.99.130.30]:34125 helo=govinda.addtoit.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfYvc-0002Mw-2f for help-gnu-emacs@gnu.org; Sun, 01 Aug 2010 09:50:12 -0400 Original-Received: from [198.99.130.23] (parvathi.solana.com [198.99.130.23]) by govinda.addtoit.com (8.14.3/8.14.3) with ESMTP id o71DQFHx023775; Sun, 1 Aug 2010 09:26:30 -0400 X-Mailer: Evolution 2.28.1 X-Virus-Scanned: clamav-milter 0.96 at govinda X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Mon, 02 Aug 2010 09:31:18 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:74382 Archived-At: Hi Folks, With "perl -d" on the command line, the standard perl debugger, I see the code inside of a perl eval as I execute it. Eval'ed code is code that is created from scratch, outside of a code file and which then becomes part of your program. Inside if emacs, depending upon my environment, I either see: Nothing but an indicator of what line I am running with no view of the line: (eval 6)[/home/bbrown/newTmp/emacsDebugTests/foo.pl:8]:7:0 or a new buffer pops up in emacs, with name (eval x), with absolutely no text inside of it. How do I fix this issue? Who can I ask? The issue seems to fit snuggly between Emacs experts and Perl experts. Thanks very much for your time. Bill ps. I included some sample code just to show you how I typically use eval. A transcript of my "perl -d" session, where I see at least one line of the eval at a time, follows. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ my $code = " my (\$foo, \$bar) = \@_; print \$foo; print \$bar; return \$bar; "; my $subroutine = "sub { $code }"; my $proc = eval $subroutine; my $baz = "1\n"; my $bat = "2\n"; my $output = eval {no strict "refs"; $proc->($baz, $bat); }; print $output; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ bbrown@parvathi:~/newTmp/emacsDebugTests$ perl -d foo.pl Loading DB routines from perl5db.pl version 1.32 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(foo.pl:1): my $code = " main::(foo.pl:2): my (\$foo, \$bar) = \@_; main::(foo.pl:3): print \$foo; main::(foo.pl:4): print \$bar; main::(foo.pl:5): return \$bar; main::(foo.pl:6): "; DB<1> n main::(foo.pl:7): my $subroutine = "sub { $code }"; DB<1> n main::(foo.pl:8): my $proc = eval $subroutine; DB<1> n main::((eval 6)[foo.pl:8]:7): ; DB<1> n main::(foo.pl:9): my $baz = "1\n"; DB<1> n main::(foo.pl:10): my $bat = "2\n"; DB<1> n main::(foo.pl:11): my $output = eval {no strict "refs"; $proc->($baz, $bat); }; DB<1> s main::(foo.pl:11): my $output = eval {no strict "refs"; $proc->($baz, $bat); }; DB<1> s main::CODE(0x8626a50)((eval 6)[foo.pl:8]:2): 2: my ($foo, $bar) = @_; <- I can see the source!!! DB<1> n main::CODE(0x8626a50)((eval 6)[foo.pl:8]:3): 3: print $foo; DB<1> n 1 main::CODE(0x8626a50)((eval 6)[foo.pl:8]:4): 4: print $bar; DB<1> n 2 main::CODE(0x8626a50)((eval 6)[foo.pl:8]:5): 5: return $bar; DB<1> n main::(foo.pl:12): print $output; DB<1> n 2 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. DB<1> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- William L. Brown ______________________________________ bbrown@addtoit.com 603-465-2114 [Office] 617-803-9156 [Cell] 603-574-4922 [Skype Phone] 508-322-1146 [Google Voice (experimental)] williambrown0000 [Skype/AIM/Yahoo IM] ______________________________________