Commit 64f3c670 authored by Nick Roberts's avatar Nick Roberts
Browse files

(tooltip-gud-tips): Use gdb-define-alist.

parent 004e695a
...@@ -119,8 +119,10 @@ position to pop up the tooltip." ...@@ -119,8 +119,10 @@ position to pop up the tooltip."
(defcustom tooltip-gud-tips-p nil (defcustom tooltip-gud-tips-p nil
"*Non-nil means show tooltips in GUD sessions. "*Non-nil means show tooltips in GUD sessions.
This allows you to display a variable's value in a tooltip simply by This allows you to display a variable's value in a tooltip simply
pointing at it with the mouse." by pointing at it with the mouse. In the case of a C program
controlled by GDB, it shows the associated #define directives
when program is not executing."
:type 'boolean :type 'boolean
:tag "GUD" :tag "GUD"
:group 'tooltip) :group 'tooltip)
...@@ -478,11 +480,10 @@ This function must return nil if it doesn't handle EVENT." ...@@ -478,11 +480,10 @@ This function must return nil if it doesn't handle EVENT."
(window-buffer (let ((mouse (mouse-position))) (window-buffer (let ((mouse (mouse-position)))
(window-at (cadr mouse) (window-at (cadr mouse)
(cddr mouse)))) (cddr mouse))))
(when (boundp 'cc-define-alist) ; might be a Fortran program (let ((define-elt (assoc expr gdb-define-alist)))
(let ((define-elt (assoc expr cc-define-alist))) (unless (null define-elt)
(unless (null define-elt) (tooltip-show (cdr define-elt))
(tooltip-show (cdr define-elt)) expr))))
expr)))))
(let ((cmd (tooltip-gud-print-command expr))) (let ((cmd (tooltip-gud-print-command expr)))
(unless (null cmd) ; CMD can be nil if unknown debugger (unless (null cmd) ; CMD can be nil if unknown debugger
(case gud-minor-mode (case gud-minor-mode
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment