[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ba7a8b1 045/215: bang on trepanjs and nodejs.
From: |
Rocky Bernstein |
Subject: |
[elpa] master ba7a8b1 045/215: bang on trepanjs and nodejs. |
Date: |
Sat, 30 Jul 2016 14:48:52 +0000 (UTC) |
branch: master
commit ba7a8b1a501bf5b2be9f4cbbf3ac6e00a44d89c0
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
bang on trepanjs and nodejs.
cmds.el: Allow for debug commands not to be implemented
---
realgud/common/cmds.el | 58 +++++++++++++++++++++++++------------
realgud/debugger/nodejs/core.el | 5 ++--
realgud/debugger/nodejs/init.el | 8 +++--
realgud/debugger/trepanjs/core.el | 11 ++++---
4 files changed, 51 insertions(+), 31 deletions(-)
diff --git a/realgud/common/cmds.el b/realgud/common/cmds.el
index 9ecc759..1745302 100644
--- a/realgud/common/cmds.el
+++ b/realgud/common/cmds.el
@@ -1,4 +1,20 @@
-;;; Copyright (C) 2010-2011, 2013-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/>.
+
(require 'load-relative)
(require-relative-list '("send" "core") "realgud-")
(require-relative-list '("buffer/command") "realgud-buffer-")
@@ -32,24 +48,28 @@ a shortcut for that key."
(unless (and cmd-hash (setq cmd (gethash cmd-name cmd-hash)))
(setq cmd default-cmd-template))
)
- (realgud-command cmd arg no-record? frame-switch? realgud-prompts?)
- ;; FIXME: Figure out how to update the position if the source
- ;; buffer is displayed.
- ;; (if frame-switch?
- ;; (let* ((src-buffer (realgud-get-srcbuf-from-cmdbuf cmdbuf))
- ;; (src-window (get-buffer-window src-buffer))
- ;; ))
- ;; (with-selected-window src-window
- ;; (message "recentering...")
- ;; (realgud-recenter-arrow)
- ;; ))
- )
- ;; FIXME: this is a one-time thing. Put in caller.
- (if key
- (local-set-key (format "\C-c%s" key)
- (intern (format "realgud:cmd-%s" cmd-name)))
- )
- )
+ (if (equal cmd "*not-implemented*")
+ (message "Command %s is not implemented for this debugger")
+ ;; else
+ (progn
+ (realgud-command cmd arg no-record? frame-switch? realgud-prompts?)
+ ;; FIXME: Figure out how to update the position if the source
+ ;; buffer is displayed.
+ ;; (if frame-switch?
+ ;; (let* ((src-buffer (realgud-get-srcbuf-from-cmdbuf cmdbuf))
+ ;; (src-window (get-buffer-window src-buffer))
+ ;; ))
+ ;; (with-selected-window src-window
+ ;; (message "recentering...")
+ ;; (realgud-recenter-arrow)
+ ;; ))
+ )
+ ;; FIXME: this is a one-time thing. Put in caller.
+ (if key
+ (local-set-key (format "\C-c%s" key)
+ (intern (format "realgud:cmd-%s" cmd-name))))
+ )
+ ))
(defun realgud:cmd-backtrace(arg)
"Show the current call stack"
diff --git a/realgud/debugger/nodejs/core.el b/realgud/debugger/nodejs/core.el
index cc09972..1ff8b71 100644
--- a/realgud/debugger/nodejs/core.el
+++ b/realgud/debugger/nodejs/core.el
@@ -48,14 +48,13 @@
;;; FIXME: DRY this with other *-parse-cmd-args routines
(defun nodejs-parse-cmd-args (orig-args)
- "Parse command line ORIG-ARGS for the annotate level and name of script to
debug.
+ "Parse command line ORIG-ARGS for the 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. nodejs) 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
@@ -96,7 +95,7 @@ Note that path elements have been expanded via
`expand-file-name'.
;; nodejs --nodejs-options script --script-options
(setq debugger-name (file-name-sans-extension
(file-name-nondirectory (car args))))
- (unless (string-match "^node\\(?:js\\|mon\\)$" debugger-name)
+ (unless (string-match "^node\\(?:js\\|mon\\)?$" debugger-name)
(message
"Expecting debugger name `%s' to be `node', `nodemon', or `nodejs'"
debugger-name))
diff --git a/realgud/debugger/nodejs/init.el b/realgud/debugger/nodejs/init.el
index 204444f..9712b75 100644
--- a/realgud/debugger/nodejs/init.el
+++ b/realgud/debugger/nodejs/init.el
@@ -111,6 +111,8 @@ realgud-loc-pat struct")
:line-group 3
:char-offset-group 4))
+(defconst realgud:nodejs-debugger-name "nodejs" "Name of debugger")
+
;; ;; Regular expression that for a termination message.
;; (setf (gethash "termination" realgud:nodejs-pat-hash)
;; "^nodejs: That's all, folks...\n")
@@ -137,14 +139,13 @@ realgud-loc-pat struct")
(1 realgud-line-number-face))
))
-(setf (gethash "nodejs" realgud-pat-hash) realgud:nodejs-pat-hash)
+(setf (gethash realgud:nodejs-debugger-name realgud-pat-hash)
+ realgud:nodejs-pat-hash)
(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 "nodejs" realgud-command-hash realgud:nodejs-command-hash))
-
(setf (gethash "backtrace" realgud:nodejs-command-hash) "T")
(setf (gethash "break" realgud:nodejs-command-hash)
"setBreakpoint(%l)")
@@ -152,6 +153,7 @@ realgud-loc-pat struct")
(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*")
;; We need aliases for step and next because the default would
;; do step 1 and nodejs doesn't handle this. And if it did,
diff --git a/realgud/debugger/trepanjs/core.el
b/realgud/debugger/trepanjs/core.el
index 09482e3..3a4bfed 100644
--- a/realgud/debugger/trepanjs/core.el
+++ b/realgud/debugger/trepanjs/core.el
@@ -49,21 +49,20 @@
opt-debugger))
(defun realgud:trepanjs-parse-cmd-args (orig-args)
- "Parse command line ARGS for the annotate level and name of script to debug.
+ "Parse command line ARGS for the 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))
+ '(trepanjs --no-highlight --port 5858 /tmp trepanjs ./gcd.js a b))
we might return:
- ((\"node\" \"--interactive\" \"--debugger-port\" \"5858\") nil
(\"/tmp/gcd.js\" \"a\" \"b\"))
+ ((\"trepanjs\" \"--no-highlight\" \"--port\" \"5858\") nil (\"/tmp/gcd.js\"
\"a\" \"b\"))
Note that path elements have been expanded via `expand-file-name'.
"
@@ -73,7 +72,7 @@ Note that path elements have been expanded via
`expand-file-name'.
(let (
(args orig-args)
(pair) ;; temp return from
- (node-two-args '("-debugger_port" "C" "D" "i" "l" "m" "-module" "x"))
+ (node-two-args '("-port" "C" "D" "i" "l" "m" "-module" "x"))
;; node doesn't have any optional two-arg options
(node-opt-two-args '())
@@ -97,7 +96,7 @@ Note that path elements have been expanded via
`expand-file-name'.
;; 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)
+ (unless (string-match "^node\\(?:js\\|mon\\)?$" debugger-name)
(message
"Expecting debugger name `%s' to be `node', `nodemon', or `trepanjs'"
debugger-name))
- [elpa] master 5078d4e 056/215: Doc gdb regexp more., (continued)
- [elpa] master 5078d4e 056/215: Doc gdb regexp more., Rocky Bernstein, 2016/07/30
- [elpa] master 0664fb9 037/215: trepanjs/init.el: handle newly added fully-qualified paths, Rocky Bernstein, 2016/07/30
- [elpa] master e5d0f95 057/215: Fix typo poined out by dfelch., Rocky Bernstein, 2016/07/30
- [elpa] master 071b66c 052/215: DRY gub init captured numbered re's., Rocky Bernstein, 2016/07/30
- [elpa] master bd45ec9 023/215: backtrace.el: fix some bugs and remove some warnings, Rocky Bernstein, 2016/07/30
- [elpa] master 8e1ef01 047/215: core.el: correct trepanjs options, Rocky Bernstein, 2016/07/30
- [elpa] master 3a84860 040/215: DRY realgud:regexp-capture-num and add more FSF copyrights, Rocky Bernstein, 2016/07/30
- [elpa] master aa3125d 041/215: posix-shell.el: sometimes I can't use (format), Rocky Bernstein, 2016/07/30
- [elpa] master 2598619 039/215: init.el: bracketed short name is optional, Rocky Bernstein, 2016/07/30
- [elpa] master e554cad 027/215: Add trepanjs, Rocky Bernstein, 2016/07/30
- [elpa] master ba7a8b1 045/215: bang on trepanjs and nodejs.,
Rocky Bernstein <=
- [elpa] master 5f664e2 055/215: Python trepan debuggers include instruction offset in location, Rocky Bernstein, 2016/07/30
- [elpa] master a4f3509 058/215: Add realgud:pdb-remote for remote kinds of pdb execution, e.g. telnet, Rocky Bernstein, 2016/07/30
- [elpa] master 1790056 059/215: Typo: Issue #45, Rocky Bernstein, 2016/07/30
- [elpa] master a016c6f 050/215: Administrivia, Rocky Bernstein, 2016/07/30
- [elpa] master 0dd37e2 053/215: Revise trepanjs regexps and add regexp test., Rocky Bernstein, 2016/07/30
- [elpa] master dd0c60a 066/215: I said remove perl5db as an alias, Rocky Bernstein, 2016/07/30
- [elpa] master 0514c68 069/215: Add melpa (nonstable) tag, Rocky Bernstein, 2016/07/30
- [elpa] master bdf317e 060/215: Try flycheck on this file., Rocky Bernstein, 2016/07/30
- [elpa] master 26fd0de 062/215: Show failure in message and in cmdbuf when we fail to invoke a debugger, Rocky Bernstein, 2016/07/30
- [elpa] master 3071b70 065/215: Try cask, Rocky Bernstein, 2016/07/30