emacs-devel
[Top][All Lists]
Advanced

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

Re: Toggle view in gdba


From: Masatake YAMATO
Subject: Re: Toggle view in gdba
Date: Wed, 20 Oct 2004 01:21:58 +0900 (JST)

Hi,

> Actually I think it would be better not to use any of these keybindings.
> Gud-watch doesn't have a keybindings and I've just remembered why: these
> commands are really GDB specific and don't work for "gdb -fullname", perldb,
> pdb etc. Once GDB-UI has been invoked these keybindings are set for all the
> other debugger modes. As recent discussion has shown, there are still problems
> with GDB-UI so I don't want to interfere with these other modes, particularly
> the original gdb mode.

Is it ok if the key bindings are not propagated to the other modes (and 
global-map)?

Experimentally, I added new a argument LOCAL to gud-def and added line

        (use-local-map (copy-keymap (current-local-map)))

to `gdb-ann3'.

Index: lisp/progmodes/gud.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/gud.el,v
retrieving revision 1.26
diff -u -r1.26 gud.el
--- lisp/progmodes/gud.el       13 Oct 2004 16:32:41 -0000      1.26
+++ lisp/progmodes/gud.el       19 Oct 2004 16:18:02 -0000
@@ -220,7 +220,7 @@
 ;; major mode.  The function is also bound in the global keymap with the
 ;; GUD prefix.
 
-(defmacro gud-def (func cmd key &optional doc)
+(defmacro gud-def (func cmd key &optional doc local)
   "Define FUNC to be a command sending STR and bound to KEY, with
 optional doc string DOC.  Certain %-escapes in the string arguments
 are interpreted specially if present.  These are:
@@ -247,7 +247,7 @@
            `(gud-call ,cmd arg)
          cmd))
      ,(if key `(local-set-key ,(concat "\C-c" key) ',func))
-     ,(if key `(global-set-key (vconcat gud-key-prefix ,key) ',func))))
+     ,(if (and key (not local)) `(global-set-key (vconcat gud-key-prefix ,key) 
',func))))
 
 ;; Where gud-display-frame should put the debugging arrow; a cons of
 ;; (filename . line-number).  This is set by the marker-filter, which scans
Index: lisp/progmodes/gdb-ui.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/gdb-ui.el,v
retrieving revision 1.24
diff -u -r1.24 gdb-ui.el
--- lisp/progmodes/gdb-ui.el    6 Oct 2004 07:20:53 -0000       1.24
+++ lisp/progmodes/gdb-ui.el    19 Oct 2004 16:18:02 -0000
@@ -169,15 +169,46 @@
                          (forward-char 2)
                          (gud-call "until *%a" arg)))
           "\C-u" "Continue to current line or address.")
-
+  ;;
   (define-key gud-minor-mode-map [left-margin mouse-1]
     'gdb-mouse-toggle-breakpoint)
   (define-key gud-minor-mode-map [left-fringe mouse-1]
     'gdb-mouse-toggle-breakpoint)
 
+  ;; Don't propagate key defs to other than gdba mode.
+    (use-local-map (copy-keymap (current-local-map)))
+  (gud-def gud-toggle-view (cond
+                           ((eq gdb-selected-view 'assembler)
+                            (gdb-view-source-function))
+                           ((eq gdb-selected-view 'source)
+                            (gdb-view-assembler)))
+          "\C-v\C-v" "Toggle source and assembler view."
+          'local)
+  (gud-def gud-display-gdb-buffer (gdb-display-gdb-buffer)
+          "\C-vg" "Display GUD buffer." 
+          'local)    
+  (gud-def gud-display-assembler-buffer (gdb-display-assembler-buffer)
+          "\C-va" "Display disassembly view." 
+          'local)
+  (gud-def gud-display-threads-buffer (gdb-display-threads-buffer)
+          "\C-vt" "Display IDs of currently known threads." 
+          'local)
+  (gud-def gud-display-registers-buffer (gdb-display-registers-buffer)
+          "\C-vr" "Display integer register contents." 
+          'local)
+  (gud-def gud-display-locals-buffer (gdb-display-locals-buffer)
+          "\C-vl" "Display local variables of current stack and their values."
+          'local)
+  (gud-def gud-display-stack-buffer (gdb-display-stack-buffer)
+          "\C-vs" "Display backtrace of current stack."
+          'local)
+  (gud-def gud-display-breakpoints-buffer (gdb-display-breakpoints-buffer)
+          "\C-vb" "Display status of user-settable breakpoints."
+          'local)
+
   (setq comint-input-sender 'gdb-send)
   ;;
-  ;; (re-)initialise
+  ;; (re-)initialize
   (setq gdb-current-address "main")
   (setq gdb-previous-address nil)
   (setq gdb-previous-frame nil)




reply via email to

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