From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#14182: updated patch Date: Thu, 18 Apr 2013 00:48:03 -0700 Message-ID: <87ppxs9t58.fsf@secretsauce.net> References: <878v4p9w95.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1366271326 17940 80.91.229.3 (18 Apr 2013 07:48:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Apr 2013 07:48:46 +0000 (UTC) To: 14182@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 18 09:48:49 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USjaI-0003ni-EX for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Apr 2013 09:48:46 +0200 Original-Received: from localhost ([::1]:51217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USjaH-0008EQ-Vp for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Apr 2013 03:48:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USjaB-0008E1-33 for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 03:48:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USja8-000731-00 for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 03:48:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USja7-00072q-BX for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 03:48:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1USjeP-00083K-VC for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 03:53:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <878v4p9w95.fsf@secretsauce.net> Resent-From: Dima Kogan Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Apr 2013 07:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14182 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 14182-submit@debbugs.gnu.org id=B14182.136627155830876 (code B ref 14182); Thu, 18 Apr 2013 07:53:01 +0000 Original-Received: (at 14182) by debbugs.gnu.org; 18 Apr 2013 07:52:38 +0000 Original-Received: from localhost ([127.0.0.1]:57968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1USje1-00081w-V9 for submit@debbugs.gnu.org; Thu, 18 Apr 2013 03:52:38 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:49299) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1USjdx-00081Z-OU for 14182@debbugs.gnu.org; Thu, 18 Apr 2013 03:52:35 -0400 Original-Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id D801420B10 for <14182@debbugs.gnu.org>; Thu, 18 Apr 2013 03:48:05 -0400 (EDT) Original-Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 18 Apr 2013 03:48:05 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= mesmtp; bh=X2D24n7qCY6aMyH95bKSIGN/dCw=; b=k6mo/1980aiU21hHHoWPf fSvTWb2bl+U7tzGXtGMfH/zMRM/ShL1Ie1T4Jw6pKqwhO1vIJ9sJ8sZSkBwsfbCQ FXUm4js5DBgOsFG0RX1RPDVpJAoMWTDfV7IbI76pk6MVD72X60iYKLLl1+ZgKMGl D3HHzTTh3RsA82fOmJfBF8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :mime-version:content-type; s=smtpout; bh=X2D24n7qCY6aMyH95bKSIG N/dCw=; b=jPyjMNsSLff9LOs7+PxJ3LhGZ8lWHGugjYL8FYOCe+DglVGUjTCgHu 7wMsmO6Xj2Qmeb7x13eONq51m95XBJ44i23RrpAKq/P7pOqJjW5QTY/W+j/vlWZx 492LPO9/vlHX/9u03Jktcm9PdHxYUGPCGHzgvE6fsAC5GbLcf/lMU= X-Sasl-enc: jGIM0t99sjJY/4ZcaoX5Q53g1PMmXfXRYUoLYKPHFq+A 1366271285 Original-Received: from shorty.local (unknown [76.169.247.77]) by mail.messagingengine.com (Postfix) with ESMTPA id 95A6D2000C7 for <14182@debbugs.gnu.org>; Thu, 18 Apr 2013 03:48:05 -0400 (EDT) Original-Received: from dima by shorty.local with local (Exim 4.80) (envelope-from ) id 1USjZc-00088X-6c for 14182@debbugs.gnu.org; Thu, 18 Apr 2013 00:48:04 -0700 User-agent: mu4e 0.9.9.5-dev6; emacs 24.3.50.1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73486 Archived-At: --=-=-= Content-Type: text/plain I used the patch in the original report for a while, and stumbled on another, related case that emacs doesn't handle. I'm attaching an updated patch that handles both cases (described in the patch). I've also broken up the regex for improved readability. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-gud-perldb-works-with-eval-ed-subs.patch Content-Description: patch >From 7ead460b535a84692057ddb8d36cec2203d5c3b4 Mon Sep 17 00:00:00 2001 From: Dima Kogan 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 matching 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 can look like either of ^Z^Z(eval 5)[/tmp/tst.pl:6]:3:0 ^Z^Z(eval 17)[Basic/Core/Core.pm.PL (i.e. PDL::Core.pm):2931]:1: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 | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d339495..15e6d07 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -1487,14 +1487,40 @@ 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" - gud-marker-acc) + ;; + ;; Here I match the string coming out of perldb. + ;; The strings can look like any of + ;; + ;; "\032\032/tmp/tst.pl:6:0\n" + ;; "\032\032(eval 5)[/tmp/tst.pl:6]:3:0\n" + ;; "\032\032(eval 17)[Basic/Core/Core.pm.PL (i.e. PDL::Core.pm):2931]:1:0\n" + ;; + ;; From those I want the filename and the line number. I use two + ;; regexes. First I look for the eval case. If that doesn't match, + ;; I look for the "normal" case + (while + (or (string-match (concat "\032\032" + "(eval [0-9]+)" + "\\[" + "\\(\\(?:[a-zA-Z]:\\)?[^:\n]*\\)" ; path + "\\(?: (i\.e\. [^)]*)\\)?" ; optional "(i.e. ...)" line + ":" + "\\([0-9]*\\)" ; line number + "\\]" + ":.*\n") + gud-marker-acc) + (string-match (concat "\032\032" + "\\(\\(?:[a-zA-Z]:\\)?[^:\n]*\\)" ; path + ":" + "\\([0-9]*\\)" ; line number + ":.*\n") + gud-marker-acc)) (setq ;; Extract the frame position from the marker. gud-last-frame (cons (match-string 1 gud-marker-acc) - (string-to-number (match-string 3 gud-marker-acc))) + (string-to-number (match-string 2 gud-marker-acc))) ;; Append any text before the marker to the output we're going ;; to return - we don't include the marker in this text. -- 1.7.10.4 --=-=-=--