emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 357c54d 26/56: Revert column tracking change


From: Rocky Bernstein
Subject: [elpa] master 357c54d 26/56: Revert column tracking change
Date: Sat, 27 May 2017 05:02:32 -0400 (EDT)

branch: master
commit 357c54d698a8a602c348cb46fa3ba6677e9e46bf
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    Revert column tracking change
    
    except Makefile.am change for "check" targets
---
 realgud/common/buffer/backtrace.el |  2 +-
 realgud/common/buffer/command.el   | 14 +++-------
 realgud/common/file.el             | 15 +++++------
 realgud/common/fringe.el           |  7 +++--
 realgud/common/regexp.el           |  4 +--
 realgud/common/track.el            | 52 ++++++++++++--------------------------
 realgud/debugger/gdb/init.el       |  2 +-
 realgud/debugger/gub/init.el       |  2 +-
 realgud/debugger/jdb/core.el       |  6 ++---
 realgud/debugger/nodejs/init.el    |  2 +-
 realgud/debugger/trepan/core.el    |  4 +--
 realgud/debugger/trepan2/core.el   |  4 +--
 realgud/debugger/trepanjs/init.el  |  4 +--
 realgud/lang/js.el                 |  2 +-
 realgud/lang/python.el             |  5 ++--
 test/test-file.el                  |  4 +--
 test/test-loc-regexp-nodejs.el     |  4 +--
 test/test-regexp-gub.el            |  6 ++---
 test/test-regexp-python.el         |  4 +--
 test/test-regexp-rdebug.el         |  4 ---
 test/test-regexp-trepan.el         | 49 +++++++++++++----------------------
 test/test-track.el                 | 42 ++++++++----------------------
 22 files changed, 82 insertions(+), 156 deletions(-)

diff --git a/realgud/common/buffer/backtrace.el 
b/realgud/common/buffer/backtrace.el
index b2ffc91..816ffdb 100644
--- a/realgud/common/buffer/backtrace.el
+++ b/realgud/common/buffer/backtrace.el
@@ -461,7 +461,7 @@ filename, line number, whether the frame is selected as 
text properties."
          ))
 
        (when (and (stringp filename) (numberp line-num))
-         (let ((loc (realgud:file-loc-from-line filename line-num nil cmdbuf)))
+         (let ((loc (realgud:file-loc-from-line filename line-num cmdbuf)))
            (put-text-property (match-beginning 0) (match-end 0)
                               'loc loc string)
            ))
diff --git a/realgud/common/buffer/command.el b/realgud/common/buffer/command.el
index c66dc9b..bd8aaca 100644
--- a/realgud/common/buffer/command.el
+++ b/realgud/common/buffer/command.el
@@ -93,17 +93,11 @@
 
   ;; FIXME: REMOVE THIS and use regexp-hash
   loc-regexp   ;; Location regular expression string
-  file-group   ;; file path
-  line-group   ;; line number
-  ;; FIXME: remove alt- things
-  ;; They are here because sometimes we can't get a single regexp
-  ;; pattern to have all regexp file paths or line numbers appear at the
-  ;; same pattern group (e.g. in the first position)
+  file-group
+  line-group
   alt-file-group
   alt-line-group
-  column-group  ;; Column within a line
-  char-offset-group ;; char offset from begging of file
-  text-group  ;; Matching text
+  text-group
   ignore-file-re
 
   loc-hist     ;; ring of locations seen in the course of execution
@@ -337,8 +331,6 @@ values set in the debugger's init.el."
             :line-group (realgud-sget 'loc-pat 'line-group)
             :alt-file-group (realgud-sget 'loc-pat 'alt-file-group)
             :alt-line-group (realgud-sget 'loc-pat 'alt-line-group)
-            :column-group (realgud-sget 'loc-pat 'column-group)
-            :char-offset-group (realgud-sget 'loc-pat 'column-group)
             :text-group (realgud-sget 'loc-pat 'text-group)
             :ignore-file-re (realgud-sget 'loc-pat 'ignore-file-re)
             :loc-hist (make-realgud-loc-hist)
diff --git a/realgud/common/file.el b/realgud/common/file.el
index ad4d022..cd27057 100644
--- a/realgud/common/file.el
+++ b/realgud/common/file.el
@@ -55,8 +55,9 @@ at LINE-NUMBER or nil if it is not there"
                 (current-column))))))
     (error nil)))
 
