[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 245ca79 090/215: Redo previous commit handle base-variable
From: |
Rocky Bernstein |
Subject: |
[elpa] master 245ca79 090/215: Redo previous commit handle base-variable determination from debugger name. We now do it via a hash table where entries are set in <debugger>/init.el Cleanup of old code is still needed. |
Date: |
Sat, 30 Jul 2016 14:48:56 +0000 (UTC) |
branch: master
commit 245ca7963da4b0fcf842492a468511780608d7d5
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Redo previous commit handle base-variable determination from debugger name.
We now do it via a hash table where entries are set in <debugger>/init.el
Cleanup of old code is still needed.
---
realgud/common/buffer/command.el | 6 +++++-
realgud/common/regexp.el | 7 ++++++-
realgud/common/track.el | 20 ++++++++++++--------
realgud/debugger/gdb/init.el | 7 ++++++-
realgud/debugger/jdb/init.el | 6 ++++++
5 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/realgud/common/buffer/command.el b/realgud/common/buffer/command.el
index 739f72e..913c68e 100644
--- a/realgud/common/buffer/command.el
+++ b/realgud/common/buffer/command.el
@@ -56,6 +56,9 @@
(defstruct realgud-cmdbuf-info
"The debugger object/structure specific to a process buffer."
debugger-name ;; Name of debugger
+ base-variable-name ;; prefix used in variables pertinent to this
+ ;; debugger sometimes it is the same as the debugger
+ ;; and sometimes it is different
cmd-args ;; Command-line invocation arguments
frame-switch? ;; Should the selected window be the source buffer or
;; command buffer?
@@ -283,7 +286,7 @@ Information is put in an internal buffer called *Describe*."
;; removed.
(defun realgud-cmdbuf-init
- (cmd-buf debugger-name regexp-hash &optional cmd-hash)
+ (cmd-buf debugger-name regexp-hash &optional cmd-hash base-variable-name)
"Initialize CMD-BUF for a working with a debugger.
DEBUGGER-NAME is the name of the debugger; REGEXP-HASH are debugger-specific
values set in the debugger's init.el."
@@ -295,6 +298,7 @@ values set in the debugger's init.el."
(make-realgud-cmdbuf-info
:in-srcbuf? nil
:debugger-name debugger-name
+ :base-variable-name (or base-variable-name debugger-name)
:loc-regexp (realgud-sget 'loc-pat 'regexp)
:file-group (realgud-sget 'loc-pat 'file-group)
:line-group (realgud-sget 'loc-pat 'line-group)
diff --git a/realgud/common/regexp.el b/realgud/common/regexp.el
index 8dd4fcd..5239adf 100644
--- a/realgud/common/regexp.el
+++ b/realgud/common/regexp.el
@@ -50,9 +50,14 @@ output by a debugger inside a process shell"
is a realgud-loc-pat struct")
(defvar realgud-command-hash (make-hash-table :test 'equal)
- "Hash key is the debugger name, a string. The values of a hash
+ "Hash key is the debugger name, a string. The value of a hash
entry is a hash table mapping cannonic command name
debugger-specific command name. For example, for trepanning:
'quit' -> 'quit!'")
+(defvar realgud:variable-basename-hash (make-hash-table :test 'equal)
+ "Hash key is the debugger name, a string. The value of a hash
+ entry is the base name to use that variables of that debugger use.
+ For example, for 'gdb' it is 'realgud:gdb'.")
+
(provide 'realgud-regexp)
diff --git a/realgud/common/track.el b/realgud/common/track.el
index 93b6bac..ba1dc4e 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -642,6 +642,7 @@ find a location. non-nil if we can find a location.
))
)
+;; FIXME: remove opt-base-variable-name
(defun realgud:track-set-debugger (debugger-name &optional
opt-base-variable-name)
"Set debugger name and information associated with that
debugger for the buffer process. This info is returned or nil if
@@ -657,9 +658,11 @@ debugger-name`.
;; FIXME: turn into fn which can be used by realgud-backtrack-set-debugger
(interactive
(list (completing-read "Debugger name: " realgud-pat-hash)))
- (let* ((base-variable-name (or opt-base-variable-name debugger-name))
- (regexp-hash (gethash base-variable-name realgud-pat-hash))
- (command-hash (gethash base-variable-name realgud-command-hash))
+ (let* ((base-variable-name (or opt-base-variable-name
+ (gethash debugger-name
realgud:variable-basename-hash)
+ debugger-name))
+ (regexp-hash (gethash debugger-name realgud-pat-hash))
+ (command-hash (gethash debugger-name realgud-command-hash))
)
(unless regexp-hash
;; FIXME: phase out realgud:debugger-name-transform
@@ -668,12 +671,13 @@ debugger-name`.
(setq command-hash (gethash base-variable-name realgud-command-hash))
)
(if regexp-hash
- (let* ((prefix (realgud:debugger-name-transform debugger-name))
- (mode-name (concat " " (capitalize prefix) "-Track"))
- (specific-track-mode (intern (concat prefix "-track-mode")))
+ (let* (
+ (mode-name (concat " " (capitalize base-variable-name) "-Track"))
+ (specific-track-mode (intern (concat base-variable-name
"-track-mode")))
)
- (realgud-cmdbuf-init (current-buffer) base-variable-name regexp-hash
- command-hash)
+ (realgud-cmdbuf-init (current-buffer)
+ debugger-name regexp-hash
+ command-hash base-variable-name)
(if (and (not (eval specific-track-mode))
(functionp specific-track-mode))
(funcall specific-track-mode 't))
diff --git a/realgud/debugger/gdb/init.el b/realgud/debugger/gdb/init.el
index 761cf0b..adef823 100644
--- a/realgud/debugger/gdb/init.el
+++ b/realgud/debugger/gdb/init.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015 Free Software Foundation, Inc
+;; Copyright (C) 2015-2016 Free Software Foundation, Inc
;; Author: Rocky Bernstein <address@hidden>
@@ -132,6 +132,11 @@ realgud-loc-pat struct")
(setf (gethash "gdb" realgud-pat-hash) realgud:gdb-pat-hash)
+;; Prefix used in variable names (e.g. short-key-mode-map) for
+;; this debugger
+
+(setf (gethash "gdb" realgud:variable-basename-hash) "realgud:gdb")
+
(defvar realgud:gdb-command-hash (make-hash-table :test 'equal)
"Hash key is command name like 'continue' and the value is
the gdb command to use, like 'continue'")
diff --git a/realgud/debugger/jdb/init.el b/realgud/debugger/jdb/init.el
index 0dac1dd..37ea2a8 100644
--- a/realgud/debugger/jdb/init.el
+++ b/realgud/debugger/jdb/init.el
@@ -192,6 +192,12 @@ backtrace listing.")
(setf (gethash realgud:jdb-debugger-name
realgud-command-hash) realgud:jdb-command-hash)
+;; Prefix used in variable names (e.g. short-key-mode-map) for
+;; this debugger
+
+(setf (gethash "jdb" realgud:variable-basename-hash) "realgud:jdb")
+
+
(setf (gethash "backtrace" realgud:jdb-command-hash) "where")
;; For these we need to deal with java classpaths.
- [elpa] master 5a84817 178/215: Fix invalid references to realgud:loc-follow, (continued)
- [elpa] master 5a84817 178/215: Fix invalid references to realgud:loc-follow, Rocky Bernstein, 2016/07/30
- [elpa] master 8edfb04 215/215: Not needed for elpa, Rocky Bernstein, 2016/07/30
- [elpa] master d97bf08 179/215: Update doc links, Rocky Bernstein, 2016/07/30
- [elpa] master e4c05b2 208/215: Merge pull request #137 from realgud/gdb-mi-warning, Rocky Bernstein, 2016/07/30
- [elpa] master 78d9901 122/215: Add a "safe mode" setting (on by default), Rocky Bernstein, 2016/07/30
- [elpa] master c49e2b3 204/215: Another small doc change, Rocky Bernstein, 2016/07/30
- [elpa] master 2f8efa3 130/215: Merge pull request #95 from rocky/revert-94-84-fix-autoloads, Rocky Bernstein, 2016/07/30
- [elpa] master 9023ed4 188/215: Confirm on debugger quit., Rocky Bernstein, 2016/07/30
- [elpa] master 703e69c 127/215: Manually generate "recursive" autoloads for subdirectories, Rocky Bernstein, 2016/07/30
- [elpa] master fb3f38b 182/215: A few more link updates (+ small edits in Commentary), Rocky Bernstein, 2016/07/30
- [elpa] master 245ca79 090/215: Redo previous commit handle base-variable determination from debugger name. We now do it via a hash table where entries are set in <debugger>/init.el Cleanup of old code is still needed.,
Rocky Bernstein <=
- [elpa] master 055dfa0 102/215: Move older, lesser-used debuggers to another repo, Rocky Bernstein, 2016/07/30
- [elpa] master 434e18c 183/215: Update Travis links, Rocky Bernstein, 2016/07/30
- [elpa] master 06ecc45 086/215: Add C-c ! d in a command buffer to get from a debugger location line in, Rocky Bernstein, 2016/07/30
- [elpa] master f8d36ba 198/215: Don't bind standard keys when disabled by config (#131), Rocky Bernstein, 2016/07/30
- [elpa] master 4cdbc0e 169/215: Further refactor cmds.el, Rocky Bernstein, 2016/07/30
- [elpa] master 26e67d6 211/215: Finish FSF Copyright assignments, Rocky Bernstein, 2016/07/30
- [elpa] master 99a825e 180/215: Revert "Revert "Manually generate "recursive" autoloads for subdirectories"", Rocky Bernstein, 2016/07/30
- [elpa] master ef21fa2 181/215: Merge pull request #121 from realgud/revert-95-revert-94-84-fix-autoloads, Rocky Bernstein, 2016/07/30
- [elpa] master 806f217 186/215: Merge branch 'master' into 103-jump, Rocky Bernstein, 2016/07/30
- [elpa] master 2068170 195/215: Merge branch 'master' into enable-disable, Rocky Bernstein, 2016/07/30