/[emacs]/emacs/lisp/progmodes/gdb-ui.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/gdb-ui.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.62 by nickrob, Wed Apr 27 22:00:22 2005 UTC revision 1.63 by nickrob, Tue May 3 06:48:47 2005 UTC
# Line 196  detailed description of this mode. Line 196  detailed description of this mode.
196    :group 'gud    :group 'gud
197    :version "22.1")    :version "22.1")
198    
199    (defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
200      "The program name for generating an alist of #define directives.
201    This list is used to display the #define directive associated
202    with an identifier as a tooltip. It works in a debug session with
203    GDB, when tooltip-gud-tips-p is t."
204      :type 'string
205      :group 'gud
206      :version "22.1")
207    
208    (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
209    
210    (defun gdb-create-define-alist ()
211      (let* ((file (buffer-file-name))
212             (output
213              (with-output-to-string
214                (with-current-buffer standard-output
215                  (call-process shell-file-name
216                                (if (file-exists-p file) file nil)
217                                (list t nil) nil "-c"
218                                gdb-cpp-define-alist-program))))
219            (define-list (split-string output "\n" t))
220            (name))
221        (setq gdb-define-alist nil)
222        (dolist (define define-list)
223          (setq name (nth 1 (split-string define "[( ]")))
224          (push (cons name define) gdb-define-alist))))
225    
226  (defun gdb-set-gud-minor-mode (buffer)  (defun gdb-set-gud-minor-mode (buffer)
227    "Set gud-minor-mode from find-file if appropriate."    "Set gud-minor-mode from find-file if appropriate."
228    (goto-char (point-min))    (goto-char (point-min))
# Line 208  detailed description of this mode. Line 235  detailed description of this mode.
235    
236  (defun gdb-set-gud-minor-mode-1 (buffer)  (defun gdb-set-gud-minor-mode-1 (buffer)
237    (goto-char (point-min))    (goto-char (point-min))
238    (if (and (search-forward "Located in " nil t)    (when (and (search-forward "Located in " nil t)
239             (looking-at "\\S-*")               (looking-at "\\S-*")
240             (string-equal (buffer-file-name buffer)               (string-equal (buffer-file-name buffer)
241                           (match-string 0)))                             (match-string 0)))
242        (with-current-buffer buffer      (with-current-buffer buffer
243          (set (make-local-variable 'gud-minor-mode) 'gdba)        (set (make-local-variable 'gud-minor-mode) 'gdba)
244          (set (make-local-variable 'tool-bar-map) gud-tool-bar-map))))        (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
245          (make-local-variable 'gdb-define-alist)
246          (gdb-create-define-alist)
247          (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))
248    
249  (defun gdb-set-gud-minor-mode-existing-buffers ()  (defun gdb-set-gud-minor-mode-existing-buffers ()
250    (dolist (buffer (buffer-list))    (dolist (buffer (buffer-list))
# Line 805  This filter may simply queue input for a Line 835  This filter may simply queue input for a
835    (setq gud-last-frame    (setq gud-last-frame
836          (cons          (cons
837           (match-string 1 args)           (match-string 1 args)
838           (string-to-int (match-string 2 args))))           (string-to-number (match-string 2 args))))
839    (setq gdb-current-address (match-string 3 args))    (setq gdb-current-address (match-string 3 args))
840    ;; cover for auto-display output which comes *before*    ;; cover for auto-display output which comes *before*
841    ;; stopped annotation    ;; stopped annotation
# Line 889  directives." Line 919  directives."
919    (setq gdb-active-process nil)    (setq gdb-active-process nil)
920    (gdb-stopping ignored))    (gdb-stopping ignored))
921    
   
922  (defun gdb-frame-begin (ignored)  (defun gdb-frame-begin (ignored)
923    (let ((sink gdb-output-sink))    (let ((sink gdb-output-sink))
924      (cond      (cond
# Line 1690  static char *magick[] = { Line 1719  static char *magick[] = {
1719    (save-selected-window    (save-selected-window
1720      (select-window (posn-window (event-start event)))      (select-window (posn-window (event-start event)))
1721      (let* ((arg (read-from-minibuffer "Repeat count: "))      (let* ((arg (read-from-minibuffer "Repeat count: "))
1722            (count (string-to-int arg)))            (count (string-to-number arg)))
1723        (if (< count 0)        (if (< count 0)
1724            (error "Non-negative numbers only")            (error "Non-negative numbers only")
1725          (customize-set-variable 'gdb-memory-repeat-count count)          (customize-set-variable 'gdb-memory-repeat-count count)
# Line 1998  corresponding to the mode line clicked." Line 2027  corresponding to the mode line clicked."
2027    
2028  (let ((menu (make-sparse-keymap "GDB-Windows")))  (let ((menu (make-sparse-keymap "GDB-Windows")))
2029    (define-key gud-menu-map [displays]    (define-key gud-menu-map [displays]
2030      `(menu-item "GDB-Windows" ,menu :visible (eq gud-minor-mode 'gdba)))      `(menu-item "GDB-Windows" ,menu
2031                    :visible (memq gud-minor-mode '(gdbmi gdba))))
2032    (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))    (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))
2033    (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))    (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
2034    (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))    (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
# Line 2014  corresponding to the mode line clicked." Line 2044  corresponding to the mode line clicked."
2044    
2045  (let ((menu (make-sparse-keymap "GDB-Frames")))  (let ((menu (make-sparse-keymap "GDB-Frames")))
2046    (define-key gud-menu-map [frames]    (define-key gud-menu-map [frames]
2047      `(menu-item "GDB-Frames" ,menu :visible (eq gud-minor-mode 'gdba)))      `(menu-item "GDB-Frames" ,menu
2048                    :visible (memq gud-minor-mode '(gdbmi gdba))))
2049    (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))    (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))
2050    (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))    (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
2051    (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))    (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
# Line 2153  Kills the gdb buffers and resets the sou Line 2184  Kills the gdb buffers and resets the sou
2184                (gdb-remove-breakpoint-icons (point-min) (point-max) t)                (gdb-remove-breakpoint-icons (point-min) (point-max) t)
2185                (setq gud-minor-mode nil)                (setq gud-minor-mode nil)
2186                (kill-local-variable 'tool-bar-map)                (kill-local-variable 'tool-bar-map)
2187                (setq gud-running nil)                (kill-local-variable 'gdb-define-alist))))))
               (setq gdb-active-process nil))))))  
2188    (when (markerp gdb-overlay-arrow-position)    (when (markerp gdb-overlay-arrow-position)
2189      (move-marker gdb-overlay-arrow-position nil)      (move-marker gdb-overlay-arrow-position nil)
2190      (setq gdb-overlay-arrow-position nil))      (setq gdb-overlay-arrow-position nil))
2191    (setq overlay-arrow-variable-list    (setq overlay-arrow-variable-list
2192          (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)))          (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
2193      (setq gud-running nil)
2194      (setq gdb-active-process nil)
2195      (remove-hook 'after-save-hook 'gdb-create-define-alist t))
2196    
2197  (defun gdb-source-info ()  (defun gdb-source-info ()
2198    "Find the source file where the program starts and displays it with related    "Find the source file where the program starts and displays it with related

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26