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

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

[elpa] master 52b2760: Sync with github and MELPA stable


From: Rocky Bernstein
Subject: [elpa] master 52b2760: Sync with github and MELPA stable
Date: Thu, 22 Mar 2018 05:11:15 -0400 (EDT)

branch: master
commit 52b2760ec79ed037d689ae1dc62b8e3111165686
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    Sync with github and MELPA stable
---
 packages/realgud/INSTALL.md                        | 14 +++-
 packages/realgud/install-from-git.sh               | 21 +++--
 packages/realgud/realgud.el                        | 24 ++++--
 packages/realgud/realgud/.nosearch                 | 11 +++
 packages/realgud/realgud/common/bp.el              |  6 +-
 packages/realgud/realgud/common/buffer/command.el  |  6 +-
 packages/realgud/realgud/common/cmds.el            |  2 +-
 packages/realgud/realgud/common/fringe.el          | 33 ++++++--
 packages/realgud/realgud/common/key.el             | 25 ++----
 packages/realgud/realgud/common/send.el            | 23 ++++-
 packages/realgud/realgud/common/track-mode.el      |  2 +-
 packages/realgud/realgud/common/track.el           | 98 ++++++++++++----------
 packages/realgud/realgud/debugger/bashdb/bashdb.el | 27 +++++-
 packages/realgud/realgud/debugger/nodejs/core.el   |  2 +-
 packages/realgud/realgud/debugger/nodejs/init.el   | 30 +++++--
 packages/realgud/realgud/debugger/nodejs/nodejs.el | 11 ++-
 packages/realgud/realgud/debugger/trepan3k/init.el | 11 +--
 packages/realgud/realgud/debugger/trepanjs/init.el |  4 +-
 packages/realgud/test/.gitignore                   |  1 +
 packages/realgud/test/gcd.js                       |  3 +-
 packages/realgud/test/test-bt-trepan2.el           | 34 ++++++++
 packages/realgud/test/test-pdb.el                  | 12 +--
 packages/realgud/test/test-realgud.el              | 71 +++++++++-------
 packages/realgud/test/test-regexp-remake.el        |  6 ++
 packages/realgud/test/test-regexp-trepan.el        |  8 ++
 packages/realgud/test/test-send.el                 | 10 ++-
 packages/realgud/test/test-track.el                | 95 ++++++++++++++++++---
 packages/realgud/test/test-utils.el                |  4 +
 28 files changed, 426 insertions(+), 168 deletions(-)

diff --git a/packages/realgud/INSTALL.md b/packages/realgud/INSTALL.md
index cc7f7dd..3990d1c 100644
--- a/packages/realgud/INSTALL.md
+++ b/packages/realgud/INSTALL.md
@@ -1,5 +1,15 @@
 * Have `test-simple`, `loc-changes`, `cl-lib` and `load-relative` installed.
 * From inside emacs, evaluate:
 ```lisp
-  (compile (format "EMACSLOADPATH=:%s:%s ./autogen.sh" (file-name-directory 
(locate-library "test-simple.elc")) (file-name-directory (locate-library 
"realgud.elc"))))
-```
+  (compile (format "EMACSLOADPATH=:%s:%s:%s:%s ./autogen.sh" 
(file-name-directory (locate-library "test-simple.elc")) (file-name-directory 
(locate-library "load-relative.elc")) (file-name-directory (locate-library 
"loc-changes.elc")) (file-name-directory (locate-library "realgud.elc")) ))
+  ```
+
+After this you should be able to run:
+
+    $ make         # byte compile everything
+    $ make check   # run unit tests
+    $ make install # may need to prefix with sudo
+
+
+Also you can run from the source directory by running `eval-current-buffer`
+when inside to top level `realgud.el` (that's the one that is in this folder).
diff --git a/packages/realgud/install-from-git.sh 
b/packages/realgud/install-from-git.sh
index 8f1291a..76d5c3c 100755
--- a/packages/realgud/install-from-git.sh
+++ b/packages/realgud/install-from-git.sh
@@ -47,6 +47,7 @@
 #   GIT_PROTOCOL='git' SUDO_CMD=' ' sh ./install-from-git.sh --prefix=/tmp
 
 GIT_PROTOCOL=${GIT_PROTOCOL:-https}
+MAKE=${MAKE:-make}
 
 # Run and echo a command
 run_cmd() {
@@ -79,24 +80,26 @@ fi
 
 for program in git make $try_cmd ; do
     if ! which $program >/dev/null 2>&1 ; then
-       echo "Can't find program $program in $PATH"
+       echo 2>&1 "Can't find program $program in $PATH"
        exit 1
     fi
 done
 
-for pkg in emacs-{test-simple,load-relative,loc-changes,dbgr} ; do
+cd /tmp
+for pkg in rocky/emacs-{test-simple,load-relative,loc-changes} realgud/realgud 
; do
     echo '******************************************'
     echo Trying to install ${pkg}...
     echo '******************************************'
-    if [[ -d $pkg ]]; then
-       run_cmd $need_sudo rm -fr $pkg
+    pkg_short=$(basename $pkg)
+    if [[ -d $pkg_short ]]; then
+       run_cmd $need_sudo rm -fr $pkg_short
     fi
-    run_cmd git clone ${GIT_PROTOCOL}://github.com/rocky/${pkg}.git
-    (cd $pkg && \
+    run_cmd git clone ${GIT_PROTOCOL}://github.com/${pkg}.git
+    (cd $pkg_short && \
         run_cmd $SHELL ./autogen.sh && \
        run_cmd ./configure $@ && \
-       run_cmd make && \
-       run_cmd make check && \
-        run_cmd $need_sudo make install
+       run_cmd ${MAKE} && \
+       run_cmd ${MAKE} check && \
+        run_cmd $need_sudo ${MAKE} install
     )
 done
diff --git a/packages/realgud/realgud.el b/packages/realgud/realgud.el
index 0826911..d15b324 100644
--- a/packages/realgud/realgud.el
+++ b/packages/realgud/realgud.el
@@ -1,13 +1,13 @@
 ;;; realgud.el --- A modular front-end for interacting with external debuggers
 
 ;; Author: Rocky Bernstein <address@hidden>
-;; Version: 1.4.4
+;; Version: 1.4.5
 ;; Package-Type: multi
 ;; Package-Requires: ((load-relative "1.2") (loc-changes "1.2") (test-simple  
"1.2.0") (cl-lib "0.5") (emacs "24"))
 ;; URL: http://github.com/realgud/realgud/
-;; Keywords: gdb, python, perl, go, bash, nodejs, zsh, bashdb, zshdb, remake, 
make, trepan, perldb
+;; Keywords: gdb, python, perl, go, bash, nodejs, zsh, bashdb, zshdb, remake, 
make, trepan, perldb, pdb
 
-;; Copyright (C) 2015-2017 Free Software Foundation, Inc
+;; Copyright (C) 2015-2018 Free Software Foundation, Inc
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -35,8 +35,8 @@
 ;;
 ;; Once upon a time in an Emacs far far away and a programming-style
 ;; deservedly banished, there was a monolithic Cathederal-like
-;; debugger front-end called gub.  This interfaced with a number of
-;; debuggers, many now dead.  Is there anyone still alive that
+;; debugger front-end called gud.  This interfaced with a number of
+;; debuggers, many now dead.[1]  Is there anyone still alive that
 ;; remembers sdb from UNIX/32V circa 1980?
 ;;
 ;; This isn't that.  Here we make use of more modern programming
@@ -49,13 +49,15 @@
 ;; Oh, and because global variables are largely banned, we can support
 ;; several simultaneous debug sessions.
 
-;; If you don't see your favorite debugger, see URL
+;; RealGUD supports many external debuggers. See URL
+;; `https://github.com/realgud/realgud/wiki/Debuggers-Supported' for a
+;; list.  However, if you don't see your favorite debugger, see URL
 ;; `https://github.com/realgud/realgud/wiki/How-to-add-a-new-debugger/'
 ;; for how you can add your own.
 
 ;; The debugger is run out of a comint process buffer, or you can use
-;; a `realgud-track-mode' inside an existing comint shell, shell, or
-;; eshell buffer.
+;; a `realgud-track-mode' inside an existing comint shell, or eshell
+;; buffer.
 
 ;; To install you will need a couple of other Emacs packages
 ;; installed.  If you install via melpa (`package-install') or
