branch: master
commit 2acb30c6394d403e16017c49fcdb39b7c016a163
Author: rocky <[email protected]>
Commit: rocky <[email protected]>
Start js lang. add js backtrace regexp
---
realgud/debugger/nodejs/init.el | 13 +++++++++--
realgud/debugger/nodejs/track-mode.el | 1 +
realgud/lang/js.el | 38 +++++++++++++++++++++++++++++++++
3 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/realgud/debugger/nodejs/init.el b/realgud/debugger/nodejs/init.el
index a988c36..979dfc1 100644
--- a/realgud/debugger/nodejs/init.el
+++ b/realgud/debugger/nodejs/init.el
@@ -23,7 +23,7 @@
"../../common/loc"
"../../common/init")
"realgud-")
-(require-relative-list '("../../lang/posix-shell") "realgud-lang-")
+(require-relative-list '("../../lang/js") "realgud-lang-")
(defvar realgud:nodejs-pat-hash)
(declare-function make-realgud-loc-pat (realgud-loc))
@@ -70,7 +70,16 @@ realgud-loc-pat struct")
;; :regexp "^[*] \\([0-9]+\\) "
;; :line-group 1))
-;; Regular expression that describes a debugger "delete" (breakpoint) response.
+;; 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:nodejs-pat-hash)
+ realgud:js-backtrace-loc-pat)
+
+;; Regular expression that describes a debugger "delete" (breakpoint)
+;; response.
;; For example:
;; Removed 1 breakpoint(s).
(setf (gethash "brkpt-del" realgud:nodejs-pat-hash)
diff --git a/realgud/debugger/nodejs/track-mode.el
b/realgud/debugger/nodejs/track-mode.el
index 1ea7795..ff7465c 100644
--- a/realgud/debugger/nodejs/track-mode.el
+++ b/realgud/debugger/nodejs/track-mode.el
@@ -26,6 +26,7 @@
)
"realgud-")
(require-relative-list '("core" "init") "realgud:nodejs-")
+;; (require-relative-list '("../../lang/js") "realgud-lang-")
(declare-function realgud:cmd-remap 'realgud-cmds)
(declare-function realgud:track-set-debugger 'realgud-track-mode)
diff --git a/realgud/lang/js.el b/realgud/lang/js.el
new file mode 100644
index 0000000..bb5ab38
--- /dev/null
+++ b/realgud/lang/js.el
@@ -0,0 +1,38 @@
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <[email protected]>
+
+;; 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/regexp" "../common/loc" "../common/track")
+ "realgud-")
+
+(declare-function realgud-goto-line-for-pt 'realgud-track)
+
+;; Regular expression that describes a Perl Carp backtrace line.
+;; at /tmp/foo.pl line 7
+;; main::__ANON__('Illegal division by zero at /tmp/foo.pl line 4.\x{a}')
called at /tmp/foo.pl line 4
+;; main::foo(3) called at /tmp/foo.pl line 8
+(defconst realgud:js-backtrace-loc-pat
+ (make-realgud-loc-pat
+ :regexp "^\\(?:[\t ]+at \\)?\\([^:]+\\)
(\\(.*\\):\\([0-9]+\\):\\([0-9]+\\))"
+ :file-group 2
+ :line-group 3
+ :char-offset-group 4)
+ "A realgud-loc-pat struct that describes a V8 backtrace location")
+
+(provide-me "realgud-lang-")