aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2009-08-31 12:35:55 +0000
committerNick Roberts2009-08-31 12:35:55 +0000
commit51f3f21d068d04acd1737779d1f1032f2e161c2a (patch)
treee94637e5a33f2708b2a7712da6e0f5d2a94d4678
parent0afad2786e37319ca979afffb9d48cdb77c66499 (diff)
downloademacs-51f3f21d068d04acd1737779d1f1032f2e161c2a.tar.gz
emacs-51f3f21d068d04acd1737779d1f1032f2e161c2a.zip
(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.
-rw-r--r--lisp/progmodes/gdb-mi.el31
1 files changed, 16 insertions, 15 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index f3cdbc17519..2eb11df492e 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1611,10 +1611,7 @@ then no --frame option is added."
1611 ;; gdb-frame-number may be nil while gdb-thread-number is non-nil 1611 ;; gdb-frame-number may be nil while gdb-thread-number is non-nil
1612 ;; (when current thread is running) 1612 ;; (when current thread is running)
1613 (if gdb-thread-number 1613 (if gdb-thread-number
1614 (concat command " --thread " gdb-thread-number 1614 (concat command " --thread " gdb-thread-number " ")
1615 (if (not (or noframe (not gdb-frame-number)))
1616 (concat " --frame " gdb-frame-number) "")
1617 " ")
1618 command)) 1615 command))
1619 1616
1620(defun gdb-current-context-buffer-name (name) 1617(defun gdb-current-context-buffer-name (name)
@@ -1653,6 +1650,8 @@ If `gdb-thread-number' is nil, just wrap NAME in asterisks."
1653 (propertize "initializing..." 'face font-lock-variable-name-face)) 1650 (propertize "initializing..." 'face font-lock-variable-name-face))
1654 (gdb-init-1) 1651 (gdb-init-1)
1655 (setq gdb-first-prompt nil)) 1652 (setq gdb-first-prompt nil))
1653
1654 (gdb-get-main-selected-frame)
1656 ;; We may need to update gdb-threads-list so we can use 1655 ;; We may need to update gdb-threads-list so we can use
1657 (gdb-get-buffer-create 'gdb-threads-buffer) 1656 (gdb-get-buffer-create 'gdb-threads-buffer)
1658 ;; gdb-break-list is maintained in breakpoints handler 1657 ;; gdb-break-list is maintained in breakpoints handler
@@ -1660,8 +1659,6 @@ If `gdb-thread-number' is nil, just wrap NAME in asterisks."
1660 1659
1661 (gdb-emit-signal gdb-buf-publisher 'update) 1660 (gdb-emit-signal gdb-buf-publisher 'update)
1662 1661
1663 (gdb-get-main-selected-frame)
1664
1665 (gdb-get-changed-registers) 1662 (gdb-get-changed-registers)
1666 1663
1667 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) 1664 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
@@ -2290,29 +2287,32 @@ HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See
2290 'BreakpointTable 'body)) 2287 'BreakpointTable 'body))
2291 (table (make-gdb-table))) 2288 (table (make-gdb-table)))
2292 (setq gdb-breakpoints-list nil) 2289 (setq gdb-breakpoints-list nil)
2293 (gdb-table-add-row table '("Num" "Type" "Disp" "Enb" "Hits" "Addr" "What")) 2290 (gdb-table-add-row table '("Num" "Type" "Disp" "Enb" "Addr" "Hits" "What"))
2294 (dolist (breakpoint breakpoints-list) 2291 (dolist (breakpoint breakpoints-list)
2295 (add-to-list 'gdb-breakpoints-list 2292 (add-to-list 'gdb-breakpoints-list
2296 (cons (gdb-get-field breakpoint 'number) 2293 (cons (gdb-get-field breakpoint 'number)
2297 breakpoint)) 2294 breakpoint))
2298 (let ((at (gdb-get-field breakpoint 'at)) 2295 (let ((at (gdb-get-field breakpoint 'at))
2299 (pending (gdb-get-field breakpoint 'pending)) 2296 (pending (gdb-get-field breakpoint 'pending))
2300 (func (gdb-get-field breakpoint 'func))) 2297 (func (gdb-get-field breakpoint 'func))
2298 (type (gdb-get-field breakpoint 'type)))
2301 (gdb-table-add-row table 2299 (gdb-table-add-row table
2302 (list 2300 (list
2303 (gdb-get-field breakpoint 'number) 2301 (gdb-get-field breakpoint 'number)
2304 (gdb-get-field breakpoint 'type) 2302 type
2305 (gdb-get-field breakpoint 'disp) 2303 (gdb-get-field breakpoint 'disp)
2306 (let ((flag (gdb-get-field breakpoint 'enabled))) 2304 (let ((flag (gdb-get-field breakpoint 'enabled)))
2307 (if (string-equal flag "y") 2305 (if (string-equal flag "y")
2308 (propertize "y" 'font-lock-face font-lock-warning-face) 2306 (propertize "y" 'font-lock-face font-lock-warning-face)
2309 (propertize "n" 'font-lock-face font-lock-comment-face))) 2307 (propertize "n" 'font-lock-face font-lock-comment-face)))
2310 (gdb-get-field breakpoint 'times)
2311 (gdb-get-field breakpoint 'addr) 2308 (gdb-get-field breakpoint 'addr)
2312 (or pending at 2309 (gdb-get-field breakpoint 'times)
2313 (concat "in " 2310 (if (string-match ".*watchpoint" type)
2314 (propertize func 'font-lock-face font-lock-function-name-face) 2311 (gdb-get-field breakpoint 'what)
2315 (gdb-frame-location breakpoint)))) 2312 (or pending at
2313 (concat "in "
2314 (propertize func 'font-lock-face font-lock-function-name-face)
2315 (gdb-frame-location breakpoint)))))
2316 ;; Add clickable properties only for breakpoints with file:line 2316 ;; Add clickable properties only for breakpoints with file:line
2317 ;; information 2317 ;; information
2318 (append (list 'gdb-breakpoint breakpoint) 2318 (append (list 'gdb-breakpoint breakpoint)
@@ -2665,7 +2665,7 @@ be the value of 'gdb-thread property of the current line. If
2665'gdb-thread is nil, error is signaled." 2665'gdb-thread is nil, error is signaled."
2666 `(defun ,name (&optional event) 2666 `(defun ,name (&optional event)
2667 ,(when doc doc) 2667 ,(when doc doc)
2668 (interactive) 2668 (interactive (list last-input-event))
2669 (if event (posn-set-point (event-end event))) 2669 (if event (posn-set-point (event-end event)))
2670 (save-excursion 2670 (save-excursion
2671 (beginning-of-line) 2671 (beginning-of-line)
@@ -3728,6 +3728,7 @@ overlay arrow in source buffer."
3728 (when frame 3728 (when frame
3729 (setq gdb-selected-frame (gdb-get-field frame 'func)) 3729 (setq gdb-selected-frame (gdb-get-field frame 'func))
3730 (setq gdb-selected-file (gdb-get-field frame 'fullname)) 3730 (setq gdb-selected-file (gdb-get-field frame 'fullname))
3731 (setq gdb-frame-number (gdb-get-field frame 'level))
3731 (let ((line (gdb-get-field frame 'line))) 3732 (let ((line (gdb-get-field frame 'line)))
3732 (setq gdb-selected-line (or (and line (string-to-number line)) 3733 (setq gdb-selected-line (or (and line (string-to-number line))
3733 nil)) ; don't fail if line is nil 3734 nil)) ; don't fail if line is nil