unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dima Kogan <dima@secretsauce.net>
To: 14182@debbugs.gnu.org
Subject: bug#14182: 24.2; [PATCH] gud: perldb works with eval-ed subs
Date: Thu, 11 Apr 2013 03:50:30 -0700	[thread overview]
Message-ID: <878v4p9w95.fsf@secretsauce.net> (raw)

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


             reply	other threads:[~2013-04-11 10:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 10:50 Dima Kogan [this message]
2013-04-18  7:48 ` bug#14182: updated patch Dima Kogan
2013-04-19 15:59   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878v4p9w95.fsf@secretsauce.net \
    --to=dima@secretsauce.net \
    --cc=14182@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).