Mercurial > emacs
diff lisp/progmodes/gdb-mi.el @ 104762:78dd253006d6
(gdb-breakpoints-list-handler-custom):
Handle watchpoints (bug#4282).
(def-gdb-thread-buffer-command): Enable thread to be selected by
clicking without selecting threads buffer first.
(gdb-current-context-command): Use selected frame so that "up",
"down" etc work in the GUD buffer.
(gdb-update): Find selected frame before rendering stack buffer.
(gdb-frame-handler): Set gdb-frame-number for stack buffer.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Mon, 31 Aug 2009 12:35:55 +0000 |
parents | d2e8b86ba828 |
children | 468b7fa34d2c |
line wrap: on
line diff
--- a/lisp/progmodes/gdb-mi.el Mon Aug 31 12:34:15 2009 +0000 +++ b/lisp/progmodes/gdb-mi.el Mon Aug 31 12:35:55 2009 +0000 @@ -1611,10 +1611,7 @@ ;; gdb-frame-number may be nil while gdb-thread-number is non-nil ;; (when current thread is running) (if gdb-thread-number - (concat command " --thread " gdb-thread-number - (if (not (or noframe (not gdb-frame-number))) - (concat " --frame " gdb-frame-number) "") - " ") + (concat command " --thread " gdb-thread-number " ") command)) (defun gdb-current-context-buffer-name (name) @@ -1653,6 +1650,8 @@ (propertize "initializing..." 'face font-lock-variable-name-face)) (gdb-init-1) (setq gdb-first-prompt nil)) + + (gdb-get-main-selected-frame) ;; We may need to update gdb-threads-list so we can use (gdb-get-buffer-create 'gdb-threads-buffer) ;; gdb-break-list is maintained in breakpoints handler @@ -1660,8 +1659,6 @@ (gdb-emit-signal gdb-buf-publisher 'update) - (gdb-get-main-selected-frame) - (gdb-get-changed-registers) (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) @@ -2290,29 +2287,32 @@ 'BreakpointTable 'body)) (table (make-gdb-table))) (setq gdb-breakpoints-list nil) - (gdb-table-add-row table '("Num" "Type" "Disp" "Enb" "Hits" "Addr" "What")) + (gdb-table-add-row table '("Num" "Type" "Disp" "Enb" "Addr" "Hits" "What")) (dolist (breakpoint breakpoints-list) (add-to-list 'gdb-breakpoints-list (cons (gdb-get-field breakpoint 'number) breakpoint)) (let ((at (gdb-get-field breakpoint 'at)) (pending (gdb-get-field breakpoint 'pending)) - (func (gdb-get-field breakpoint 'func))) + (func (gdb-get-field breakpoint 'func)) + (type (gdb-get-field breakpoint 'type))) (gdb-table-add-row table (list (gdb-get-field breakpoint 'number) - (gdb-get-field breakpoint 'type) + type (gdb-get-field breakpoint 'disp) (let ((flag (gdb-get-field breakpoint 'enabled))) (if (string-equal flag "y") (propertize "y" 'font-lock-face font-lock-warning-face) (propertize "n" 'font-lock-face font-lock-comment-face))) + (gdb-get-field breakpoint 'addr) (gdb-get-field breakpoint 'times) - (gdb-get-field breakpoint 'addr) - (or pending at - (concat "in " - (propertize func 'font-lock-face font-lock-function-name-face) - (gdb-frame-location breakpoint)))) + (if (string-match ".*watchpoint" type) + (gdb-get-field breakpoint 'what) + (or pending at + (concat "in " + (propertize func 'font-lock-face font-lock-function-name-face) + (gdb-frame-location breakpoint))))) ;; Add clickable properties only for breakpoints with file:line ;; information (append (list 'gdb-breakpoint breakpoint) @@ -2665,7 +2665,7 @@ 'gdb-thread is nil, error is signaled." `(defun ,name (&optional event) ,(when doc doc) - (interactive) + (interactive (list last-input-event)) (if event (posn-set-point (event-end event))) (save-excursion (beginning-of-line) @@ -3728,6 +3728,7 @@ (when frame (setq gdb-selected-frame (gdb-get-field frame 'func)) (setq gdb-selected-file (gdb-get-field frame 'fullname)) + (setq gdb-frame-number (gdb-get-field frame 'level)) (let ((line (gdb-get-field frame 'line))) (setq gdb-selected-line (or (and line (string-to-number line)) nil)) ; don't fail if line is nil