# HG changeset patch # User Nick Roberts # Date 1251722155 0 # Node ID 78dd253006d6b3dda64d3583dde5b084c4bf8868 # Parent e40ac41843a4667f8cb3a6379430b246e17c9e37 (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. diff -r e40ac41843a4 -r 78dd253006d6 lisp/progmodes/gdb-mi.el --- 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