Commit 4d7e2741 authored by Nick Roberts's avatar Nick Roberts
Browse files

(gdb-mouse-until): Make it work in the disassembly buffer too.

(gdb-exited): Remove overlay arrows when execution has finished.
(gdb-info-frames-custom, gdb-info-threads-custom)
(gdb-info-registers-custom): Don't add inappropriate text
properties if inferior is not active.
parent c2205a03
...@@ -424,16 +424,28 @@ With arg, use separate IO iff arg is positive." ...@@ -424,16 +424,28 @@ With arg, use separate IO iff arg is positive."
"Execute source lines by dragging the overlay arrow (fringe) with the mouse." "Execute source lines by dragging the overlay arrow (fringe) with the mouse."
(interactive "e") (interactive "e")
(if gud-overlay-arrow-position (if gud-overlay-arrow-position
(let ((start (event-start event)) (let ((start (event-start event))
(end (event-end event)) (end (event-end event))
(buffer (marker-buffer gud-overlay-arrow-position)) (line)) (buffer (marker-buffer gud-overlay-arrow-position)) (line))
(if (equal buffer (window-buffer (posn-window end))) (if (not (string-match "Machine" mode-name))
(with-current-buffer buffer (if (equal buffer (window-buffer (posn-window end)))
(when (or (equal start end) (with-current-buffer buffer
(equal (posn-point start) (when (or (equal start end)
(marker-position gud-overlay-arrow-position))) (equal (posn-point start)
(setq line (line-number-at-pos (posn-point end))) (marker-position
(gud-call (concat "until " (number-to-string line))))))))) gud-overlay-arrow-position)))
(setq line (line-number-at-pos (posn-point end)))
(gud-call (concat "until " (number-to-string line))))))
(if (equal (marker-buffer gdb-overlay-arrow-position)
(window-buffer (posn-window end)))
(when (or (equal start end)
(equal (posn-point start)
(marker-position
gdb-overlay-arrow-position)))
(save-excursion
(goto-line (line-number-at-pos (posn-point end)))
(forward-char 2)
(gud-call (concat "until *%a")))))))))
(defcustom gdb-use-colon-colon-notation nil (defcustom gdb-use-colon-colon-notation nil
"If non-nil use FUN::VAR format to display variables in the speedbar." "If non-nil use FUN::VAR format to display variables in the speedbar."
...@@ -1032,6 +1044,8 @@ being debugged and that the program is no longer running. This ...@@ -1032,6 +1044,8 @@ being debugged and that the program is no longer running. This
function is used to change the focus of GUD tooltips to #define function is used to change the focus of GUD tooltips to #define
directives." directives."
(setq gdb-active-process nil) (setq gdb-active-process nil)
(setq gud-overlay-arrow-position nil)
(setq gdb-overlay-arrow-position nil)
(gdb-stopping ignored)) (gdb-stopping ignored))
(defun gdb-frame-begin (ignored) (defun gdb-frame-begin (ignored)
...@@ -1613,9 +1627,10 @@ static char *magick[] = { ...@@ -1613,9 +1627,10 @@ static char *magick[] = {
(while (< (point) (point-max)) (while (< (point) (point-max))
(setq bl (line-beginning-position) (setq bl (line-beginning-position)
el (line-end-position)) el (line-end-position))
(add-text-properties bl el (unless (looking-at "No ")
'(mouse-face highlight (add-text-properties bl el
help-echo "mouse-2, RET: Select frame")) '(mouse-face highlight
help-echo "mouse-2, RET: Select frame")))
(goto-char bl) (goto-char bl)
(when (looking-at "^#\\([0-9]+\\)") (when (looking-at "^#\\([0-9]+\\)")
(when (string-equal (match-string 1) gdb-frame-number) (when (string-equal (match-string 1) gdb-frame-number)
...@@ -1712,9 +1727,10 @@ static char *magick[] = { ...@@ -1712,9 +1727,10 @@ static char *magick[] = {
(let ((buffer-read-only nil)) (let ((buffer-read-only nil))
(goto-char (point-min)) (goto-char (point-min))
(while (< (point) (point-max)) (while (< (point) (point-max))
(add-text-properties (line-beginning-position) (line-end-position) (unless (looking-at "No ")
'(mouse-face highlight (add-text-properties (line-beginning-position) (line-end-position)
help-echo "mouse-2, RET: select thread")) '(mouse-face highlight
help-echo "mouse-2, RET: select thread")))
(forward-line 1))))) (forward-line 1)))))
(defun gdb-threads-buffer-name () (defun gdb-threads-buffer-name ()
...@@ -1806,8 +1822,9 @@ static char *magick[] = { ...@@ -1806,8 +1822,9 @@ static char *magick[] = {
(while (< (point) (point-max)) (while (< (point) (point-max))
(setq bl (line-beginning-position)) (setq bl (line-beginning-position))
(when (looking-at "^[^ ]+") (when (looking-at "^[^ ]+")
(put-text-property bl (match-end 0) (unless (string-equal (match-string 0) "The")
'face font-lock-variable-name-face)) (put-text-property bl (match-end 0)
'face font-lock-variable-name-face)))
(forward-line 1)))))) (forward-line 1))))))
(defvar gdb-registers-mode-map (defvar gdb-registers-mode-map
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment