Function: gud-watch
gud-watch is an interactive and byte-compiled function defined in
gdb-mi.el.gz.
Signature
(gud-watch &optional ARG EVENT)
Documentation
Watch expression at point.
With arg, enter name of variable to be watched in the minibuffer.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/gdb-mi.el.gz
(defun gud-watch (&optional arg event)
"Watch expression at point.
With arg, enter name of variable to be watched in the minibuffer."
(interactive (list current-prefix-arg last-input-event))
(let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer)))
(if (eq minor-mode 'gdbmi)
(progn
(if event (posn-set-point (event-end event)))
(require 'tooltip)
(save-selected-window
(let ((expr
(if arg
(completing-read "Name of variable: "
'gud-gdb-complete-command)
(if (and transient-mark-mode mark-active)
(buffer-substring (region-beginning) (region-end))
(concat (if (derived-mode-p 'gdb-registers-mode) "$")
(tooltip-identifier-from-point (point)))))))
(set-text-properties 0 (length expr) nil expr)
(gdb-input (concat "-var-create - * " expr "")
(lambda () (gdb-var-create-handler expr))))))
(message "gud-watch is a no-op in this mode."))))