+;; FIXME: should allow column number to be passed in.
 (defun realgud:file-loc-from-line(filename line-number
-                                          &optional column cmd-marker 
source-text bp-num
+                                          &optional cmd-marker source-text 
bp-num
                                           ;; FIXME: remove ignore-file-re and 
cover with
                                           ;; find-file-fn.
                                           ignore-file-re find-file-fn 
directory)
@@ -109,11 +110,9 @@ problem as best as we can determine."
                    (if (setq line-count (realgud:file-line-count filename))
                        (if (> line-count line-number)
                            (let* ((column-number
-                                   (or column
-                                       (realgud:file-column-from-string 
filename
-                                                                        
line-number
-                                                                        
source-text)
-                                       1))
+                                   (realgud:file-column-from-string filename
+                                                                   line-number
+                                                                   
source-text))
                                   (source-buffer (find-file-noselect filename))
                                   (source-mark))
 
@@ -121,10 +120,8 @@ problem as best as we can determine."
                              ;; doing something other than validation?
                              (with-current-buffer source-buffer
                                (goto-char (point-min))
-                               ;; FIXME allow for byte offset
+                               ;; FIXME also allow column number and byte 
offset
                                (forward-line (1- line-number))
-                               (if (> column-number 0)
-                                   (move-to-column (1- column-number)))
                                (make-realgud-loc
                                      :num           bp-num
                                      :cmd-marker    cmd-marker
diff --git a/realgud/common/fringe.el b/realgud/common/fringe.el
index 042424a..c50153b 100644
--- a/realgud/common/fringe.el
+++ b/realgud/common/fringe.el
@@ -131,9 +131,7 @@ for example to indicate a debugger position."
                ;; We need to ignore field boundaries, so we use
                ;; forward-line rather than beginning-of-line.
                (forward-line 0)
-               (setq overlay-arrow-position (point-marker))
-               (goto-char position)
-               )))))))
+               (set overlay-arrow (point-marker)))))))))
 
 (defun realgud-fringe-history-set (loc-hist &optional do-cmdbuf?)
   "Set arrows on the last positions we have stopped on."
@@ -160,7 +158,8 @@ for example to indicate a debugger position."
     (when loc1
       (realgud-fringe-set-arrow 'realgud-overlay-arrow1 mark1)
       (when (and do-cmdbuf? cmd-mark1)
-         (realgud-fringe-set-arrow 'realgud-overlay-arrow1 cmd-mark1))
+         (realgud-fringe-set-arrow 'realgud-overlay-arrow1 cmd-mark1)
+         (goto-char (marker-position cmd-mark1)))
       )
     ))
 
diff --git a/realgud/common/regexp.el b/realgud/common/regexp.el
index 1c6ff5b..e21de25 100644
--- a/realgud/common/regexp.el
+++ b/realgud/common/regexp.el
@@ -41,13 +41,13 @@ output by a debugger inside a process shell"
                        ;; file position as in Perl locations.
   (regexp)             ;; a stack position, or thread number.
   (file-group)         ;; Filename position in struct
-  (line-group)         ;; Line number position in struct. First line is 1
+  (line-group)         ;; Line number position in struct
   (alt-file-group)     ;; Used when regexp is too complicated and use \|
                        ;; e.g. perldb file loc regexps
   (alt-line-group)     ;; ditto
-  (column-group)       ;; Column position in struct. First position is 1
   (char-offset-group)  ;; Character offset position in struct
   (instruction-address-group)
+  (column-group)
   (ignore-file-re)     ;; Some debuggers create pseudo files in eval strings
                        ;; for example "(eval)" in Ruby and Perl
   (text-group)         ;; Some source text that should found at position
diff --git a/realgud/common/track.el b/realgud/common/track.el
index 070d9b0..f26a0ed 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -154,17 +154,7 @@ finding a new location/s.  The parameter TEXT appears 
because it
 is part of the comint-output-filter-functions API. Instead we use
 marks set in buffer-local variables to extract text"
   (if (and realgud-track-mode (realgud-cmdbuf? (current-buffer)))
-      (let ((loc-regexp (realgud-sget 'cmdbuf-info 'loc-regexp))
-           (file-group (realgud-sget 'cmdbuf-info 'file-group))
-           (line-group (realgud-sget 'cmdbuf-info 'line-group))
-           (column-group (realgud-sget 'cmdbuf-info 'column-group))
-           (alt-file-group (realgud-sget 'cmdbuf-info 'alt-file-group))
-           (alt-line-group (realgud-sget 'cmdbuf-info 'alt-line-group))
-           (text-group (realgud-sget 'cmdbuf-info 'text-group))
-           )
-       (realgud-track-loc text (point-marker) loc-regexp file-group
-                          line-group column-group text-group
-                          ))
+      (realgud-track-loc text (point-marker))
     ))
 
 (defun realgud:track-complain-if-not-in-cmd-buffer (&optional buf errorp)
@@ -193,22 +183,13 @@ evaluating (realgud-cmdbuf-info-loc-regexp 
realgud-cmdbuf-info)"
   (interactive "r")
   (if (> from to) (psetq to from from to))
   (let* ((text (buffer-substring-no-properties from to))
-        (cmdbuf (or opt-cmdbuf (current-buffer)))
-        (loc-regexp (realgud-sget 'cmdbuf-info 'loc-regexp))
-        (file-group (realgud-sget 'cmdbuf-info 'file-group))
-        (line-group (realgud-sget 'cmdbuf-info 'line-group))
-        (column-group (realgud-sget 'cmdbuf-info 'column-group))
-        (alt-file-group (realgud-sget 'cmdbuf-info 'alt-file-group))
-        (alt-line-group (realgud-sget 'cmdbuf-info 'alt-line-group))
-        (text-group (realgud-sget 'cmdbuf-info 'text-group))
-        (loc (realgud-track-loc text cmd-mark loc-regexp file-group
-                                line-group column-group text-group
-                                ))
+        (loc (realgud-track-loc text cmd-mark))
         ;; If we see a selected frame number, it is stored
         ;; in frame-num. Otherwise, nil.
         (frame-num)
         (text-sans-loc)
         (bp-loc)
+        (cmdbuf (or opt-cmdbuf (current-buffer)))
         )
     (unless (realgud:track-complain-if-not-in-cmd-buffer cmdbuf t)
        (if (not (equal "" text))
@@ -393,10 +374,9 @@ encountering a new loc."
        ))
   )
 
-(defun realgud-track-loc(text cmd-mark loc-regexp file-group
-                             line-group column-group text-group
-                             &optional no-warn-on-no-match?
-                             opt-ignore-file-re)
+(defun realgud-track-loc(text cmd-mark &optional opt-regexp opt-file-group
+                          opt-line-group no-warn-on-no-match?
+                          opt-ignore-file-re)
   "Do regular-expression matching to find a file name and line number inside
 string TEXT. If we match, we will turn the result into a realgud-loc struct.
 Otherwise return nil."
@@ -411,8 +391,15 @@ Otherwise return nil."
 
   (unless (realgud:track-complain-if-not-in-cmd-buffer)
       (let
-         ((alt-file-group (realgud-sget 'cmdbuf-info 'alt-file-group))
+         ((loc-regexp (or opt-regexp
+                          (realgud-sget 'cmdbuf-info 'loc-regexp)))
+          (file-group (or opt-file-group
+                          (realgud-sget 'cmdbuf-info 'file-group)))
+          (line-group (or opt-line-group
+                          (realgud-sget 'cmdbuf-info 'line-group)))
+          (alt-file-group (realgud-sget 'cmdbuf-info 'alt-file-group))
           (alt-line-group (realgud-sget 'cmdbuf-info 'alt-line-group))
+          (text-group (realgud-sget 'cmdbuf-info 'text-group))
           (ignore-file-re (or opt-ignore-file-re
                               (realgud-sget 'cmdbuf-info 'ignore-file-re)))
           (callback-loc-fn (realgud-sget 'cmdbuf-info 'callback-loc-fn))
@@ -423,13 +410,9 @@ Otherwise return nil."
                                     (match-string alt-file-group text)))
                       (line-str (or (match-string line-group text)
                                     (match-string alt-line-group text)))
-                      (column-str
-                       (cond (column-group (match-string column-group text))
-                             ('t "1")))
                       (source-str (and text-group
                                        (match-string text-group text)))
                       (lineno (string-to-number (or line-str "1")))
-                      (column (string-to-number (or column-str "1")))
                       (directory
                        (cond ((boundp 'starting-directory) starting-directory)
                                     (t nil)))
@@ -439,13 +422,13 @@ Otherwise return nil."
                                      source-str)))
                  (cond (callback-loc-fn
                         (funcall callback-loc-fn text
-                                 filename lineno column source-str
+                                 filename lineno source-str
                                  ignore-file-re cmd-mark))
                        ('t
                         (unless line-str
                           (message "line number not found -- using 1"))
                         (if (and filename lineno)
-                            (realgud:file-loc-from-line filename lineno column
+                            (realgud:file-loc-from-line filename lineno
                                                         cmd-mark
                                                         source-str nil
                                                         ignore-file-re
@@ -483,7 +466,6 @@ Otherwise return nil. CMD-MARK is set in the realgud-loc 
object created.
                    (loc-regexp     (realgud-loc-pat-regexp loc-pat))
                    (file-group     (realgud-loc-pat-file-group loc-pat))
                    (line-group     (realgud-loc-pat-line-group loc-pat))
-                   (col-group      (realgud-loc-pat-column-group loc-pat))
                    (text-group     (realgud-loc-pat-text-group loc-pat))
                    (ignore-file-re (realgud-loc-pat-ignore-file-re loc-pat))
                    (callback-loc-fn (realgud-sget 'cmdbuf-info 
'callback-loc-fn))
@@ -734,8 +716,6 @@ find a location. non-nil if we can find a location.
                                (realgud-loc-pat-regexp loc-pat)
                                (realgud-loc-pat-file-group loc-pat)
                                (realgud-loc-pat-line-group loc-pat)
-                               (realgud-loc-pat-column-group loc-pat)
-                               (realgud-loc-pat-text-group loc-pat)
                                nil
                                (realgud-loc-pat-ignore-file-re loc-pat)
                                ))
diff --git a/realgud/debugger/gdb/init.el b/realgud/debugger/gdb/init.el
index 4fa1c81..92bb5d6 100644
--- a/realgud/debugger/gdb/init.el
+++ b/realgud/debugger/gdb/init.el
@@ -45,7 +45,7 @@ realgud-loc-pat struct")
                       realgud:gdb-frame-file-regexp 
realgud:regexp-captured-num)
        :file-group 1
        :line-group 2
-       :column-group 3))
+       :char-offset-group 3))
 
 ;; Regular expression that describes a gdb prompt
 ;; For example:
diff --git a/realgud/debugger/gub/init.el b/realgud/debugger/gub/init.el
index 5b7bf93..f244267 100644
--- a/realgud/debugger/gub/init.el
+++ b/realgud/debugger/gub/init.el
@@ -81,7 +81,7 @@ realgud-loc-pat struct")
        :num 1
        :file-group 2
        :line-group 3
-       :column-group 4))
+       :char-offset-group 4))
 
 ;; Regular expression that describes a debugger "delete" (breakpoint) response.
 ;; For example:
diff --git a/realgud/debugger/jdb/core.el b/realgud/debugger/jdb/core.el
index 5f927cb..34064e1 100644
--- a/realgud/debugger/jdb/core.el
+++ b/realgud/debugger/jdb/core.el
@@ -97,10 +97,10 @@ that works."
      ))
   )
 
-(defun realgud:jdb-loc-fn-callback(text filename lineno column source-str
+(defun realgud:jdb-loc-fn-callback(text filename lineno source-str
                                        ignore-file-re cmd-mark)
-  (realgud:file-loc-from-line filename lineno nil
-                             cmd-mark source-str column
+  (realgud:file-loc-from-line filename lineno
+                             cmd-mark source-str nil
                              ignore-file-re 'realgud:jdb-find-file))
 
 (defun realgud:jdb-parse-cmd-args (orig-args)
diff --git a/realgud/debugger/nodejs/init.el b/realgud/debugger/nodejs/init.el
index a009e47..70634af 100644
--- a/realgud/debugger/nodejs/init.el
+++ b/realgud/debugger/nodejs/init.el
@@ -109,7 +109,7 @@ realgud-loc-pat struct")
        :num 1
        :file-group 2
        :line-group 3
-       :column-group 4))
+       :char-offset-group 4))
 
 (defconst realgud:nodejs-debugger-name "nodejs" "Name of debugger")
 
diff --git a/realgud/debugger/trepan/core.el b/realgud/debugger/trepan/core.el
index 93bd402..a844208 100644
--- a/realgud/debugger/trepan/core.el
+++ b/realgud/debugger/trepan/core.el
@@ -76,9 +76,9 @@ future, we may also consult RUBYPATH."
       ))
     ))
 