@@ -64,6 +66,12 @@
 ;; `https://github.com/realgud/realgud/wiki/How-to-Install' for all
 ;; the ways to to install and more details on installation.
 
+;; [1] Four or more years in, as of 2018 realgud sports a number of
+;; old debuggers too.  However we *mark* them as such, and move them
+;; out of the main code base. See for example:
+;; https://github.com/realgud/realgud-old-debuggers.  So that's
+;; another difference: this code better *maintained*.
+
 ;;; Code:
 
 ;; Press C-x C-e at the end of the next line configure the program in
diff --git a/packages/realgud/realgud/.nosearch 
b/packages/realgud/realgud/.nosearch
index e69de29..d9771c7 100644
--- a/packages/realgud/realgud/.nosearch
+++ b/packages/realgud/realgud/.nosearch
@@ -0,0 +1,11 @@
+The default install-from-git.sh can install realgud into a site-lisp,
+e.g /usr/local/share/emacs-site-lisp.
+
+site-lisp directories and their subdirectories may be automatically
+added to load path, in particular in Debian
+/usr/local/share/emacs/site-lisp/ is added to load-path before emacs
+system directories.  So realgud's common/buffer/info.el is loaded
+before emacs's info.el
+
+Adding this ".nosearch" file prevents emacs from adding realgud to the
+load-path.
diff --git a/packages/realgud/realgud/common/bp.el 
b/packages/realgud/realgud/common/bp.el
index 4e13a15..6e685f1 100644
--- a/packages/realgud/realgud/common/bp.el
+++ b/packages/realgud/realgud/common/bp.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2010, 2012-2015, 2017 Free Software Foundation, Inc
+;; Copyright (C) 2010, 2012-2015, 2017-2018 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <address@hidden>
 
@@ -106,12 +106,12 @@ Only used in text terminals: fringe icons always use
   :group 'realgud-bp)
 
 (defface realgud-bp-line-enabled-face
-  '((t :underline "red"))
+  '((t (:box (:color "red"))))
   "Face for lines with enabled breakpoints."
   :group 'realgud-bp)
 
 (defface realgud-bp-line-disabled-face
-  '((t :underline "gray"))
+  '((t (:box (:color "grey"))))
   "Face for lines with disabled breakpoints."
   :group 'realgud-bp)
 
diff --git a/packages/realgud/realgud/common/buffer/command.el 
b/packages/realgud/realgud/common/buffer/command.el
index 8e0e66c..db159f8 100644
--- a/packages/realgud/realgud/common/buffer/command.el
+++ b/packages/realgud/realgud/common/buffer/command.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015-2017 Free Software Foundation, Inc
+;; Copyright (C) 2015-2018 Free Software Foundation, Inc
 ;; Author: Rocky Bernstein <address@hidden>
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -468,9 +468,9 @@ command-process buffer has stored."
                    (list (propertize
                           (format ":%s%s"
                                   (process-status cmd-process) debug-status)
-                          'face 'debugger-running))
+                          'face 'realgud-debugger-running))
                  (list (propertize ":not running" 'face
-                       'debugger-not-running))
+                       'realgud-debugger-not-running))
                  ))
          (setq mode-line-process status)
          ;; Force mode line redisplay soon.
diff --git a/packages/realgud/realgud/common/cmds.el 
b/packages/realgud/realgud/common/cmds.el
index 9c7f88f..594b8a0 100644
--- a/packages/realgud/realgud/common/cmds.el
+++ b/packages/realgud/realgud/common/cmds.el
@@ -272,7 +272,7 @@ EVENT should be a mouse click on the left fringe or margin."
 
 (defun realgud:cmd-eval(arg)
     "Evaluate an expression."
-    (interactive "MEval expesssion: ")
+    (interactive "MEval expression: ")
     (realgud:cmd-run-command arg "eval")
 )
 
diff --git a/packages/realgud/realgud/common/fringe.el 
b/packages/realgud/realgud/common/fringe.el
index f974e28..b3ee9eb 100644
--- a/packages/realgud/realgud/common/fringe.el
+++ b/packages/realgud/realgud/common/fringe.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2010, 2012, 2014-2016 Free Software Foundation, Inc
+;; Copyright (C) 2010, 2012, 2014-2016, 2018 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <address@hidden>
 
@@ -27,27 +27,42 @@
     (define-fringe-bitmap 'hollow-right-triangle
       "\xe0\x90\x88\x84\x84\x88\x90\xe0"))
 
+(defface realgud-debugger-running
+  '((((class color) (min-colors 16) (background light))
+     (:foreground "Green4" :weight bold))
+    (((class color) (min-colors 88) (background dark))
+     (:foreground "Green1" :weight bold))
+    (((class color) (min-colors 16) (background dark))
+     (:foreground "Green" :weight bold))
+    (((class color)) (:foreground "green" :weight bold))
+    (t (:weight bold)))
+  "Face used to highlight debugger run information."
+  :group 'realgud
+  :version "24.3")
+
+(defface realgud-debugger-not-running
+  '((t :inherit font-lock-warning-face))
+  "Face used when debugger or process is not running."
+  :group 'realgud
+  :version "24.3")
+
+
 ;; FIXME: Figure out how to do this as a macro.
 
 (defface realgud-overlay-arrow1
-  '((((class color) (min-colors 16) (background light)) :foreground 
"ForestGreen" :weight bold)
-    (((class color) (min-colors 16) (background dark))  :foreground 
"PaleGreen" :weight bold)
-    (((class color) (min-colors 8)) :foreground "green")
-    (((class grayscale) (background light)) :foreground "Black" :weight bold)
-    (((class grayscale) (background dark))  :foreground "White" :weight bold)
-    (t :weight bold))
+  '((t :inherit realgud-debugger-running))
     "Realgud fringe face for current position indicator."
     :group 'realgud)
 
 (defface realgud-overlay-arrow2
   '((((background  dark)) :foreground "white" :weight bold)
-    (((background light)) :foreground "black" :weight bold))
+    (((background light)) :foreground "tan1" :weight bold))
   "Fringe face for current position."
   :group 'realgud)
 
 (defface realgud-overlay-arrow3
   '((((background  dark)) :foreground "DimGray")
-    (((background light)) :foreground "DarkGray"))
+    (((background light)) :foreground "tan4"))
   "Fringe face for current position."
   :group 'realgud)
 
diff --git a/packages/realgud/realgud/common/key.el 
b/packages/realgud/realgud/common/key.el
index 86357fd..bb5ed7c 100644
--- a/packages/realgud/realgud/common/key.el
+++ b/packages/realgud/realgud/common/key.el
@@ -4,7 +4,7 @@
 ;; URL: http://github.com/rocky/emacs-load-relative
 ;; Compatibility: GNU Emacs 24.x
 
-;; Copyright (C) 2015 Free Software Foundation, Inc
+;; Copyright (C) 2015, 2017 Free Software Foundation, Inc
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -27,27 +27,14 @@
 
 (defcustom realgud-populate-common-fn-keys-function
   'realgud-populate-common-fn-keys-standard
-  "The function to call to populate key bindings common to all dbgr windows.
+  "The function to call to populate key bindings common to all realgud windows.
 This includes the secondary windows, the debugger shell, and all
-Ruby source buffers when the debugger is active.
+realgud source buffers when the debugger is active.
 
 This variable can be bound to the following:
 
-* nil -- Don't bind any keys.
-
+* `realgud-populate-common-fn-keys-none' -- Don't bind any keys.
 * `realgud-populate-common-fn-keys-standard' -- Bind the function
-  keys according to a widely used debugger convention:
-
-\\{realgud-example-map-standard}
-
-* `realgud-populate-common-fn-keys-eclipse' -- Bind according to Eclipse.
-
-\\{realgud-example-map-eclipse}
-
-* `realgud-populate-common-fn-keys-netbeans' -- Bind according to NetBeans.
-
-\\{realgud-example-map-netbeans}
-
 * Any other value is expected to be a callable function that takes one
   argument, the keymap, and populates it with suitable keys."
   :type 'function
@@ -83,6 +70,10 @@ This variable can be bound to the following:
   (define-key map "\C-c " 'realgud:cmd-break)
   )
 
+(defun realgud-populate-common-fn-keys-none (&optional map)
+  "Do not any debugger function keys"
+  )
+
 ;; TODO: add eclipse, and netbeans
 
 (defun realgud-populate-common-keys (map)
diff --git a/packages/realgud/realgud/common/send.el 
b/packages/realgud/realgud/common/send.el
index 81edf16..4c112c1 100644
--- a/packages/realgud/realgud/common/send.el
+++ b/packages/realgud/realgud/common/send.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015-2016 Free Software Foundation, Inc
+;; Copyright (C) 2015-2016, 2018 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <address@hidden>
 
@@ -140,6 +140,7 @@ taken from current buffer, or OPT-BUFFER if non-nil.  Some
   %c -- Fully qualified class name derived from the expression
         surrounding point.
   %p -- Value of OPT-STR, converted to string using `int-to-string'
