Subject: 24.2; [PATCH] gud: perldb works with eval-ed subs
From: Dima Kogan <[email-masked]>
To: [email-masked]
Date: Thu, 11 Apr 2013 03:50:30 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi.

This is a patch to fix a specific case that makes 'M-x perldb' unable to
step through some code.

When debugging through a subroutine defined in an eval, perldb uses a slightly
different string to communicate the debugger position. This patch updates the
regex in gud-perldb-marker-filter to be able to parse this string.

An example of a "normal" string:
 ^Z^Z/tmp/tst.pl:6:0

An example of a sub-in-eval string that can now be parsed:
 ^Z^Z(eval 5)[/tmp/tst.pl:6]:3:0

Sample perl source that couldn't be stepped through before, and now can be:

 eval 'sub f
 {
   print 34;
 }
 ';

 f();

From 4d95d04798ef4055758c7538275086d77cf10474 Mon Sep 17 00:00:00 2001
From: Dima Kogan <[email-masked]>
Date: Thu, 11 Apr 2013 03:39:41 -0700
Subject: [PATCH] gud: perldb works with eval-ed subs

When debugging through a subroutine defined in an eval, perldb uses a slightly
different string to communicate the debugger position. This patch updates the
regex in gud-perldb-marker-filter to be able to parse this string.

The "normal" string:
 ^Z^Z/tmp/tst.pl:6:0

The sub-in-eval string that can now be parsed:
 ^Z^Z(eval 5)[/tmp/tst.pl:6]:3:0

Sample perl source that couldn't be stepped through before, and now can be:

 eval 'sub f
 {
   print 34;
 }
 ';

 f();
---
 lisp/progmodes/gud.el |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index d339495..83b5fb6 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1487,7 +1487,7 @@ into one that invokes an Emacs-enabled debugging session.
   (let ((output ""))
 
     ;; Process all the complete markers in this chunk.
-    (while (string-match "\032\032\\(\\([a-zA-Z]:\\)?[^:\n]*\\):\\([0-9]*\\):.*\n"
+    (while (string-match "\032\032\\(?:(eval [0-9]+)\\[\\)?\\(\\([a-zA-Z]:\\)?[^:\n]*\\):\\([0-9]*\\)\\]?:.*\n"
 			 gud-marker-acc)
       (setq
 
-- 
1.7.10.4