-(defun realgud:trepan-loc-fn-callback(text filename lineno column source-str
+(defun realgud:trepan-loc-fn-callback(text filename lineno source-str
                                           ignore-file-re cmd-mark)
-  (realgud:file-loc-from-line filename lineno column
+  (realgud:file-loc-from-line filename lineno
                              cmd-mark source-str nil nil
                              'realgud:trepan-find-file))
 
diff --git a/realgud/debugger/trepan2/core.el b/realgud/debugger/trepan2/core.el
index 2c2c282..ddf9011 100644
--- a/realgud/debugger/trepan2/core.el
+++ b/realgud/debugger/trepan2/core.el
@@ -85,9 +85,9 @@ we may also consult PYTHONPATH."
       ))
     ))
 
-(defun realgud:trepan2-loc-fn-callback(text filename lineno column source-str
+(defun realgud:trepan2-loc-fn-callback(text filename lineno source-str
                                            ignore-file-re cmd-mark)
-  (realgud:file-loc-from-line filename lineno column
+  (realgud:file-loc-from-line filename lineno
                              cmd-mark source-str nil nil
                              'realgud:trepan2-find-file))
 
diff --git a/realgud/debugger/trepanjs/init.el 
b/realgud/debugger/trepanjs/init.el
index 70053b5..9f37b6f 100644
--- a/realgud/debugger/trepanjs/init.el
+++ b/realgud/debugger/trepanjs/init.el
@@ -48,7 +48,7 @@ realgud-loc-pat struct")
                realgud:regexp-captured-num)
        :file-group 1
        :line-group 2
-       :column-group 3
+       :char-offset-group 3
        ))
 
 ;; realgud-loc-pat that describes a trepanjs command prompt
@@ -123,7 +123,7 @@ realgud-loc-pat struct")
        :num 1
        :file-group 2
        :line-group 3
-       :column-group 4
+       :char-offset-group 4
        ))
 
 (defconst realgud:trepanjs-debugger-name "trepanjs" "Name of debugger")
diff --git a/realgud/lang/js.el b/realgud/lang/js.el
index 8cc8f16..8d19847 100644
--- a/realgud/lang/js.el
+++ b/realgud/lang/js.el
@@ -35,7 +35,7 @@
                   realgud:regexp-captured-num realgud:regexp-captured-num)
    :file-group 2
    :line-group 3