+  %q -- Value of OPT-STR with string escapes (as ksh, bash, and zsh do).
   %s -- Value of OPT-STR.
 
 %p and %s are replaced by an empty string if OPT-STR is nil."
@@ -149,7 +150,7 @@ taken from current buffer, or OPT-BUFFER if non-nil.  Some
         result)
     (while (and fmt-str
                (let ((case-fold-search nil))
-                 (string-match "\\([^%]*\\)%\\([dfFlpxXs]\\)" fmt-str)))
+                 (string-match "\\([^%]*\\)%\\([dfFlpqxXs]\\)" fmt-str)))
       (let* ((key-str (match-string 2 fmt-str))
             (key (string-to-char key-str)))
        (setq result
@@ -179,20 +180,34 @@ taken from current buffer, or OPT-BUFFER if non-nil.  Some
                          (+ (count-lines (point-min) (point))
                             (if (bolp) 1 0)))))
                   "source-buffer-not-found-for-%l"))
+
+                ((eq key ?p) (if opt-str (int-to-string opt-str) ""))
+
+               ;; String with escapes. %q follows shell (ksh, bash, zsh)
+               ;; The other possibility was Python's %r, !r or "repr".
+               ;; That isn't as perfect a fit though.
+                ((eq key ?q) (if opt-str
+                                (let ((print-escape-newlines t))
+                                  (prin1-to-string opt-str))
+                                ""))
+
+               ;; String
+                ((eq key ?s) (or opt-str ""))
+
                ((eq key ?x)
                 (or (and src-file-name src-file-name)
                     "*source-file-not-found-for-%x"))
                ((eq key ?X)
                 (or (and src-file-name (expand-file-name src-file-name))
                     "*source-file-not-found-for-%X"))
+
                ;; ((eq key ?e)
                ;;  (gud-find-expr))
                ;; ((eq key ?a)
                ;;  (gud-read-address))
                ;; ((eq key ?c)
                ;;   (gud-find-class srcbuf))
-                ((eq key ?p) (if opt-str (int-to-string opt-str) ""))
-                ((eq key ?s) (or opt-str ""))
+
                 (t key)))))
       (setq fmt-str (substring fmt-str (match-end 2))))
     ;; There might be text left in FMT-STR when the loop ends.
diff --git a/packages/realgud/realgud/common/track-mode.el 
b/packages/realgud/realgud/common/track-mode.el
index bb30e5b..4ca2c63 100644
--- a/packages/realgud/realgud/common/track-mode.el
+++ b/packages/realgud/realgud/common/track-mode.el
@@ -168,7 +168,7 @@ of this mode."
             (status (if cmd-process
                         (list (propertize (format ":%s"
                                                   (process-status cmd-process))
-                           'face 'debugger-running))
+                           'face 'realgud-debugger-running))
                       ""))
             )
        (setq mode-line-process status)
