unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14183: 24.2; [PATCH] gud: perldb works with eval-ed subs
@ 2013-04-11 10:44 Dima Kogan
  2013-04-11 11:03 ` bug#14183: this is a duplicate Dima Kogan
  0 siblings, 1 reply; 2+ messages in thread
From: Dima Kogan @ 2013-04-11 10:44 UTC (permalink / raw)
  To: 14183

[-- Attachment #1: Type: text/plain, Size: 597 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1309 bytes --]

From 4d95d04798ef4055758c7538275086d77cf10474 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#14183: this is a duplicate
  2013-04-11 10:44 bug#14183: 24.2; [PATCH] gud: perldb works with eval-ed subs Dima Kogan
@ 2013-04-11 11:03 ` Dima Kogan
  0 siblings, 0 replies; 2+ messages in thread
From: Dima Kogan @ 2013-04-11 11:03 UTC (permalink / raw)
  To: 14183-done

I accidentally submitted this report twice. Closing this one. Bug 14182
is the original.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-11 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 10:44 bug#14183: 24.2; [PATCH] gud: perldb works with eval-ed subs Dima Kogan
2013-04-11 11:03 ` bug#14183: this is a duplicate Dima Kogan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).