-   :column-group 4)
+   :char-offset-group 4)
   "A realgud-loc-pat struct that describes a V8 backtrace location")
 
 (provide-me "realgud-lang-")
diff --git a/realgud/lang/python.el b/realgud/lang/python.el
index 47b2c27..2f41136 100644
--- a/realgud/lang/python.el
+++ b/realgud/lang/python.el
@@ -176,11 +176,10 @@ traceback) line."  )
 
 (defconst realgud-flake8-msg-loc-pat
   (make-realgud-loc-pat
-   :regexp "^\\(.*\\):\\([0-9]+\\):\\([0-9]+\\): [EFWCN]\\([0-9]+\\) "
+   :regexp "^\\(.*\\):\\([0-9]+\\):\\([0-9]+\\): [EW]\\([0-9]+\\) "
    :file-group 1
    :line-group 2
-   :column-group 3
-   :text-group nil
+   :char-offset-group 3
    )
   "A realgud-loc-pat struct that describes a flake8 warning or error line"
   )
diff --git a/test/test-file.el b/test/test-file.el
index 3164624..e9129d4 100644
--- a/test/test-file.el
+++ b/test/test-file.el
@@ -68,12 +68,12 @@
   (assert-t (stringp (realgud:file-loc-from-line test-filename 10001))
            "Line number too large for file")
 
