Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
104761:e40ac41843a4 | 104762:78dd253006d6 |
---|---|
1609 returned unchanged. If `gdb-frame-number' is nil of NOFRAME is t, | 1609 returned unchanged. If `gdb-frame-number' is nil of NOFRAME is t, |
1610 then no --frame option is added." | 1610 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) |
1621 "Add thread information and asterisks to string NAME. | 1618 "Add thread information and asterisks to string NAME. |
1622 | 1619 |
1651 (when gdb-first-prompt | 1648 (when gdb-first-prompt |
1652 (gdb-force-mode-line-update | 1649 (gdb-force-mode-line-update |
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 |
1659 (gdb-get-buffer-create 'gdb-breakpoints-buffer) | 1658 (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
1660 | 1659 |
1661 (gdb-emit-signal gdb-buf-publisher 'update) | 1660 (gdb-emit-signal gdb-buf-publisher 'update) |
1662 | |
1663 (gdb-get-main-selected-frame) | |
1664 | 1661 |
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)) |
1668 (dolist (var gdb-var-list) | 1665 (dolist (var gdb-var-list) |
2288 (let ((breakpoints-list (gdb-get-field | 2285 (let ((breakpoints-list (gdb-get-field |
2289 (gdb-json-partial-output "bkpt" "script") | 2286 (gdb-json-partial-output "bkpt" "script") |
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))) |
2308 (gdb-get-field breakpoint 'addr) | |
2310 (gdb-get-field breakpoint 'times) | 2309 (gdb-get-field breakpoint 'times) |
2311 (gdb-get-field breakpoint 'addr) | 2310 (if (string-match ".*watchpoint" type) |
2312 (or pending at | 2311 (gdb-get-field breakpoint 'what) |
2313 (concat "in " | 2312 (or pending at |
2314 (propertize func 'font-lock-face font-lock-function-name-face) | 2313 (concat "in " |
2315 (gdb-frame-location breakpoint)))) | 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) |
2319 (when func '(help-echo "mouse-2, RET: visit breakpoint" | 2319 (when func '(help-echo "mouse-2, RET: visit breakpoint" |
2320 mouse-face highlight)))))) | 2320 mouse-face highlight)))))) |
2663 CUSTOM-DEFUN may use locally bound `thread' variable, which will | 2663 CUSTOM-DEFUN may use locally bound `thread' variable, which will |
2664 be the value of 'gdb-thread property of the current line. If | 2664 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) |
2672 (let ((thread (get-text-property (point) 'gdb-thread))) | 2672 (let ((thread (get-text-property (point) 'gdb-thread))) |
2673 (if thread | 2673 (if thread |
3726 (gdb-delete-pending 'gdb-get-main-selected-frame) | 3726 (gdb-delete-pending 'gdb-get-main-selected-frame) |
3727 (let ((frame (gdb-get-field (gdb-json-partial-output) 'frame))) | 3727 (let ((frame (gdb-get-field (gdb-json-partial-output) 'frame))) |
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 |
3734 (when line ; obey the current file only if we have line info | 3735 (when line ; obey the current file only if we have line info |
3735 (setq gud-last-frame (cons gdb-selected-file gdb-selected-line)) | 3736 (setq gud-last-frame (cons gdb-selected-file gdb-selected-line)) |