diff --git a/packages/realgud/realgud/common/track.el 
b/packages/realgud/realgud/common/track.el
index 1bae618..d081449 100644
--- a/packages/realgud/realgud/common/track.el
+++ b/packages/realgud/realgud/common/track.el
@@ -223,59 +223,71 @@ evaluating (realgud-cmdbuf-info-loc-regexp 
realgud-cmdbuf-info)"
         ;; 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 (realgud:eval-command-p text)
           (realgud:message-eval-results text))
 
-       (if (not (equal "" text))
-           (with-current-buffer cmdbuf
-             (if (realgud-sget 'cmdbuf-info 'divert-output?)
-                 (realgud-track-divert-prompt text cmdbuf to))
-             ;; FIXME: instead of these fixed filters,
-             ;; put into a list and iterate over that.
-             (realgud-track-termination? text)
-             (setq text-sans-loc (or (realgud-track-loc-remaining text) text))
-             (realgud-track-bp-enable-disable text-sans-loc
-                                              (realgud-cmdbuf-pat 
"brkpt-enable")
-                                              't)
-             (realgud-track-bp-enable-disable text-sans-loc
-                                              (realgud-cmdbuf-pat 
"brkpt-disable")
-                                              nil)
-             (setq frame-num (realgud-track-selected-frame text))
-             (if (and frame-num (not loc))
-                 (setq loc (realgud-track-loc-from-selected-frame
-                            text cmd-mark)))
-
-             (setq bp-loc (realgud-track-bp-loc text-sans-loc cmd-mark cmdbuf))
-             (if bp-loc
-                 (let ((src-buffer (realgud-loc-goto bp-loc)))
-                   (realgud-cmdbuf-add-srcbuf src-buffer cmdbuf)
-                   (with-current-buffer src-buffer
-                     (realgud-bp-add-info bp-loc)
-                     )))
-             (if loc
-                 (let ((selected-frame
-                        (or (not frame-num)
-                            (eq frame-num (realgud-cmdbuf-pat 
"top-frame-num")))))
-                   (realgud-track-loc-action loc cmdbuf (not selected-frame)
-                                              shortkey-on-tracing?)
-                   (realgud-cmdbuf-info-in-debugger?= 't)
-                    (realgud-cmdbuf-mode-line-update))
-                (dolist (bp-loc (realgud-track-bp-delete text-sans-loc 
cmd-mark cmdbuf))
-                  (let ((src-buffer (realgud-loc-goto bp-loc)))
-                    (realgud-cmdbuf-add-srcbuf src-buffer cmdbuf)
-                    (with-current-buffer src-buffer
-                      (realgud-bp-del-info bp-loc)
-                      ))))
-              )
-          )
+      (if (not (equal "" text))
+          (with-current-buffer cmdbuf
+            (if (realgud-sget 'cmdbuf-info 'divert-output?)
+                (realgud-track-divert-prompt text cmdbuf to))
+            ;; FIXME: instead of these fixed filters,
+            ;; put into a list and iterate over that.
+            (realgud-track-termination? text)
+            (setq text-sans-loc (or (realgud-track-loc-remaining text) text))
+            (setq frame-num (realgud-track-selected-frame text))
+            (if (and frame-num (not loc))
+                (setq loc (realgud-track-loc-from-selected-frame
+                           text cmd-mark)))
+
+            (realgud:track-handle-breakpoints text-sans-loc cmd-mark cmdbuf)
+
+            (if loc
+                (let ((selected-frame
+                       (or (not frame-num)
+                           (eq frame-num (realgud-cmdbuf-pat 
"top-frame-num")))))
+                  (realgud-track-loc-action loc cmdbuf (not selected-frame)
+                                            shortkey-on-tracing?)
+                  (realgud-cmdbuf-info-in-debugger?= 't)
+                  (realgud-cmdbuf-mode-line-update)))
+
+            )
         )
+      )
     )
   )
 
+(defun realgud:track-handle-breakpoints (text-sans-loc cmd-mark cmdbuf)
+  (realgud:track-add-breakpoint text-sans-loc cmd-mark cmdbuf)
+  (realgud:track-remove-breakpoints text-sans-loc cmd-mark cmdbuf))
+
+(defun realgud:track-add-breakpoint (text-sans-loc cmd-mark cmdbuf)
+  "Add a breakpoint fringe in source window if BP-LOC."
+  (realgud-track-bp-enable-disable text-sans-loc
+                                   (realgud-cmdbuf-pat "brkpt-enable")
+                                   't)
+
+  (let ((bp-loc (realgud-track-bp-loc text-sans-loc cmd-mark cmdbuf)))
+    (if bp-loc
+        (let ((src-buffer (realgud-loc-goto bp-loc)))
+          (realgud-cmdbuf-add-srcbuf src-buffer cmdbuf)
+          (with-current-buffer src-buffer
+            (realgud-bp-add-info bp-loc))))))
+
+(defun realgud:track-remove-breakpoints (text-sans-loc cmd-mark cmdbuf)
+  "Remove all breakpoints in source window found in BP-LOCS."
+  (realgud-track-bp-enable-disable text-sans-loc
+                                   (realgud-cmdbuf-pat "brkpt-disable")
+                                   nil)
+
+  (dolist (bp-loc (realgud-track-bp-delete text-sans-loc cmd-mark cmdbuf))
+    (let ((src-buffer (realgud-loc-goto bp-loc)))
+      (realgud-cmdbuf-add-srcbuf src-buffer cmdbuf)
+      (with-current-buffer src-buffer
+        (realgud-bp-del-info bp-loc)))))
+
 (defun realgud-track-hist-fn-internal(fn)
   "Update both command buffer and a source buffer to reflect the
 selected location in the location history. If we started in a
diff --git a/packages/realgud/realgud/debugger/bashdb/bashdb.el 
b/packages/realgud/realgud/debugger/bashdb/bashdb.el
index ffffbe2..9853b01 100644
--- a/packages/realgud/realgud/debugger/bashdb/bashdb.el
+++ b/packages/realgud/realgud/debugger/bashdb/bashdb.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015-2016 Free Software Foundation, Inc
+;; Copyright (C) 2015-2016, 2018 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <address@hidden>
 
@@ -77,7 +77,32 @@ fringe and marginal icons.
                        opt-cmd-line no-reset)
   )
 
