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

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

[elpa] master d6b879d 042/215: Merge branch 'trepanjs'


From: Rocky Bernstein
Subject: [elpa] master d6b879d 042/215: Merge branch 'trepanjs'
Date: Sat, 30 Jul 2016 14:48:52 +0000 (UTC)

branch: master
commit d6b879d2de5e9b0aaac214dd24a13b432ffc9ee0
Merge: 0e68d8d aa3125d
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    Merge branch 'trepanjs'
    
    Conflicts:
        realgud/lang/js.el
---
 configure.ac                                       |    1 +
 realgud.el                                         |    2 +
 realgud/debugger/Makefile.am                       |    2 +-
 realgud/debugger/bashdb/init.el                    |   23 ++-
 realgud/debugger/bashdb/track-mode.el              |   19 ++-
 realgud/debugger/nodejs/nodejs.el                  |   23 ++-
 realgud/debugger/trepan.pl/init.el                 |   34 +++-
 realgud/debugger/trepan8/core.el                   |   18 ++-
 realgud/debugger/trepan8/init.el                   |   29 +++-
 realgud/debugger/trepan8/track-mode.el             |    3 +-
 realgud/debugger/trepan8/trepan8.el                |   18 ++-
 realgud/debugger/trepanjs/Makefile.am              |    1 +
 realgud/debugger/trepanjs/backtrack-mode.el        |   81 ++++++++++
 realgud/debugger/trepanjs/core.el                  |  170 ++++++++++++++++++++
 realgud/debugger/trepanjs/init.el                  |  140 ++++++++++++++++
 .../debugger/{trepan8 => trepanjs}/track-mode.el   |   65 +++++---
 realgud/debugger/trepanjs/trepanjs.el              |   84 ++++++++++
 realgud/debugger/zshdb/init.el                     |   21 ++-
 realgud/lang/js.el                                 |   10 ++
 realgud/lang/posix-shell.el                        |   41 +++--
 20 files changed, 724 insertions(+), 61 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4e46155..0feab78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,7 @@ AC_CONFIG_FILES([Makefile \
                 realgud/debugger/trepan2/Makefile \
                 realgud/debugger/trepan3k/Makefile \
                 realgud/debugger/trepan.pl/Makefile \
+                realgud/debugger/trepanjs/Makefile \
                 realgud/debugger/trepanx/Makefile \
                 realgud/debugger/trepan8/Makefile \
                 realgud/debugger/zshdb/Makefile \
diff --git a/realgud.el b/realgud.el
index e73320c..7eb8146 100644
--- a/realgud.el
+++ b/realgud.el
@@ -65,6 +65,7 @@
 ;;   remake         remake         GNU Make
 ;;   ruby-debug     rdebug         Ruby
 ;;   trepanning     trepan         trepanning debugger for a patched Ruby 1.9
+;;   trepanjs       trepanjs       trepanning debugger for node.js and V8
 ;;   trepan2        trepan2        trepanning debugger for Python 2.x
 ;;   trepan3k       trepan3k       trepanning debugger for Python 3.x
 ;;   zshdb          zshdb          Zsh
@@ -119,6 +120,7 @@
      "./realgud/debugger/rdebug/rdebug"
      "./realgud/debugger/remake/remake"
      "./realgud/debugger/trepan/trepan"
+     "./realgud/debugger/trepanjs/trepanjs"
      "./realgud/debugger/trepan.pl/trepanpl"
      "./realgud/debugger/trepan2/trepan2"
      "./realgud/debugger/trepan3k/trepan3k"
diff --git a/realgud/debugger/Makefile.am b/realgud/debugger/Makefile.am
index 89ef7d9..69ae438 100644
--- a/realgud/debugger/Makefile.am
+++ b/realgud/debugger/Makefile.am
@@ -1,7 +1,7 @@
 SUBDIRS = \
        bashdb gdb gub jdb kshdb nodejs \
        pdb perldb pydb pydbgr rdebug remake \
-       trepan trepan2 trepan3k trepan.pl trepanx trepan8 \
+       trepan trepan2 trepan3k trepan.pl trepanjs trepanx trepan8 \
        zshdb
 EXTRA_DIST = common.mk
 
diff --git a/realgud/debugger/bashdb/init.el b/realgud/debugger/bashdb/init.el
index c8e4559..81cf9b5 100644
--- a/realgud/debugger/bashdb/init.el
+++ b/realgud/debugger/bashdb/init.el
@@ -1,5 +1,21 @@
-;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein <address@hidden>
-;;; Regular expressions for Bash shell debugger: bashdb
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;; Regular expressions for Bash shell debugger: bashdb
 
 (eval-when-compile (require 'cl))
 
@@ -31,7 +47,8 @@ realgud-loc-pat struct")
 ;;   bashdb<<1>>
 (setf (gethash "prompt" realgud:bashdb-pat-hash)
       (make-realgud-loc-pat
-       :regexp   "^bashdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ "
+       :regexp  (format  "^bashdb[<]+[(]*%s[)]*[>]+ "
+                        realgud:regexp-captured-num)
        :num 1
        ))
 
diff --git a/realgud/debugger/bashdb/track-mode.el 
b/realgud/debugger/bashdb/track-mode.el
index de4478d..7904d25 100644
--- a/realgud/debugger/bashdb/track-mode.el
+++ b/realgud/debugger/bashdb/track-mode.el
@@ -1,5 +1,22 @@
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ;;; Copyright (C) 2012-2015 Rocky Bernstein <address@hidden>
-;;; Bash Debugger tracking in a comint buffer.
+
+;; Bash Debugger tracking in a comint or eshell buffer.
 
 (eval-when-compile (require 'cl))
 (require 'load-relative)
diff --git a/realgud/debugger/nodejs/nodejs.el 
b/realgud/debugger/nodejs/nodejs.el
index 23b7a38..33cb74f 100644
--- a/realgud/debugger/nodejs/nodejs.el
+++ b/realgud/debugger/nodejs/nodejs.el
@@ -1,12 +1,31 @@
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;; Regular expressions for nodejs Javascript debugger.
 ;;; Copyright (C) 2014-2015 Rocky Bernstein <address@hidden>
+
 ;;  `nodejs' Main interface to nodejs debugger via Emacs
 (require 'list-utils)
 (require 'load-relative)
 (require-relative-list '("../../common/helper") "realgud-")
 (require-relative-list '("../../common/run")    "realgud:")
 (require-relative-list '("core" "track-mode")   "realgud:nodejs-")
+(require-relative-list '("../../lang/js") "realgud-lang-")
 
-(declare-function realgud:nodejs-remove-ansi-shmutz 'realgud-core)
+(declare-function realgud:js-remove-ansi-schmutz 'realgud-lang-js)
 (declare-function realgud:run-debugger 'realgud:run)
 
 ;; This is needed, or at least the docstring part of it is needed to
@@ -65,7 +84,7 @@ fringe and marginal icons.
        (with-current-buffer cmd-buf
          ;; FIXME should allow customization whether to do or not
          ;; and also only do if hook is not already there.
-         (realgud:nodejs-remove-ansi-shmutz)
+         (realgud:js-remove-ansi-schmutz)
          )
       )))
 
diff --git a/realgud/debugger/trepan.pl/init.el 
b/realgud/debugger/trepan.pl/init.el
index 45e9b53..ae8c4fd 100644
--- a/realgud/debugger/trepan.pl/init.el
+++ b/realgud/debugger/trepan.pl/init.el
@@ -1,5 +1,21 @@
-;;; Copyright (C) 2011-2012, 2014-2015 Rocky Bernstein <address@hidden>
-;;; Trepanning Perl debugger
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;; Trepanning Perl debugger
 (eval-when-compile (require 'cl))
 
 (require 'load-relative)
@@ -34,7 +50,8 @@ realgud-loc-pat struct")
 
 (setf (gethash "loc" realgud:trepanpl-pat-hash)
       (make-realgud-loc-pat
-       :regexp ".. \\(?:.+::\\)?(\\(?:.+ \\(?:via\\|remapped\\) 
\\)?\\(.+\\):\\([0-9]+\\)\\(?: @0x[0-9a-f]+\\)?)\\(?:\n\\(.*?\\)\n\\)?"
+       :regexp (format ".. \\(?:.+::\\)?(\\(?:.+ \\(?:via\\|remapped\\) 
\\)?\\(.+\\):%s\\(?: @0x[0-9a-f]+\\)?)\\(?:\n\\(.*?\\)\n\\)?"
+                      realgud:regexp-captured-num)
        :file-group 1
        :line-group 2
        :text-group 3
@@ -68,7 +85,7 @@ realgud-loc-pat struct")
 
 
 (defconst realgud:trepanpl-frame-num-regexp
-  "\\([0-9]+\\)")
+  realgud:regexp-captured-num)
 
 ;; Regular expression that describes a Perl backtrace line.
 ;; For example:
@@ -84,7 +101,8 @@ realgud-loc-pat struct")
            realgud:trepanpl-frame-num-regexp
            "\\(?: address@hidden = .* in\\)?"
            "[\n\t ]+?file `"
-           "\\(.*\\)' at line \\([0-9]+\\)")
+           "\\(.*\\)' at line "
+           realgud:regexp-captured-num)
    :num 2
    :file-group 3
    :line-group 4
@@ -108,7 +126,8 @@ realgud-loc-pat struct")
 ;;   Breakpoint 2 set in /tmp/File/Basename.pm at line 215
 (setf (gethash "brkpt-set" realgud:trepanpl-pat-hash)
       (make-realgud-loc-pat
-       :regexp "^Breakpoint \\([0-9]+\\) set in[\n\t ]+\\(.+\\)[ \t\n]+at line 
\\([0-9]+\\)"
+       :regexp (format "^Breakpoint %s set in[\n\t ]+\\(.+\\)[ \t\n]+at line 
\\([0-9]+\\)"
+                      realgud:regexp-captured-num)
        :num 1
        :file-group 2
        :line-group 3
@@ -120,7 +139,8 @@ realgud-loc-pat struct")
 ;;   Deleted breakpoint 1.
 (setf (gethash "brkpt-del" realgud:trepanpl-pat-hash)
       (make-realgud-loc-pat
-       :regexp "^Deleted breakpoint \\([0-9]+\\)\n"
+       :regexp (format "^Deleted breakpoint %s\n"
+                      realgud:regexp-captured-num)
        :num 1))
 
 (defconst realgud:trepanpl-selected-frame-indicator "-->"
diff --git a/realgud/debugger/trepan8/core.el b/realgud/debugger/trepan8/core.el
index 6c8e876..9939e5a 100644
--- a/realgud/debugger/trepan8/core.el
+++ b/realgud/debugger/trepan8/core.el
@@ -1,4 +1,20 @@
-;;; Copyright (C) 2010-2011, 2014 Rocky Bernstein <address@hidden>
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 (eval-when-compile (require 'cl))
 
 (require 'load-relative)
diff --git a/realgud/debugger/trepan8/init.el b/realgud/debugger/trepan8/init.el
index a6ba3d4..622a4e7 100644
--- a/realgud/debugger/trepan8/init.el
+++ b/realgud/debugger/trepan8/init.el
@@ -1,4 +1,20 @@
-;;; Copyright (C) 2010, 2011 Rocky Bernstein <address@hidden>
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 (eval-when-compile (require 'cl))
 
 (require 'load-relative)
@@ -20,7 +36,8 @@ realgud-loc-pat struct")
 ;;  -- (kernel/common/scope.rb:134 remapped /tmp/scope.rb:134)
 (setf (gethash "loc" realgud:trepan8-pat-hash)
       (make-realgud-loc-pat
-       :regexp ".. (\\(?:.+ \\(?:via\\|remapped\\) 
\\)?\\(.+\\):\\([0-9]+\\)\\(?: @[0-9]+\\)?)"
+       :regexp (format ".. (\\(?:.+ \\(?:via\\|remapped\\) 
\\)?\\(.+\\):%s\\(?: @[0-9]+\\)?)"
+                      realgud:regexp-captured-num)
        :file-group 1
        :line-group 2))
 
@@ -46,7 +63,8 @@ realgud-loc-pat struct")
 ;; Set breakpoint 1: /tmp/fact.rb:1 (@0)
 (setf (gethash "brkpt-set" realgud:trepan8-pat-hash)
       (make-realgud-loc-pat
-       :regexp "^Set breakpoint \\([0-9]+\\): .+ at \\(.+\\):\\([0-9]+\\) 
(@[0-9]+)"
+       :regexp (format "^Set breakpoint %s: .+ at \\(.+\\):\\([0-9]+\\) 
(@[0-9]+)"
+                      realgud:regexp-captured-num)
        :num 1
        :file-group 2
        :line-group 3))
@@ -56,7 +74,8 @@ realgud-loc-pat struct")
 ;;   Deleted breakpoint 1.
 (setf (gethash "brkpt-del" realgud:trepan8-pat-hash)
       (make-realgud-loc-pat
-       :regexp "^Deleted breakpoint \\([0-9]+\\).\n"
+       :regexp (format "^Deleted breakpoint %s.\n"
+                      realgud:regexp-captured-num)
        :num 1))
 
 ;;  Regular expression that describes a Ruby $! string
@@ -66,7 +85,7 @@ realgud-loc-pat struct")
 (setf (gethash "trepan8" realgud-pat-hash) realgud:trepan8-pat-hash)
 
 (defconst realgud:trepan8-frame-file-line-regexp
-  " at \\(.*\\):\\([0-9]+\\)$")
+  (format " at \\(.*\\):%s$" realgud:regexp-captured-num))
 
 (defconst realgud:trepan8-frame-start-regexp realgud:trepan-frame-start-regexp)
 (defconst realgud:trepan8-frame-num-regexp   realgud:trepan-frame-start-regexp)
diff --git a/realgud/debugger/trepan8/track-mode.el 
b/realgud/debugger/trepan8/track-mode.el
index 10a2821..2040a8b 100644
--- a/realgud/debugger/trepan8/track-mode.el
+++ b/realgud/debugger/trepan8/track-mode.el
@@ -14,7 +14,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
-;;; Ruby "trepan8" Debugger tracking a comint buffer.
+
+;; Ruby "trepan8" Debugger tracking a comint buffer.
 
 (eval-when-compile (require 'cl))
 (require 'load-relative)
diff --git a/realgud/debugger/trepan8/trepan8.el 
b/realgud/debugger/trepan8/trepan8.el
index 8f96c6e..6d80fa5 100644
--- a/realgud/debugger/trepan8/trepan8.el
+++ b/realgud/debugger/trepan8/trepan8.el
@@ -1,4 +1,20 @@
-;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein <address@hidden>
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 ;;  `trepan8' Main interface to trepan8 via Emacs
 (require 'load-relative)
 (require-relative-list '("../../common/helper") "realgud-")
diff --git a/realgud/debugger/trepanjs/Makefile.am 
b/realgud/debugger/trepanjs/Makefile.am
new file mode 100644
index 0000000..9a343a5
--- /dev/null
+++ b/realgud/debugger/trepanjs/Makefile.am
@@ -0,0 +1 @@
+include $(srcdir)/../common.mk
diff --git a/realgud/debugger/trepanjs/backtrack-mode.el 
b/realgud/debugger/trepanjs/backtrack-mode.el
new file mode 100644
index 0000000..e3b7e6c
--- /dev/null
+++ b/realgud/debugger/trepanjs/backtrack-mode.el
@@ -0,0 +1,81 @@
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Mode for parsing various kinds of backtraces found in JavaScript
+
+(eval-when-compile (require 'cl))
+(require 'load-relative)
+(require-relative-list '(
+                        "../../common/cmds"
+                        "../../common/menu"
+                        "../../common/track-mode"
+                        "../../common/backtrack-mode"
+                        )
+                      "realgud-")
+(require-relative-list '("core" "init") "realgud:trepanjs-")
+(require-relative-list '("../../lang/ruby") "realgud-lang-")
+
+(realgud-backtrack-mode-vars "trepanjs")
+(set-keymap-parent trepanjs-backtrack-mode-map realgud-backtrack-mode-map)
+
+(declare-function realgud-backtrack-mode         
'realgud-common-backtrack-mode)
+(declare-function realgud-backtrack-set-debugger 
'realgud-common-backtrack-mode)
+(declare-function realgud-goto-line-for-pt       
'realgud-common-backtrack-mode)
+(declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby)
+
+(defun realgud:trepanjs-goto-control-frame-line (pt)
+  "Display the location mentioned by a control-frame line
+described by PT."
+  (interactive "d")
+  (realgud-goto-line-for-pt pt "control-frame"))
+
+(realgud:ruby-populate-command-keys trepanjs-backtrack-mode-map)
+(define-key trepanjs-backtrack-mode-map
+  (kbd "C-c !c") 'realgud:trepanjs-goto-control-frame-line)
+
+(define-minor-mode trepanjs-backtrack-mode
+  "Minor mode for tracking ruby debugging inside a file which may not have 
process shell.
+
+\\{trepanjs-backtrack-mode-map}
+"
+  :init-value nil
+  ;; :lighter " trepanjs"   ;; mode-line indicator from realgud-track is 
sufficient.
+  ;; The minor mode bindings.
+  :global nil
+  :group 'realgud:trepanjs
+  :keymap trepanjs-backtrack-mode-map
+
+  (realgud-backtrack-set-debugger "trepanjs")
+  (if trepanjs-backtrack-mode
+      (progn
+       (realgud-backtrack-mode 't)
+       (run-mode-hooks (intern (trepanjs-backtrack-mode-hook))))
+    (progn
+      (realgud-backtrack-mode nil)
+      ))
+)
+
+(defun trepanjs-backtrack-mode-hook()
+  (if trepanjs-backtrack-mode
+      (progn
+       (use-local-map trepanjs-backtrack-mode-map)
+       (message "using trepanjs mode map")
+       )
+    (message "trepanjs backtrack-mode-hook disable called"))
+)
+
+(provide-me "realgud:trepanjs-")
diff --git a/realgud/debugger/trepanjs/core.el 
b/realgud/debugger/trepanjs/core.el
new file mode 100644
index 0000000..09482e3
--- /dev/null
+++ b/realgud/debugger/trepanjs/core.el
@@ -0,0 +1,170 @@
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+(eval-when-compile (require 'cl))
+
+(require 'load-relative)
+(require-relative-list '("../../common/track"
+                         "../../common/core"
+                         "../../common/lang")
+                       "realgud-")
+(require-relative-list '("init") "realgud:trepanjs-")
+
+(declare-function realgud:expand-file-name-if-exists 'realgud-core)
+(declare-function realgud-parse-command-arg  'realgud-core)
+(declare-function realgud-query-cmdline      'realgud-core)
+(declare-function realgud-suggest-invocation 'realgud-core)
+
+;; FIXME: I think the following could be generalized and moved to
+;; realgud-... probably via a macro.
+(defvar realgud:trepanjs-minibuffer-history nil
+  "minibuffer history list for the command `realgud:trepanjs'.")
+
+(easy-mmode-defmap realgud:trepanjs-minibuffer-local-map
+  '(("\C-i" . comint-dynamic-complete-filename))
+  "Keymap for minibuffer prompting of trepanjs startup command."
+  :inherit minibuffer-local-map)
+
+;; FIXME: I think this code and the keymaps and history
+;; variable chould be generalized, perhaps via a macro.
+(defun realgud:trepanjs-query-cmdline (&optional opt-debugger)
+  (realgud-query-cmdline
+   'realgud:trepanjs-suggest-invocation
+   realgud:trepanjs-minibuffer-local-map
+   'realgud:trepanjs-minibuffer-history
+   opt-debugger))
+
+(defun realgud:trepanjs-parse-cmd-args (orig-args)
+  "Parse command line ARGS for the annotate level and name of script to debug.
+
+ORIG-ARGS should contain a tokenized list of the command line to run.
+
+We return the a list containing
+* the name of the debugger given (e.g. trepanjs) and its arguments - a list of 
strings
+* the script name and its arguments - list of strings
+* whether the annotate or emacs option was given ('-A', '--annotate' or 
'--emacs) - a boolean
+
+For example for the following input:
+  (map 'list 'symbol-name
+   '(node --interactive --debugger-port 5858 /tmp trepanjs ./gcd.js a b))
+
+we might return:
+   ((\"node\" \"--interactive\" \"--debugger-port\" \"5858\") nil 
(\"/tmp/gcd.js\" \"a\" \"b\"))
+
+Note that path elements have been expanded via `expand-file-name'.
+"
+
+  ;; Parse the following kind of pattern:
+  ;;  node trepanjs-options script-name script-options
+  (let (
+       (args orig-args)
+       (pair)          ;; temp return from
+       (node-two-args '("-debugger_port" "C" "D" "i" "l" "m" "-module" "x"))
+       ;; node doesn't have any optional two-arg options
+       (node-opt-two-args '())
+
+       ;; One dash is added automatically to the below, so
+       ;; h is really -h and -debugger_port is really --debugger_port.
+       (trepanjs-two-args '("-debugger_port"))
+       (trepanjs-opt-two-args '())
+
+       ;; Things returned
+       (script-name nil)
+       (debugger-name nil)
+       (interpreter-args '())
+       (script-args '())
+       )
+    (if (not (and args))
+       ;; Got nothing: return '(nil, nil, nil)
+       (list interpreter-args nil script-args)
+      ;; else
+      (progn
+       ;; Remove "trepanjs" (or "nodemon" or "node") from invocation like:
+       ;; trepanjs --trepanjs-options script --script-options
+       (setq debugger-name (file-name-sans-extension
+                            (file-name-nondirectory (car args))))
+       (unless (string-match "^node\\(?:js\\|mon\\)$" debugger-name)
+         (message
+          "Expecting debugger name `%s' to be `node', `nodemon', or `trepanjs'"
+          debugger-name))
+       (setq interpreter-args (list (pop args)))
+
+       ;; Skip to the first non-option argument.
+       (while (and args (not script-name))
+         (let ((arg (car args)))
+           (cond
+            ((equal "debug" arg)
+             (nconc interpreter-args (list arg))
+             (setq args (cdr args))
+             )
+
+            ;; Options with arguments.
+            ((string-match "^-" arg)
+             (setq pair (realgud-parse-command-arg
+                         args trepanjs-two-args trepanjs-opt-two-args))
+             (nconc interpreter-args (car pair))
+             (setq args (cadr pair)))
+            ;; Anything else must be the script to debug.
+            (t (setq script-name (realgud:expand-file-name-if-exists arg))
+              (setq script-args (cons script-name (cdr args))))
+            )))
+       (list interpreter-args nil script-args)))
+    ))
+
+;; To silence Warning: reference to free variable
+(defvar realgud:trepanjs-command-name)
+
+(defun realgud:trepanjs-suggest-invocation (debugger-name)
+  "Suggest a trepanjs command invocation via `realgud-suggest-invocaton'"
+  (realgud-suggest-invocation realgud:trepanjs-command-name
+                             realgud:trepanjs-minibuffer-history
+                             "js" "\\.js$"))
+
+(defun realgud:trepanjs-remove-ansi-shmutz()
+  "Remove ASCII escape sequences that node.js 'decorates' in
+prompts and interactive output with"
+  (add-to-list
+   'comint-preoutput-filter-functions
+   (lambda (output)
+     (replace-regexp-in-string "\033\\[[0-9]+[GKJ]" "" output)))
+  )
+
+(defun realgud:trepanjs-reset ()
+  "Trepanjs cleanup - remove debugger's internal buffers (frame,
+breakpoints, etc.)."
+  (interactive)
+  ;; (trepanjs-breakpoint-remove-all-icons)
+  (dolist (buffer (buffer-list))
+    (when (string-match "\\*trepanjs-[a-z]+\\*" (buffer-name buffer))
+      (let ((w (get-buffer-window buffer)))
+        (when w
+          (delete-window w)))
+      (kill-buffer buffer))))
+
+;; (defun trepanjs-reset-keymaps()
+;;   "This unbinds the special debugger keys of the source buffers."
+;;   (interactive)
+;;   (setcdr (assq 'trepanjs-debugger-support-minor-mode minor-mode-map-alist)
+;;       trepanjs-debugger-support-minor-mode-map-when-deactive))
+
+
+(defun realgud:trepanjs-customize ()
+  "Use `customize' to edit the settings of the `trepanjs' debugger."
+  (interactive)
+  (customize-group 'realgud:trepanjs))
+
+(provide-me "realgud:trepanjs-")
diff --git a/realgud/debugger/trepanjs/init.el 
b/realgud/debugger/trepanjs/init.el
new file mode 100644
index 0000000..856c06a
--- /dev/null
+++ b/realgud/debugger/trepanjs/init.el
@@ -0,0 +1,140 @@
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;; Regular expressions for nodejs Javascript debugger.
+
+(eval-when-compile (require 'cl))
+
+(require 'load-relative)
+(require-relative-list '("../../common/regexp"
+                        "../../common/loc"
+                        "../../common/init")
+                      "realgud-")
+(require-relative-list '("../../lang/js") "realgud-lang-")
+
+(defvar realgud:trepanjs-pat-hash (make-hash-table :test 'equal)
+  "Hash key is the what kind of pattern we want to match:
+backtrace, prompt, etc.  The values of a hash entry is a
+realgud-loc-pat struct")
+
+(declare-function make-realgud-loc-pat (realgud-loc))
+
+(defconst realgud:trepanjs-file-regexp   "\\([^ \t\n]+\\)\\(?: \\[.*\\]\\)?")
+
+;; Regular expression that describes a trepanjs location generally shown
+;; before a command prompt.
+;; For example:
+;;   break in /home/indutny/Code/git/indutny/myscript.js:1
+;;   exception in /usr/lib/nodejs/module.js [module.js]:362
+(setf (gethash "loc" realgud:trepanjs-pat-hash)
+      (make-realgud-loc-pat
+       :regexp (format
+               "\\(?:%s\\)*\\(?:break\\|exception\\) in %s:%s"
+               realgud:js-term-escape realgud:trepanjs-file-regexp
+               realgud:regexp-captured-num)
+       :file-group 1
+       :line-group 2))
+
+;; Regular expression that describes a trepanjs command prompt
+;; For example:
+;;   (trepanjs):
+(setf (gethash "prompt" realgud:trepanjs-pat-hash)
+      (make-realgud-loc-pat
+       :regexp "^(+trepanjs)+ "
+       ))
+
+;;  Regular expression that describes a "breakpoint set" line
+;; * 4 var count = 0;
+(setf (gethash "brkpt-set" realgud:trepanjs-pat-hash)
+      (make-realgud-loc-pat
+       :regexp (format "^Breakpoint %s set in file \\(.+\\), line %s.\n"
+                      realgud:regexp-captured-num realgud:regexp-captured-num)
+       :num 1
+       :file-group 2
+       :line-group 3))
+
+;; Regular expression that describes a V8 backtrace line.
+;; For example:
+;;    at repl:1:7
+;;    at Interface.controlEval 
(/src/external-vcs/github/trepanjs/lib/interface.js:352:18)
+;;    at REPLServer.b [as eval] (domain.js:183:18)
+(setf (gethash "lang-backtrace" realgud:trepanjs-pat-hash)
+  realgud:js-backtrace-loc-pat)
+
+;; Regular expression that describes a debugger "delete" (breakpoint)
+;; response.
+;; For example:
+;;   Deleted breakpoint 1.
+(setf (gethash "brkpt-del" realgud:trepanjs-pat-hash)
+      (make-realgud-loc-pat
+       :regexp (format "^Deleted breakpoint %s.\n"
+                      realgud:regexp-captured-num)
+       :num 1))
+
+
+(defconst realgud:trepanjs-frame-start-regexp  "\\(?:^\\|\n\\)\\(?: #\\)")
+(defconst realgud:trepanjs-frame-num-regexp    realgud:regexp-captured-num)
+(defconst realgud:trepanjs-frame-module-regexp "[^ \t\n]+")
+
+;;  Regular expression that describes debugger "backtrace" command line.
+;;  e.g.
+;; ## require called from file /usr/lib/nodejs/module.js [module.js] at line 
380:17
+;; ## in file /src/external-vcs/github/trepanjs/example/gcd.js 
[/src/external-vcs/github/trepanjs/example/gcd.js] at line 2:12
+(setf (gethash "debugger-backtrace" realgud:trepanjs-pat-hash)
+      (make-realgud-loc-pat
+       :regexp         (concat realgud:trepanjs-frame-start-regexp " "
+                       realgud:regexp-captured-num " "
+                       "\\(?:" realgud:trepanjs-frame-module-regexp " called 
from file"
+                       realgud:trepanjs-file-regexp
+                       "\\)\\| in file "
+                       realgud:regexp-captured-num
+                       "\\)"
+                       "at line \\(" realgud:regexp-captured-num "\\):"
+                       realgud:regexp-captured-num
+                       )
+       :num 1
+       :file-group 2
+       :line-group 3
+       :char-offset-group 4
+       ))
+
+(defconst realgud:trepanjs-debugger-name "trepanjs" "Name of debugger")
+
+;; Top frame number
+(setf (gethash "top-frame-num" realgud:trepanjs-pat-hash) 0)
+
+;; Regular expression that for a termination message.
+(setf (gethash "termination" realgud:trepanjs-pat-hash)
+       "^trepanjs: That's all, folks...\n")
+
+(setf (gethash realgud:trepanjs-debugger-name realgud-pat-hash) 
realgud:trepanjs-pat-hash)
+
+(defvar realgud:trepanjs-command-hash (make-hash-table :test 'equal)
+  "Hash key is command name like 'quit' and the value is
+  the trepanjs command to use, like 'quit!'")
+
+(setf (gethash realgud:trepanjs-debugger-name
+              realgud-command-hash) realgud:trepanjs-command-hash)
+
+(setf (gethash "break"      realgud:trepanjs-command-hash)
+      "setBreakpoint(%l)")
+;; 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 "step"       realgud:trepanjs-command-hash) "step")
+(setf (gethash "next"       realgud:trepanjs-command-hash) "next")
+
+(provide-me "realgud:trepanjs-")
diff --git a/realgud/debugger/trepan8/track-mode.el 
b/realgud/debugger/trepanjs/track-mode.el
similarity index 51%
copy from realgud/debugger/trepan8/track-mode.el
copy to realgud/debugger/trepanjs/track-mode.el
index 10a2821..4c02965 100644
--- a/realgud/debugger/trepan8/track-mode.el
+++ b/realgud/debugger/trepanjs/track-mode.el
@@ -14,7 +14,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
-;;; Ruby "trepan8" Debugger tracking a comint buffer.
+
+;;; "trepanjs" Debugger tracking a comint or eshell buffer.
 
 (eval-when-compile (require 'cl))
 (require 'load-relative)
@@ -25,49 +26,63 @@
                         "../../common/track-mode"
                         )
                       "realgud-")
-(require-relative-list '("core" "init") "realgud:trepan8-")
-(require-relative-list '("../../lang/ruby") "realgud-lang-")
-
-(realgud-track-mode-vars "trepan8")
+(require-relative-list '("core" "init") "realgud:trepanjs-")
+;; (require-relative-list '("../../lang/js") "realgud-lang-")
 
 (declare-function realgud-track-mode 'realgud-track-mode)
 (declare-function realgud-track-mode-hook 'realgud-track-mode)
 (declare-function realgud-track-mode-setup 'realgud-track-mode)
 (declare-function realgud:track-set-debugger 'realgud-track-mode)
+(declare-function realgud-goto-line-for-pt 'realgud-track-mode)
+
+(realgud-track-mode-vars "trepanjs")
+
+(define-key realgud-track-mode-map
+  (kbd "C-c !!") 'realgud:goto-lang-backtrace-line)
+(define-key realgud-track-mode-map
+  (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line)
+
 (declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby)
 
-(realgud:ruby-populate-command-keys trepan8-track-mode-map)
+(defun realgud:trepanjs-goto-syntax-error-line (pt)
+  "Display the location mentioned in a Syntax error line
+described by PT."
+  (interactive "d")
+  (realgud-goto-line-for-pt pt "syntax-error"))
 
-(define-key trepan8-track-mode-map
-  (kbd "C-c !!") 'realgud:ruby-goto-dollar-bang-line)
+(define-key trepanjs-track-mode-map
+  (kbd "C-c !s") 'realgud:trepanjs-goto-syntax-error-line)
 
-(defun trepan8-track-mode-hook()
-  (use-local-map trepan8-track-mode-map)
-  (realgud-track-mode-setup 't)
-  (message "trepan8 track-mode-hook called")
+(defun trepanjs-track-mode-hook()
+  (if trepanjs-track-mode
+      (progn
+       (use-local-map trepanjs-track-mode-map)
+       (message "using trepanjs mode map")
+       )
+    (message "trepanjs track-mode-hook disable called"))
 )
-(define-minor-mode trepan8-track-mode
-  "Minor mode for tracking trepan8 source locations inside a process shell via 
realgud. trepan8 is a Ruby debugger for version 1.8.
+
+(define-minor-mode trepanjs-track-mode
+  "Minor mode for tracking trepanjs source locations inside a process shell 
via realgud. trepanjs is a Ruby debugger.
 
 If called interactively with no prefix argument, the mode is toggled. A prefix 
argument, captured as ARG, enables the mode if the argument is positive, and 
disables it otherwise.
 
-\\{trepan8-track-mode-map}
+\\{trepanjs-track-mode-map}
 "
   :init-value nil
-  ;; :lighter " trepan8"   ;; mode-line indicator from realgud-track is 
sufficient.
+  ;; :lighter " trepanjs"   ;; mode-line indicator from realgud-track is 
sufficient.
   ;; The minor mode bindings.
   :global nil
-  :group 'realgud:trepan8
-  :keymap trepan8-track-mode-map
-
-  (realgud:track-set-debugger "trepan8")
-  (if trepan8-track-mode
+  :group 'realgud:trepanjs
+  :keymap trepanjs-track-mode-map
+  (realgud:track-set-debugger "trepanjs")
+  (if trepanjs-track-mode
       (progn
-       (realgud-track-mode 't)
-       (trepan8-track-mode-hook))
+       (realgud-track-mode-setup 't)
+        (trepanjs-track-mode-hook))
     (progn
-      (realgud-track-mode nil)
+      (setq realgud-track-mode nil)
       ))
 )
 
-(provide-me "realgud:trepan8-")
+(provide-me "realgud:trepanjs-")
diff --git a/realgud/debugger/trepanjs/trepanjs.el 
b/realgud/debugger/trepanjs/trepanjs.el
new file mode 100644
index 0000000..9742d1d
--- /dev/null
+++ b/realgud/debugger/trepanjs/trepanjs.el
@@ -0,0 +1,84 @@
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;; Regular expressions for nodejs Javascript debugger.
+
+;;  `trepanjs' Main interface to trepanjs via Emacs
+(require 'load-relative)
+(require-relative-list '("../../common/helper") "realgud-")
+(require-relative-list '("../../common/run")    "realgud:")
+(require-relative-list '("core" "track-mode") "realgud:trepanjs-")
+(require-relative-list '("../../lang/js") "realgud-lang-")
+
+(declare-function realgud:trepanjs-query-cmdline  'realgud:trepanjs-core)
+(declare-function realgud:trepanjs-parse-cmd-args 'realgud:trepanjs-core)
+(declare-function realgud:js-remove-ansi-schmutz 'realgud-lang-js)
+(declare-function realgud:run-debugger 'realgud:run)
+
+;; This is needed, or at least the docstring part of it is needed to
+;; get the customization menu to work in Emacs 24.
+(defgroup realgud:trepanjs nil
+  "The realgud interface to the Ruby 1.9.2 1.9.3 \"trepanjsning\" debugger"
+  :group 'ruby
+  :group 'realgud
+  :version "24.1")
+
+;; -------------------------------------------------------------------
+;; User-definable variables
+;;
+
+(defcustom realgud:trepanjs-command-name
+  ;;"trepanjs --emacs 3"
+  "trepanjs"
+  "File name for executing the Ruby debugger and command options.
+This should be an executable on your path, or an absolute file name."
+  :type 'string
+  :group 'realgud:trepanjs)
+
+;;;###autoload
+(defun realgud:trepanjs (&optional opt-cmd-line no-reset)
+  "Invoke the trepanjs Ruby debugger and start the Emacs user interface.
+
+String OPT-CMD-LINE is treated like a shell string; arguments are
+tokenized by `split-string-and-unquote'. The tokenized string is
+parsed by `trepanjs-parse-cmd-args' and path elements found by that
+are expanded using `expand-file-name'.
+
+Normally, command buffers are reused when the same debugger is
+reinvoked inside a command buffer with a similar command. If we
+discover that the buffer has prior command-buffer information and
+NO-RESET is nil, then that information which may point into other
+buffers and source buffers which may contain marks and fringe or
+marginal icons is reset. See `loc-changes-clear-buffer' to clear
+fringe and marginal icons.
+"
+  (interactive)
+  (let ((cmd-buf
+        (realgud:run-debugger "trepanjs" 'realgud:trepanjs-query-cmdline
+                              'realgud:trepanjs-parse-cmd-args
+                              'realgud:trepanjs-minibuffer-history
+                              opt-cmd-line no-reset)))
+    (if cmd-buf
+       (with-current-buffer cmd-buf
+         ;; FIXME should allow customization whether to do or not
+         ;; and also only do if hook is not already there.
+         (realgud:js-remove-ansi-schmutz)
+         )
+      )))
+
+(defalias 'trepanjs 'realgud:trepanjs)
+(provide-me "realgud-")
+;;; trepanjs.el ends here
diff --git a/realgud/debugger/zshdb/init.el b/realgud/debugger/zshdb/init.el
index 4931105..e8bc9ff 100644
--- a/realgud/debugger/zshdb/init.el
+++ b/realgud/debugger/zshdb/init.el
@@ -1,5 +1,19 @@
-;;; Copyright (C) 2010, 2014-2015 Rocky Bernstein <address@hidden>
-;;; Regular expressions for Z shell debugger: zshdb
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 (eval-when-compile (require 'cl))
 
@@ -31,7 +45,8 @@ realgud-loc-pat struct")
 ;;   zshdb<<1>>
 (setf (gethash "prompt" realgud:zshdb-pat-hash)
       (make-realgud-loc-pat
-       :regexp   "^zshdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ "
+       :regexp   (format "^zshdb[<]+[(]*%s[)]*[>]+ "
+                        realgud:regexp-captured-num)
        :num 1
        ))
 
diff --git a/realgud/lang/js.el b/realgud/lang/js.el
index aeb84a7..7d33357 100644
--- a/realgud/lang/js.el
+++ b/realgud/lang/js.el
@@ -39,4 +39,14 @@
    :char-offset-group 4)
   "A realgud-loc-pat struct that describes a V8 backtrace location")
 
+(defun realgud:js-remove-ansi-schmutz()
+  "Remove ASCII escape sequences that node.js 'decorates' in
+prompts and interactive output with"
+  (add-to-list
+   'comint-preoutput-filter-functions
+   (lambda (output)
+     (replace-regexp-in-string "\033\\[[0-9]+[GKJ]" "" output)))
+  )
+
+
 (provide-me "realgud-lang-")
diff --git a/realgud/lang/posix-shell.el b/realgud/lang/posix-shell.el
index 3cbc51a..54216c2 100644
--- a/realgud/lang/posix-shell.el
+++ b/realgud/lang/posix-shell.el
@@ -1,10 +1,27 @@
-;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein <address@hidden>
-;;;
-;;; Common POSIX-Shell like constants and regular expressions.
-;;; Actually a lot of this is not about POSIX shell as it is about the
-;;; common-ness of bashdb, zshdb, and kshdb. But since those are the
-;;; *only* debuggers I know of for POSIX shells, it's not too much of
-;;; a stretch to think of this as for all "shell".
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;
+;; Common POSIX-Shell like constants and regular expressions.
+;; Actually a lot of this is not about POSIX shell as it is about the
+;; common-ness of bashdb, zshdb, and kshdb. But since those are the
+;; *only* debuggers I know of for POSIX shells, it's not too much of
+;; a stretch to think of this as for all "shell".
+
 (eval-when-compile (require 'cl))
 
 (require 'load-relative)
@@ -24,13 +41,13 @@ traceback) line."  )
   "\\(?:^\\|\n\\)\\(->\\|##\\)")
 
 (defconst realgud-shell-frame-num-regexp
-  "\\([0-9]+\\)")
+  realgud:regexp-captured-num)
 
 (defconst realgud-shell-frame-file-regexp
   "[ \t\n]+\\(?:in\\|from\\) file `\\(.+\\)'")
 
 (defconst realgud-shell-frame-line-regexp
-  "[ \t\n]+at line \\([0-9]+\\)\\(?:\n\\|$\\)")
+  (format "[ \t\n]+at line %s\\(?:\n\\|$\\)" realgud:regexp-captured-num))
 
 (defun realgud-posix-shell-populate-command-keys (&optional map)
   "Bind the debugger function key layout used by many debuggers.
@@ -75,7 +92,8 @@ traceback) line."  )
 ;;  Regular expression that describes a "breakpoint set" line
 (defconst realgud:POSIX-debugger-brkpt-set-pat
   (make-realgud-loc-pat
-   :regexp "^Breakpoint \\([0-9]+\\) set in file \\(.+\\), line 
\\([0-9]+\\).\n"
+   :regexp (format "^Breakpoint \\([0-9]+\\) set in file \\(.+\\), line %s.\n"
+                  realgud:regexp-captured-num)
    :num 1
    :file-group 2
    :line-group 3))
@@ -85,7 +103,8 @@ traceback) line."  )
 ;;   Removed 1 breakpoint(s).
 (defconst realgud:POSIX-debugger-brkpt-del-pat
   (make-realgud-loc-pat
-   :regexp "^Removed \\([0-9]+\\) breakpoint(s).\n"
+   :regexp (format "^Removed %s breakpoint(s).\n"
+                  realgud:regexp-captured-num)
    :num 1))
 
 (defconst realgud:POSIX-debugger-font-lock-keywords



reply via email to

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