]> code.delx.au - gnu-emacs/commitdiff
(gud-menu-map): Ensure tool-bar is constant when using the speedbar.
authorNick Roberts <nickrob@snap.net.nz>
Wed, 9 Nov 2005 10:45:07 +0000 (10:45 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Wed, 9 Nov 2005 10:45:07 +0000 (10:45 +0000)
(gdb): New command gud-pp.
(gud-menu-map, gud-tool-bar-map): Put it on the tool bar.

lisp/progmodes/gud.el

index c61f3cf96d225914745d93e60978113a080247e4..d6333e7d13234a220456030fa84c011a414e2c5e 100644 (file)
@@ -125,9 +125,9 @@ Used to grey out relevant togolbar icons.")
 (easy-mmode-defmap gud-menu-map
   '(([help]     "Info" . gud-goto-info)
     ([tooltips] menu-item "Toggle GUD tooltips" gud-tooltip-mode
-                  :enable  (and (not emacs-basic-display)
-                               (display-graphic-p)
-                               (fboundp 'x-show-tip))
+                  :enable (and (not emacs-basic-display)
+                              (display-graphic-p)
+                              (fboundp 'x-show-tip))
                  :button (:toggle . gud-tooltip-mode))
     ([refresh] "Refresh" . gud-refresh)
     ([run]     menu-item "Run" gud-run
@@ -137,18 +137,21 @@ Used to grey out relevant togolbar icons.")
                   :enable (and (not gud-running)
                               (memq gud-minor-mode '(gdbmi gdba gdb perldb)))
                  :visible (not (and (memq gud-minor-mode '(gdbmi gdba))
-                                    (> (car (window-fringes)) 0))))
+                     (> (car (window-fringes
+                             (get-buffer-window (current-buffer))) 0)))))
     ([remove]  menu-item "Remove Breakpoint" gud-remove
                   :enable (not gud-running)
                  :visible (not (and (memq gud-minor-mode '(gdbmi gdba))
-                                    (> (car (window-fringes)) 0))))
+                     (> (car (window-fringes
+                             (get-buffer-window (current-buffer))) 0)))))
     ([tbreak]  menu-item "Temporary Breakpoint" gud-tbreak
                  :enable (memq gud-minor-mode
                                '(gdbmi gdba gdb sdb xdb bashdb)))
     ([break]   menu-item "Set Breakpoint" gud-break
                   :enable (not gud-running)
                  :visible (not (and (memq gud-minor-mode '(gdbmi gdba))
-                                    (> (car (window-fringes)) 0))))
+                     (> (car (window-fringes
+                             (get-buffer-window (current-buffer))) 0)))))
     ([up]      menu-item "Up Stack" gud-up
                  :enable (and (not gud-running)
                               (memq gud-minor-mode
@@ -157,6 +160,13 @@ Used to grey out relevant togolbar icons.")
                  :enable (and (not gud-running)
                               (memq gud-minor-mode
                                     '(gdbmi gdba gdb dbx xdb jdb pdb bashdb))))
+    ([pp]      menu-item "Print the emacs s-expression" gud-pp
+                     :enable (and (not gud-running)
+                                 gdb-active-process)
+                    :visible (and (string-equal
+                                 (buffer-local-value
+                                  'gud-target-name gud-comint-buffer) "emacs")
+                                  (memq gud-minor-mode '(gdbmi gdba))))
     ([print*]  menu-item "Print Dereference" gud-pstar
                      :enable (and (not gud-running)
                                  (memq gud-minor-mode '(gdbmi gdba gdb))))
@@ -204,6 +214,7 @@ Used to grey out relevant togolbar icons.")
                     (gud-remove . "gud/remove")
                     (gud-print . "gud/print")
                     (gud-pstar . "gud/pstar")
+                    (gud-pp . "gud/pp")
                     (gud-watch . "gud/watch")
                     (gud-cont . "gud/cont")
                     (gud-until . "gud/until")
@@ -613,6 +624,8 @@ and source-file directory for your debugger."
   (gud-def gud-print  "print %e"     "\C-p" "Evaluate C expression at point.")
   (gud-def gud-pstar  "print* %e"    nil
           "Evaluate C dereferenced pointer expression at point.")
+  ;; For debugging Emacs only.
+  (gud-def gud-pp  "pp %e"           nil "Print the emacs s-expression.")
   (gud-def gud-until  "until %l"     "\C-u" "Continue to current line.")
   (gud-def gud-run    "run"         nil    "Run the program.")