+(defun realgud:bashdb-large (&optional opt-cmd-line no-reset)
+  "Use this is the program you are debugging is large, say over 1,000 lines or 
so.
+"
+  (interactive)
+  (let ((cmd-buf
+        (realgud:run-debugger "bashdb"
+                              'bashdb-query-cmdline
+                              'bashdb-parse-cmd-args
+                              'realgud:bashdb-minibuffer-history
+                              opt-cmd-line no-reset)
+        ))
+    (if cmd-buf
+       (let ((process (get-buffer-process cmd-buf)))
+         (if (and process (eq 'run (process-status process)))
+             (with-current-buffer cmd-buf
+               (sleep-for 1)
+               (realgud-command "frame 0" nil nil nil)
+               )))
+      )
+    ))
+
+
 ;;;###autoload
 (defalias 'bashdb 'realgud:bashdb)
 
+;;;###autoload
+(defalias 'bashdb-large 'realgud:bashdb-large)
+
 (provide-me "realgud-")
diff --git a/packages/realgud/realgud/debugger/nodejs/core.el 
b/packages/realgud/realgud/debugger/nodejs/core.el
index f27b4ed..c60af97 100644
--- a/packages/realgud/realgud/debugger/nodejs/core.el
+++ b/packages/realgud/realgud/debugger/nodejs/core.el
@@ -126,7 +126,7 @@ Note that path elements have been expanded via 
`expand-file-name'.
 
 (defun realgud:nodejs-suggest-invocation (debugger-name)
   "Suggest a nodejs command invocation via `realgud-suggest-invocaton'"
-  (realgud-suggest-invocation (or debugger-name realgud:nodejs-command-name)
+  (realgud-suggest-invocation realgud:nodejs-command-name
                              realgud:nodejs-minibuffer-history
                              "js" "\\.js$"))
 
diff --git a/packages/realgud/realgud/debugger/nodejs/init.el 
b/packages/realgud/realgud/debugger/nodejs/init.el
index 70634af..a095dec 100644
--- a/packages/realgud/realgud/debugger/nodejs/init.el
+++ b/packages/realgud/realgud/debugger/nodejs/init.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015-2016 Free Software Foundation, Inc
+;; Copyright (C) 2015-2016, 2018 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <address@hidden>
 
@@ -14,6 +14,10 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; "node debug" debugger
+
+;;; Note: this code is obsolete. FIXME: Move into another repository
 ;;; Regular expressions for nodejs Javascript debugger.
 
 (eval-when-compile (require 'cl-lib))   ;For setf.
@@ -45,7 +49,7 @@ realgud-loc-pat struct")
        :file-group 1
        :line-group 2))
 
-;; Regular expression that describes a nodejs command prompt
+;; Regular expression that describes a node-debug command prompt
 ;; For example:
 ;;   debug>
 (setf (gethash "prompt" realgud:nodejs-pat-hash)
@@ -84,7 +88,7 @@ realgud-loc-pat struct")
 (defconst realgud:nodejs-frame-module-regexp "[^ \t\n]+")
 (defconst realgud:nodejs-frame-file-regexp   "[^ \t\n]+")
 
-;; Regular expression that describes a nodejs location generally shown
+;; Regular expression that describes a node-debug location generally shown
 ;; Regular expression that describes a debugger "backtrace" command line.
 ;; For example:
 ;; #0 module.js:380:17
@@ -142,18 +146,28 @@ realgud-loc-pat struct")
 (setf (gethash realgud:nodejs-debugger-name realgud-pat-hash)
       realgud:nodejs-pat-hash)
 
+;;  Prefix used in variable names (e.g. short-key-mode-map) for
+;; this debugger
+
+(setf (gethash "nodejs" realgud:variable-basename-hash)
+      "nodejs")
+
 (defvar realgud:nodejs-command-hash (make-hash-table :test 'equal)
   "Hash key is command name like 'finish' and the value is
   the nodejs command to use, like 'out'")
 
-(setf (gethash "backtrace"  realgud:nodejs-command-hash) "T")
+(setf (gethash realgud:nodejs-debugger-name
+              realgud-command-hash)
+      realgud:nodejs-command-hash)
+
+(setf (gethash "backtrace"  realgud:nodejs-command-hash) "backtrace")
 (setf (gethash "break"      realgud:nodejs-command-hash)
       "setBreakpoint('%X',%l)")
 (setf (gethash "continue"   realgud:nodejs-command-hash) "cont")
 (setf (gethash "quit"       realgud:nodejs-command-hash) "quit")
 (setf (gethash "finish"     realgud:nodejs-command-hash) "out")
 (setf (gethash "shell"      realgud:nodejs-command-hash) "repl")
-(setf (gethash "eval"       realgud:nodejs-command-hash) "*not-implemented*")
+(setf (gethash "eval"       realgud:nodejs-command-hash) "exec(%q)")
 
 ;; We need aliases for step and next because the default would
 ;; do step 1 and nodejs doesn't handle this. And if it did,
@@ -162,6 +176,10 @@ realgud-loc-pat struct")
 (setf (gethash "next"       realgud:nodejs-command-hash) "next")
 
 ;; Unsupported features:
-(setf (gethash "jump"  realgud:nodejs-command-hash) "*not-implemented*")
+(setf (gethash "jump"       realgud:nodejs-command-hash) "*not-implemented*")
+(setf (gethash "up"         realgud:nodejs-command-hash) "*not-implemented*")
+(setf (gethash "down"       realgud:nodejs-command-hash) "*not-implemented*")
+(setf (gethash "frame"      realgud:nodejs-command-hash) "*not-implemented*")
+
 
 (provide-me "realgud:nodejs-")
diff --git a/packages/realgud/realgud/debugger/nodejs/nodejs.el 
b/packages/realgud/realgud/debugger/nodejs/nodejs.el
index 3670820..055d004 100644
--- a/packages/realgud/realgud/debugger/nodejs/nodejs.el
+++ b/packages/realgud/realgud/debugger/nodejs/nodejs.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2014-2016 Free Software Foundation, Inc
+;; Copyright (C) 2014-2016, 2018 Free Software Foundation, Inc
 
 ;; Author: Free Software Foundation, Inc
 
@@ -76,7 +76,12 @@ fringe and marginal icons.
     ;;   )
     ))
 
-;; There is already a nodejs command in `nodejs-repl'.
-;; (defalias 'nodejs 'realgud:nodejs)
+;; Note: There is already a nodejs command in `nodejs-repl'.
+
+;;;###autoload
+(defalias 'realgud:node-debug 'realgud:nodejs)
+
+;;;###autoload
+(defalias 'node-debug 'realgud:nodejs)
 
 (provide-me "realgud-")
diff --git a/packages/realgud/realgud/debugger/trepan3k/init.el 
b/packages/realgud/realgud/debugger/trepan3k/init.el
index ed4740d..a13da4d 100644
--- a/packages/realgud/realgud/debugger/trepan3k/init.el
+++ b/packages/realgud/realgud/debugger/trepan3k/init.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2010-2017 Free Software Foundation, Inc
+;; Copyright (C) 2010-2018 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <address@hidden>
 
@@ -113,12 +113,13 @@ realgud-loc-pat struct")
   "Hash key is command name like 'shell' and the value is
   the trepan3k command to use, like 'python'")
 
-(setf (gethash "eval"  realgud:trepan3k-command-hash) "eval %s")
-(setf (gethash "shell" realgud:trepan3k-command-hash) "python")
-(setf (gethash "until" realgud-command-hash) "continue %l")
+(setf (gethash "eval"   realgud:trepan3k-command-hash) "eval %s")
+(setf (gethash "pprint" realgud:trepan3k-command-hash) "pp %s")
+(setf (gethash "shell"  realgud:trepan3k-command-hash) "python")
+(setf (gethash "until"  realgud:trepan3k-command-hash) "continue %l")
 
 ;; If your version of trepan3k doesn't support "quit!",
-;; get a more recent version of trepan2
+;; get a more recent version of trepan3k
 (setf (gethash "quit" realgud:trepan3k-command-hash) "quit!")
 
 (setf (gethash "trepan3k" realgud-command-hash) realgud:trepan3k-command-hash)
diff --git a/packages/realgud/realgud/debugger/trepanjs/init.el 
b/packages/realgud/realgud/debugger/trepanjs/init.el
index 9f37b6f..881fcff 100644
--- a/packages/realgud/realgud/debugger/trepanjs/init.el
+++ b/packages/realgud/realgud/debugger/trepanjs/init.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015-2016 Free Software Foundation, Inc
+;; Copyright (C) 2015-2016, 2018 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <address@hidden>
 
@@ -153,7 +153,7 @@ realgud-loc-pat struct")
 ;; We need aliases for step and next because the default would
 ;; do step 1 and trepanjs doesn't handle this. Or when it does,
 ;; it will probably look like step(1)
-(setf (gethash "eval"       realgud:trepanjs-command-hash) "eval('%s')")
+(setf (gethash "eval"       realgud:trepanjs-command-hash) "eval(%q)")
 (setf (gethash "quit"       realgud:trepanjs-command-hash) "quit()")
 
 ;; Unsupported features:
diff --git a/packages/realgud/test/.gitignore b/packages/realgud/test/.gitignore
index b616aaf..8903d9c 100644
--- a/packages/realgud/test/.gitignore
+++ b/packages/realgud/test/.gitignore
@@ -1,5 +1,6 @@
 /*.elc
 /*~
+/.python-version
 /HelloWorld.class
 /Makefile
 /Makefile.in
diff --git a/packages/realgud/test/gcd.js b/packages/realgud/test/gcd.js
index ee56555..901bb96 100644
--- a/packages/realgud/test/gcd.js
+++ b/packages/realgud/test/gcd.js
@@ -40,6 +40,5 @@ function gcd(a, b) {
 var a = parseInt(process.argv[0]) || 24,
     b = parseInt(process.argv[0]) || 5;
 
-console.log(util.format("The GCD of %d and %d is %d", a, b,
-                       gcd(a, b)));
+console.log(util.format("The GCD of %d and %d is %d", a, b, gcd(a, b)));
 process.exit();
diff --git a/packages/realgud/test/test-bt-trepan2.el 
b/packages/realgud/test/test-bt-trepan2.el
index d3d3d0f..e1be16e 100644
--- a/packages/realgud/test/test-bt-trepan2.el
+++ b/packages/realgud/test/test-bt-trepan2.el
@@ -4,15 +4,19 @@
 (require 'test-simple)
 (require 'load-relative)
 (load-file "./bt-helper.el")
+(load-file "./regexp-helper.el")
 (load-file "../realgud/debugger/trepan2/init.el")
 
 (declare-function setup-bt 'realgud-bt-helper)
+(declare-function setup-regexp-vars 'regexp-helper)
 (declare-function __FILE__ 'load-relative)
 
 (test-simple-start)
 
 (eval-when-compile
   (defvar temp-bt)
+  (defvar realgud-pat-bt)
+  (defvar realgud:trepan2-pat-hash)
 )
 
 (setq temp-bt
@@ -40,4 +44,34 @@
                  (get-text-property (point) 'face))
     )
   )
+
+
+(setup-regexp-vars realgud:trepan2-pat-hash)
+(setq realgud-pat-bt  (gethash "debugger-backtrace"
+                               realgud:trepan2-pat-hash))
+
+
+(let* ((triple
+        (realgud:backtrace-add-text-properties
+         realgud-pat-bt ""
+         "->0 gcd(a=3, b=5) called from file '/test/gcd.py' at line 28
+##1 <module> exec() '/test/gcd.py' at line 41"
+         "->"))
+       (string-with-props (car triple)))
+  (dolist (pair
+           '(
+             ("->0" . (0 . 28) )
+             ("##1" . (1 . 41) )
+             ))
+    (string-match (car pair) string-with-props)
+    (assert-equal (cddr pair)
+                  (realgud-loc-line-number (get-text-property
+                                            (match-beginning 0) 'loc
+                                            string-with-props)))
+
+    (assert-equal (cadr pair)
+                  (get-text-property
+                   (match-beginning 0) 'frame-num
+                   string-with-props))))
+
 (end-tests)
diff --git a/packages/realgud/test/test-pdb.el 
b/packages/realgud/test/test-pdb.el
index d58d5a0..b6694e2 100644
--- a/packages/realgud/test/test-pdb.el
+++ b/packages/realgud/test/test-pdb.el
@@ -25,12 +25,12 @@
   (assert-equal '("3" "5") (cddr cmd-args) "command args listified")
   )
 
-(note "pdb-parse-cmd-args")
-(assert-equal (list nil '("pdb") (list (expand-file-name "foo")) nil)
-             (pdb-parse-cmd-args '("pdb" "foo")))
-(assert-equal (list nil '("pdb") (list (expand-file-name "program.py") "foo") 
nil)
-             (pdb-parse-cmd-args
-              '("pdb" "program.py" "foo")))
+;; (note "pdb-parse-cmd-args")
+;; (assert-equal (list nil '("pdb") (list (expand-file-name "foo")) nil)
+;;           (pdb-parse-cmd-args '("pdb" "foo")))
+;; (assert-equal (list nil '("pdb") (list (expand-file-name "program.py") 
"foo") nil)
+;;           (pdb-parse-cmd-args
+;;            '("pdb" "program.py" "foo")))
 
 (realgud:pdb "pdb ./gcd.py 3 5")
 ;; Restore the old value of realgud:run-process
diff --git a/packages/realgud/test/test-realgud.el 
b/packages/realgud/test/test-realgud.el
index 2e7d09e..a86c354 100644
--- a/packages/realgud/test/test-realgud.el
+++ b/packages/realgud/test/test-realgud.el
@@ -1,31 +1,40 @@
-;; Press C-x C-e at the end of the next line to run this file test 
non-interactively
-;; (test-simple-run "emacs -batch -L %s -l %s" (file-name-directory 
(locate-library "test-simple.elc")) buffer-file-name)
-
-(require 'test-simple)
-(load-file "../realgud.el")
-
-(declare-function realgud:loaded-features    'realgud)
-(declare-function realgud:unload-features    'realgud-regexp)
-(declare-function __FILE__                   'load-relative)
-
-(test-simple-start)
-
-(eval-when-compile
-  (defvar test-realgud:features)
-)
-
-(note "realgud")
-
-(note "realgud:loaded-features")
-(set (make-local-variable 'test-realgud:features) (realgud:loaded-features))
-;; (dolist (feature '(realgud-trepan
-;;                            realgud-core))
-;;   (assert-t (not (not (member feature test-realgud:features)))) )
-
-(note "realgud-unload-features")
-(load-file "../realgud.el")
-(assert-nil (not (realgud:loaded-features)))
-(assert-nil (not (realgud:unload-features)))
-(realgud:loaded-features)
-
-(end-tests)
+;; Manually run these tests as follows:
+;;
+;; emacs --batch --no-site-file --no-splash \
+;;   --script setup.el --chdir PACAKGESDIR/realgud \
+;;   -l test/test-realgud.el -f ert-run-tests-batch-and-exit
+;;
+;; where setup.el looks something like:
+;; (let ((elpa-dir (expand-file-name "~/.emacs.d/elpa")))
+;;   (add-to-list 'load-path (concat elpa-dir "/test-simple-20170117.411"))
+;;   (add-to-list 'load-path (concat elpa-dir "/load-relative-20160716.438"))
+;;   (add-to-list 'load-path (concat elpa-dir "/loc-changes-20160801.1008")))
+
+(defun realgud-test-helper()
+  (delq nil
+               (mapcar (lambda (x) (and (string-match-p 
"^\\(realgud:\\|realgud-\\)" (symbol-name x)) x))
+                               features)))
+
+(ert-deftest test-feature-unload()
+
+  ;; no realgud features exist by default
+  (should (= 0 (length (realgud-test-helper))))
+  (should-not (member 'realgud-pdb features))
+
+  (load-file "realgud.el") ; manually load the first time
+
+  ;; we should now have realgud features;
+  (should-not (= 0 (length (realgud-test-helper))))
+  (should (member 'realgud-pdb features))
+  ;; test at least 1 by name
+  (should (member 'realgud-pdb features))
+
+  ;; unload all and test
+  (let ((removed (realgud:unload-features)))
+       (should-not (= 0 (length removed)))) ; check that we return removed 
values
+  (let ((removed (realgud:unload-features))) ; should not err out if called on 
empty.
+       (should (= 0 (length removed))))
+
+  (realgud:load-features) ; load and test
+  (should-not (= 0 (length (realgud-test-helper))))
+  (should (member 'realgud-pdb features)))
diff --git a/packages/realgud/test/test-regexp-remake.el 
b/packages/realgud/test/test-regexp-remake.el
index 1aa2748..e6e69b0 100644
--- a/packages/realgud/test/test-regexp-remake.el
+++ b/packages/realgud/test/test-regexp-remake.el
@@ -14,6 +14,12 @@
   (defvar num-pat)    (defvar num-group)   (defvar realgud:remake-pat-hash)
 )
 
+(declare-function prompt-match                   'regexp-helper)
+(declare-function realgud-loc-pat-num            'realgud-regexp)
+(declare-function realgud-loc-pat-regexp         'realgud-regexp)
+(declare-function realgud-loc-pat-file-group     'realgud-regexp)
+(declare-function realgud-loc-pat-line-group     'realgud-regexp)
+
 (set (make-local-variable 'prompt-pat)
      (gethash "prompt"             realgud:remake-pat-hash))
 (set (make-local-variable 'frame-pat)
diff --git a/packages/realgud/test/test-regexp-trepan.el 
b/packages/realgud/test/test-regexp-trepan.el
index 099127b..5712c61 100644
--- a/packages/realgud/test/test-regexp-trepan.el
+++ b/packages/realgud/test/test-regexp-trepan.el
@@ -23,8 +23,16 @@
   (defvar test-dbgr)
   (defvar test-s1)
   (defvar test-text)
+  (defvar realgud:trepan-pat-hash)
 )
 
+(declare-function loc-match                     'realgud-helper)
+(declare-function prompt-match                   'regexp-helper)
+(declare-function realgud-loc-pat-file-group     'realgud-regexp)
+(declare-function realgud-loc-pat-line-group     'realgud-regexp)
+(declare-function realgud-loc-pat-num            'realgud-regexp)
+(declare-function realgud-loc-pat-regexp         'realgud-regexp)
+
 (set (make-local-variable 'bps-pat)
      (gethash "brkpt-set"          realgud:trepan-pat-hash))
 (set (make-local-variable 'dbg-bt-pat)
diff --git a/packages/realgud/test/test-send.el 
b/packages/realgud/test/test-send.el
index 580cfd5..5337a41 100644
--- a/packages/realgud/test/test-send.el
+++ b/packages/realgud/test/test-send.el
@@ -7,7 +7,12 @@
 (load-file "../realgud/common/regexp.el")
 (load-file "../realgud/debugger/trepan/init.el")
 
-(declare-function realgud-srcbuf-init 'realgud-buffer-source)
+(declare-function realgud-get-srcbuf    'realgud-buffer-source)
+(declare-function realgud-srcbuf-init   'realgud-buffer-source)
+(declare-function realgud-cmdbuf-init   'realgud-buffer-command)
+(declare-function realgud-command       'realgud-buffer-cmds)
+(declare-function realgud-expand-format 'realgud-send)
+
 (test-simple-start)
 
 (eval-when-compile
@@ -39,6 +44,9 @@
              (realgud-expand-format "h%s!" "i, rocky")
              "format %s")
 
+(assert-equal "\"\\\"fake\\\" news\"!"
+             (realgud-expand-format "%q!" "\"fake\" news"))
+
 (setup)
 ;; Current buffer is now set up as a source buffer
 (setq file-name (buffer-file-name))
diff --git a/packages/realgud/test/test-track.el 
b/packages/realgud/test/test-track.el
index 5e98fec..b8882ca 100644
--- a/packages/realgud/test/test-track.el
+++ b/packages/realgud/test/test-track.el
@@ -7,26 +7,46 @@
 (load-file "../realgud/common/track.el")
 (load-file "../realgud/common/core.el")
 (load-file "../realgud/common/loc.el")
+(load-file "../realgud/common/utils.el")
 (load-file "../realgud/debugger/trepan/core.el")
 (load-file "../realgud/debugger/trepan/init.el")
+(load-file "../realgud/debugger/pdb/core.el")
+(load-file "../realgud/debugger/pdb/init.el")
+(load-file "../realgud/debugger/pdb/track-mode.el")
+
+(declare-function __FILE__                                      'load-relative)
+(declare-function realgud-cmdbuf-init                           
'realgud-buffer-command)
+(declare-function realgud-loc-filename                          'realgud-loc)
+(declare-function realgud-loc-p                                 'realgud-loc)
+(declare-function realgud-loc-line-number                       'realgud-loc)
+(declare-function realgud:track-from-region                     'realgud-track)
+(declare-function realgud-track-loc                             'realgud-track)
+(declare-function realgud-track-loc-remaining                   'realgud-track)
+(declare-function realgud-track-selected-frame                  'realgud-track)
+(declare-function realgud-track-termination?                    'realgud-track)
+(declare-function realgud:get-eval-output                       'realgud-track)
+(declare-function realgud:get-output-command                    'realgud-track)
+(declare-function realgud:eval-command-p                        'realgud-track)
+(declare-function realgud-set-command-name-hash-to-buffer-local 'realgud-track)
+(declare-function realgud:truncate-eval-message                 'realgud-track)
+(declare-function realgud:track-add-breakpoint                  'realgud-track)
+(declare-function realgud-track-bp-loc                          'realgud-track)
+(declare-function realgud:track-remove-breakpoints              'realgud-track)
 
-(declare-function __FILE__                     'load-relative)
-(declare-function realgud-cmdbuf-init          'realgud-buffer-command)
-(declare-function realgud-loc-filename         'realgud-loc)
-(declare-function realgud-loc-p                'realgud-loc)
-(declare-function realgud-loc-line-number      'realgud-loc)
-(declare-function realgud:track-from-region    'realgud-track)
-(declare-function realgud-track-loc            'realgud-track)
-(declare-function realgud-track-loc-remaining  'realgud-track)
-(declare-function realgud-track-selected-frame 'realgud-track)
-(declare-function realgud-track-termination?   'realgud-track)
 
 (test-simple-start)
 
 (eval-when-compile
+  (defvar bp-loc)
+  (defvar bp-num)
+  (defvar debugger-bp-output)
   (defvar debugger-output)
   (defvar line-number)
+  (defvar realgud-command-name-hash)
   (defvar realgud-pat-hash)
+  (defvar test-buffer)
+  (defvar test-command-hash)
+  (defvar test-command-name-hash)
   (defvar test-filename)
 )
 
@@ -88,6 +108,61 @@ trepan: That's all, folks...
 (assert-t (realgud-track-termination? debugger-output))
 
 
+(note "realgud:get-eval-output")
+(assert-equal "'cow'" (realgud:get-eval-output "eval 'cow'\n'cow'\n(pdb)"))
+(assert-equal "" (realgud:get-eval-output "weird output"))
+
+(note "realgud:get-output-command")
+(assert-equal "eval bang" (realgud:get-output-command "eval bang\noutput"))
+(assert-equal "" (realgud:get-output-command ""))
+
+(note "realgud:eval-command-p")
+(setq test-command-name-hash (make-hash-table :test 'equal))
+(set (make-local-variable 'realgud-command-name-hash) test-command-name-hash)
+
+;; We haven't set "eval" in command-name-hash so this should fail
+(assert-nil (realgud:eval-command-p "eval 'cow'\n'cow'\n(pdb)"))
+
+(puthash "eval" "eval" test-command-name-hash)
+(assert-t (realgud:eval-command-p "eval 'cow'\n'cow'\n(pdb)"))
+(assert-nil (realgud:eval-command-p "next 1"))
+
+(note "realgud-set-command-name-hash-to-buffer-local")
+(setq test-command-hash (make-hash-table :test 'equal))
+(puthash "eval" "!%s" test-command-hash)
+(realgud-set-command-name-hash-to-buffer-local test-command-hash)
+(assert-equal "!" (gethash "eval" (buffer-local-value 
'realgud-command-name-hash (current-buffer))))
+
+(note "realgud:truncate-eval-message")
+(let ((realgud-eval-message-print-length 500))
+  (assert-equal (realgud:truncate-eval-message (make-string 501 ?x)) 
(make-string 500 ?x)))
+(let ((realgud-eval-message-print-length 500))
+  (assert-equal (realgud:truncate-eval-message "cat") "cat"))
+
+
+(note "realgud:track-remove-breakpoints")
+(with-temp-file "test_file.py"
+  (insert "if 1:\n    x = x + 1\n"))
+
+(setq test-buffer (find-file "test_file.py"))
+(realgud-cmdbuf-init test-buffer "pdb"
+                 (gethash "pdb" realgud-pat-hash))
+
+(setq bp-num 1)
+(setq debugger-bp-output (format "Breakpoint %d at %s:%d\n"
+                                 bp-num buffer-file-name 1))
+
+(setq debugger-bp-delete-output (format "Deleted breakpoint %d at %s:%d\n"
+                                        bp-num buffer-file-name 1))
+(save-excursion
+  (let ((num-overlays (length (overlays-in 0 (point-max)))))
+    (realgud:track-add-breakpoint debugger-bp-output nil test-buffer)
+    (assert-equal (+ 1 num-overlays) (length (overlays-in 0 (point-max))))
+    (realgud:track-remove-breakpoints debugger-bp-delete-output nil 
test-buffer)
+    (assert-equal num-overlays (length (overlays-in 0 (point-max))))))
+(kill-buffer "test_file.py")
+(delete-file "test_file.py")
+
 ;; (setq debugger-bp-output (format "Breakpoint %d set at line %d\n\tin file 
%s.\n"
 ;;                               bp-num line-number test-filename))
 ;; (setq bp-loc (realgud-track-bp-loc debugger-bp-output nil))
diff --git a/packages/realgud/test/test-utils.el 
b/packages/realgud/test/test-utils.el
index 47d9958..3fc0f42 100644
--- a/packages/realgud/test/test-utils.el
+++ b/packages/realgud/test/test-utils.el
@@ -12,6 +12,7 @@
 (declare-function realgud:strip              'realgud-regexp)
 (declare-function __FILE__                   'load-relative)
 (declare-function realgud:canonic-major-mode 'realgud-utils)
+(declare-function realgud:join-string        'realgud-utils)
 
 (test-simple-start)
 
@@ -23,6 +24,9 @@
 (assert-equal "abc" (realgud:strip "abc"))
 (assert-equal "def" (realgud:strip "\n  def\t  "))
 
+(note "realgud:join-string")
+(assert-equal "a b c" (realgud:join-string '("a" "b" "c") " "))
+
 (note "realgud:flatten")
 (assert-equal '(abc) (realgud:flatten '(abc)))
 (assert-equal '(abc def h i j) (realgud:flatten '(abc (def (h) i) j)))



reply via email to

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