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

[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.



reply via email to

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