summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Dzhus <dima@sphinx.net.ru>2009-08-08 22:30:26 +0000
committerDmitry Dzhus <dima@sphinx.net.ru>2009-08-08 22:30:26 +0000
commitfe4740a674c79c679006c90fe53abce2250fedcf (patch)
tree238786e4bb674f63e8c8f5f38df3f1625047a111 /lisp
parente9b23a040feb02e98d6c877ae1cdca33d46028d2 (diff)
downloademacs-fe4740a674c79c679006c90fe53abce2250fedcf.tar.gz
emacs-fe4740a674c79c679006c90fe53abce2250fedcf.tar.bz2
emacs-fe4740a674c79c679006c90fe53abce2250fedcf.zip
(gdb-control-all-threads)
(gdb-control-current-thread): Interactive setters for `gdb-gud-control-all-threads' to use in menu. (gdb-show-run-p): Show «Go» when process is not active. (gud-tool-bar-map): Add non-stop/A,T indicator. Uses gud/thread.xpm and gud/all.xpm.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/progmodes/gdb-mi.el37
2 files changed, 45 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b732cbdeb7c..b6213ebcab2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
+2009-08-08 Dmitry Dzhus <dima@sphinx.net.ru>
+
+ * progmodes/gdb-mi.el (gdb-control-all-threads)
+ (gdb-control-current-thread): Interactive setters for
+ `gdb-gud-control-all-threads' to use in menu.
+ (gdb-show-run-p): Show «Go» when process is not active.
+ (gud-tool-bar-map): Add non-stop/A,T indicator. Uses
+ gud/thread.xpm and gud/all.xpm.
+
2009-08-08 Yoni Rabkin <yoni@rabkins.net>
* net/net-utils.el (net-utils-font-lock-keywords): New var.
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index b769792f788..5a8fde8203e 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -519,6 +519,19 @@ the list) is deleted every time a new one is added (at the front)."
(message (format "Logging of transaction %sabled"
(if gdb-enable-debug "en" "dis"))))
+;; These two are used for menu and toolbar
+(defun gdb-control-all-threads ()
+ "Switch to non-stop/A mode."
+ (interactive)
+ (setq gdb-gud-control-all-threads t)
+ (message "Now in non-stop/A mode."))
+
+(defun gdb-control-current-thread ()
+ "Switch to non-stop/T mode."
+ (interactive)
+ (setq gdb-gud-control-all-threads nil)
+ (message "Now in non-stop/T mode."))
+
(defun gdb-find-watch-expression ()
(let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))
(varnum (car var)) expr array)
@@ -1669,7 +1682,8 @@ is running."
(defun gdb-show-run-p ()
"Return t if \"Run/continue\" should be shown on the toolbar."
- (or (and (or
+ (or (not gdb-active-process)
+ (and (or
(not gdb-gud-control-all-threads)
(not gdb-non-stop))
(not gud-running))
@@ -3824,6 +3838,27 @@ SPLIT-HORIZONTAL and show BUF in the new window."
(define-key gud-menu-map [mi]
`(menu-item "GDB-MI" ,menu :visible (eq gud-minor-mode 'gdbmi))))
+;; TODO Fit these into tool-bar-local-item-from-menu call in gud.el.
+;; GDB-MI menu will need to be moved to gud.el. We can't use
+;; tool-bar-local-item-from-menu here because it appends new buttons
+;; to toolbar from right to left while we want our A/T throttle to
+;; show up right before Run button.
+(define-key-after gud-tool-bar-map [all-threads]
+ '(menu-item "Switch to non-stop/A mode" gdb-control-all-threads
+ :image (find-image '((:type xpm :file "gud/thread.xpm")))
+ :visible (and (eq gud-minor-mode 'gdbmi)
+ gdb-non-stop
+ (not gdb-gud-control-all-threads)))
+ 'run)
+
+(define-key-after gud-tool-bar-map [current-thread]
+ '(menu-item "Switch to non-stop/T mode" gdb-control-current-thread
+ :image (find-image '((:type xpm :file "gud/all.xpm")))
+ :visible (and (eq gud-minor-mode 'gdbmi)
+ gdb-non-stop
+ gdb-gud-control-all-threads))
+ 'all-threads)
+
(defun gdb-frame-gdb-buffer ()
"Display GUD buffer in a new frame."
(interactive)