-  (setq test-file-loc (realgud:file-loc-from-line (__FILE__) 5 nil nil ";; 
Note"))
+  (setq test-file-loc (realgud:file-loc-from-line (__FILE__) 5 nil ";; Note"))
   (assert-t (realgud-loc? test-file-loc)
            "Ok loc creation - no cmd marker")
 
   (assert-t (realgud-loc?
-            (realgud:file-loc-from-line test-filename 30 nil (make-marker)))
+            (realgud:file-loc-from-line test-filename 30 (make-marker)))
            "Ok loc creation - cmd marker")
 
   (assert-equal 5 (realgud-loc-line-number test-file-loc))
diff --git a/test/test-loc-regexp-nodejs.el b/test/test-loc-regexp-nodejs.el
index b93094f..f9b647d 100644
--- a/test/test-loc-regexp-nodejs.el
+++ b/test/test-loc-regexp-nodejs.el
@@ -20,7 +20,7 @@
 (declare-function assert-equal 'test-simple)
 (declare-function note 'test-simple)
 (declare-function end-tests 'test-simple)
-(declare-function realgud-loc-pat-column-group  'realgud:nodejs-init)
+(declare-function realgud-loc-pat-char-offset-group  'realgud:nodejs-init)
 
 (test-simple-start)
 
@@ -68,7 +68,7 @@
 (setq num-group (realgud-loc-pat-num realgud-pat-bt))
 (setq file-group (realgud-loc-pat-file-group realgud-pat-bt))
 (setq line-group (realgud-loc-pat-line-group realgud-pat-bt))
-(setq col-group (realgud-loc-pat-column-group realgud-pat-bt))
+(setq col-group (realgud-loc-pat-char-offset-group realgud-pat-bt))
 (assert-equal 0 (string-match bt-re test-s1))
 (assert-equal "0" (substring test-s1
                             (match-beginning num-group)
diff --git a/test/test-regexp-gub.el b/test/test-regexp-gub.el
index faf87ac..0240a05 100644
--- a/test/test-regexp-gub.el
+++ b/test/test-regexp-gub.el
@@ -12,13 +12,11 @@
 
 (eval-when-compile
   (defvar dbg-name)
+  (defvar realgud:gub-pat-hash)
   (defvar panic-tb)
-  (defvar prompt-match)
+  (defvar test-tb)
   (defvar prompt-pat)
-  (defvar realgud:gub-pat-hash)
-  (defvar tb-loc-match)
   (defvar test-dbgr)
-  (defvar test-tb)
   (defvar test-text)
 )
 
diff --git a/test/test-regexp-python.el b/test/test-regexp-python.el
index 2471d2b..35301c2 100644
--- a/test/test-regexp-python.el
+++ b/test/test-regexp-python.el
@@ -35,7 +35,7 @@
                            test-text))
 
 (assert-equal "17"
-             (match-string (realgud-loc-pat-column-group 
realgud-flake8-msg-loc-pat)
+             (match-string (realgud-loc-pat-char-offset-group 
realgud-flake8-msg-loc-pat)
                            test-text))
 
 (setq test-text
@@ -54,7 +54,7 @@
                            test-text))
 
 (assert-equal "1"
-             (match-string (realgud-loc-pat-column-group 
realgud-flake8-msg-loc-pat)
+             (match-string (realgud-loc-pat-char-offset-group 
realgud-flake8-msg-loc-pat)
                            test-text))
 
 ;; FIXME add pytest testing
diff --git a/test/test-regexp-rdebug.el b/test/test-regexp-rdebug.el
index 8eb535b..c57dc23 100644
--- a/test/test-regexp-rdebug.el
+++ b/test/test-regexp-rdebug.el
@@ -10,10 +10,6 @@
 (test-simple-start)
 
 (eval-when-compile
-  (defvar helper-bps)
-  (defvar helper-bt)
-  (defvar prompt-pat)
-  (defvar rails-bt)
   (defvar realgud-rdebug-pat-hash)
 )
 
diff --git a/test/test-regexp-trepan.el b/test/test-regexp-trepan.el
index 5be508a..bff0331 100644
--- a/test/test-regexp-trepan.el
+++ b/test/test-regexp-trepan.el
@@ -7,20 +7,6 @@
 
 (test-simple-start)
 
-(eval-when-compile
-  (defvar bps-pat)
-  (defvar dbg-bt-pat)
-  (defvar ctrl-pat)
-  (defvar file-group)
-  (defvar line-group)
-  (defvar prompt-pat)
-  (defvar lang-bt-pat)
-  (defvar tb-loc-match)
-  (defvar test-dbgr)
-  (defvar test-s1)
-  (defvar test-text)
-)
-
 (set (make-local-variable 'bps-pat)
      (gethash "brkpt-set"          realgud:trepan-pat-hash))
 (set (make-local-variable 'dbg-bt-pat)
@@ -35,26 +21,26 @@
 ;; FIXME: we get a void variable somewhere in here when running
 ;;        even though we define it in lexical-let. Dunno why.
 ;;        setq however will workaround this.
-(set (make-local-variable 'test-text)
+(set (make-local-variable 'text)
  "     from /usr/local/bin/irb:12:in `<main>'")
 
 (note "traceback location matching")
 
-(setq test-text "      from /usr/local/bin/irb:12:in `<main>'")
+(setq text "   from /usr/local/bin/irb:12:in `<main>'")
 
-(assert-t (numberp (loc-match test-text lang-bt-pat))
+(assert-t (numberp (loc-match text lang-bt-pat))
          "basic traceback location")
 (assert-equal "/usr/local/bin/irb"
-             (match-string (realgud-loc-pat-file-group lang-bt-pat) test-text)
+             (match-string (realgud-loc-pat-file-group lang-bt-pat) text)
              "extract traceback file name")
 
 (assert-equal "12"
              (match-string (realgud-loc-pat-line-group
-                            lang-bt-pat) test-text)
+                            lang-bt-pat) text)
              "extract traceback line number")
 
 (note "debugger-backtrace")
-(set (make-local-variable 'test-s1)
+(set (make-local-variable 's1)
      "--> #0 METHOD Object#require(path) in file <internal:lib/require> at 
line 28
     #1 TOP Object#<top /tmp/linecache.rb> in file /tmp/linecache.rb
 ")
@@ -68,26 +54,26 @@
 (set (make-local-variable 'line-group)
      (realgud-loc-pat-line-group dbg-bt-pat))
 
-(assert-equal 0 (string-match frame-re test-s1))
-(assert-equal "0" (substring test-s1
+(assert-equal 0 (string-match frame-re s1))
+(assert-equal "0" (substring s1
                             (match-beginning num-group)
                             (match-end num-group)))
 (assert-equal "<internal:lib/require>"
-             (substring test-s1
+             (substring s1
                         (match-beginning file-group)
                         (match-end file-group)))
 (assert-equal "28"
-             (substring test-s1
+             (substring s1
                         (match-beginning line-group)
                         (match-end line-group)))
 (setq pos (match-end 0))
 
-(assert-equal 77 (string-match frame-re test-s1 pos))
-(assert-equal "1" (substring test-s1
+(assert-equal 77 (string-match frame-re s1 pos))
+(assert-equal "1" (substring s1
                             (match-beginning num-group)
                             (match-end num-group)))
 (assert-equal "/tmp/linecache.rb"
-             (substring test-s1
+             (substring s1
                         (match-beginning file-group)
                         (match-end file-group)))
 
@@ -116,24 +102,23 @@
                 ctrl-pat)
              )
 
-(setq test-text
-      "Breakpoint 1 set at VM offset 2 of instruction sequence \"<top 
/usr/local/bin/irb>\",
+(setq text "Breakpoint 1 set at VM offset 2 of instruction sequence \"<top 
/usr/local/bin/irb>\",
        line 9 in file /usr/local/bin/irb.
 ")
 
 
-(assert-t (numberp (loc-match test-text bps-pat))
+(assert-t (numberp (loc-match text bps-pat))
          "basic breakpoint location")
 
 
 (assert-equal "/usr/local/bin/irb"
              (match-string (realgud-loc-pat-file-group
-                            bps-pat) test-text)
+                            bps-pat) text)
              "extract breakpoint file name")
 
 (assert-equal "9"
              (match-string (realgud-loc-pat-line-group
-                            bps-pat) test-text)
+                            bps-pat) text)
              "extract breakpoint line number")
 
 (end-tests)
diff --git a/test/test-track.el b/test/test-track.el
index d167cb8..5e98fec 100644
--- a/test/test-track.el
+++ b/test/test-track.el
@@ -24,18 +24,10 @@
 (test-simple-start)
 
 (eval-when-compile
-  (defvar alt-file-group)
-  (defvar alt-line-group)
-  (defvar column-group)
   (defvar debugger-output)
-  (defvar file-group)
-  (defvar line-group)
   (defvar line-number)
-  (defvar loc-regexp)
   (defvar realgud-pat-hash)
   (defvar test-filename)
-  (defvar test-loc)
-  (defvar text-group)
 )
 
 ;; Some setup usually done in setting up the buffer.
@@ -45,34 +37,22 @@
 
 ;; FIXME/WARNING the below is customized for trepan
 (realgud-cmdbuf-init (current-buffer) "trepan"
-                    (gethash "trepan" realgud-pat-hash))
-
-(setq loc-regexp (realgud-sget 'cmdbuf-info 'loc-regexp))
-(setq file-group (realgud-sget 'cmdbuf-info 'file-group))
-(setq line-group (realgud-sget 'cmdbuf-info 'line-group))
-(setq column-group (realgud-sget 'cmdbuf-info 'column-group))
-(setq alt-file-group (realgud-sget 'cmdbuf-info 'alt-file-group))
-(setq alt-line-group (realgud-sget 'cmdbuf-info 'alt-line-group))
-(setq text-group (realgud-sget 'cmdbuf-info 'text-group))
+                 (gethash "trepan" realgud-pat-hash))
 
 (setq test-filename (symbol-file 'test-simple))
 (setq line-number 7)
 (setq debugger-output (format "-> (%s:%d)\nrequire 'foo'\n(trepan):\n"
                              test-filename line-number))
-(setq test-loc
-      (realgud-track-loc debugger-output nil
-                        loc-regexp file-group
-                        line-group column-group text-group
-                        ))
-
-(assert-t (realgud-loc-p test-loc)   "loc extracted")
-(assert-equal "(trepan):\n"
-             (realgud-track-loc-remaining debugger-output)
-             "loc-remaining")
-(assert-equal test-filename (realgud-loc-filename test-loc)
-             "loc filename extracted")
-(assert-equal line-number (realgud-loc-line-number test-loc)
-             "loc line-number extracted")
+(let ((loc (realgud-track-loc debugger-output nil)))
+  (assert-t (realgud-loc-p loc)   "loc extracted")
+  (assert-equal "(trepan):\n"
+               (realgud-track-loc-remaining debugger-output)
+               "loc-remaining")
+  (assert-equal test-filename (realgud-loc-filename loc)
+               "loc filename extracted")
+  (assert-equal line-number (realgud-loc-line-number loc)
+               "loc line-number extracted")
+  )
 
 (note "realgud-track-selected-frame")
 (setq debugger-output "up



reply via email to

[Prev in Thread] Current Thread [Next in Thread]