]> code.delx.au - gnu-emacs/commitdiff
* lisp/progmodes/gud.el (gud-perldb-marker-filter): Understand position info
authorDima Kogan <dima@secretsauce.net>
Fri, 19 Apr 2013 15:58:07 +0000 (11:58 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 19 Apr 2013 15:58:07 +0000 (11:58 -0400)
for subroutines defined in an eval.

Fixes: debbugs:14182
lisp/ChangeLog
lisp/progmodes/gud.el

index a09d37352f7198f0832f56400b2999f97acb5b79..c46b9a5ceaba73a017c451245ec6979b393f39ea 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-19  Dima Kogan  <dima@secretsauce.net>    (tiny change)
+
+       * progmodes/gud.el (gud-perldb-marker-filter): Understand position info
+       for subroutines defined in an eval (bug#14182).
+
 2013-04-19  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
 
        * bookmark.el (bookmark-completing-read): Improve handling of empty
index d339495d76ab2be73574302185a6f75b1cc768d1..4e31c5e827c34cb8844c60e0442ee8978764df5c 100644 (file)
@@ -1487,14 +1487,38 @@ 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.  First I look for
+    ;; the eval case.  If that doesn't match, I look for the "normal" case.
+    (while
+        (string-match
+         (eval-when-compile
+           (let ((file-re "\\(?:[a-zA-Z]:\\)?[^:\n]*"))
+             (concat "\032\032\\(?:"
+                     (concat
+                      "(eval [0-9]+)\\["
+                      "\\(" file-re "\\)" ; Filename.
+                      "\\(?: (i\\.e\\. [^)]*)\\)?"
+                      ":\\([0-9]*\\)\\]") ; Line number.
+                     "\\|"
+                     (concat
+                      "\\(?1:" file-re "\\)" ; Filename.
+                      ":\\(?2:[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.