comparison lisp/progmodes/gdb-ui.el @ 94452:149436454788

Merge from emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1132
author Miles Bader <miles@gnu.org>
date Tue, 29 Apr 2008 01:03:43 +0000
parents 52a0ed7601cb 4b0ab9e918cd
children 3fd45a6262cb
comparison
equal deleted inserted replaced
94451:760ef541936c 94452:149436454788
1926 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name)))) 1926 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name))))
1927 (gdb-remove-breakpoint-icons (point-min) (point-max))))) 1927 (gdb-remove-breakpoint-icons (point-min) (point-max)))))
1928 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) 1928 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
1929 (save-excursion 1929 (save-excursion
1930 (let ((buffer-read-only nil)) 1930 (let ((buffer-read-only nil))
1931 (goto-char (point-min)) 1931 (goto-char (point-min))
1932 (while (< (point) (- (point-max) 1)) 1932 (while (< (point) (- (point-max) 1))
1933 (forward-line 1) 1933 (forward-line 1)
1934 (if (looking-at gdb-breakpoint-regexp) 1934 (if (looking-at gdb-breakpoint-regexp)
1935 (progn 1935 (progn
1936 (setq bptno (or (match-string 1) (match-string 2))) 1936 (setq bptno (or (match-string 1) (match-string 2)))
1937 (setq flag (char-after (match-beginning 3))) 1937 (setq flag (char-after (match-beginning 3)))
1938 (if (match-string 1) 1938 (if (match-string 1)
1939 (setq gdb-parent-bptno-enabled (eq flag ?y))) 1939 (setq gdb-parent-bptno-enabled (eq flag ?y)))
1940 (add-text-properties 1940 (add-text-properties
1941 (match-beginning 3) (match-end 3) 1941 (match-beginning 3) (match-end 3)
1942 (if (eq flag ?y) 1942 (if (eq flag ?y)
1943 '(face font-lock-warning-face) 1943 '(face font-lock-warning-face)
1944 '(face font-lock-type-face))) 1944 '(face font-lock-type-face)))
1945 (let ((bl (point)) 1945 (let ((bl (point))
1946 (el (line-end-position))) 1946 (el (line-end-position)))
1947 (if (re-search-forward " in \\(.*\\) at\\s-+" el t) 1947 (when (re-search-forward " in \\(.*\\) at" el t)
1948 (progn 1948 (add-text-properties
1949 (add-text-properties 1949 (match-beginning 1) (match-end 1)
1950 (match-beginning 1) (match-end 1) 1950 '(face font-lock-function-name-face)))
1951 '(face font-lock-function-name-face)) 1951 (if (re-search-forward ".*\\s-+\\(\\S-+\\):\\([0-9]+\\)$")
1952 (looking-at "\\(\\S-+\\):\\([0-9]+\\)")
1953 (let ((line (match-string 2)) 1952 (let ((line (match-string 2))
1954 (file (match-string 1))) 1953 (file (match-string 1)))
1955 (add-text-properties bl el 1954 (add-text-properties bl el
1956 '(mouse-face highlight 1955 '(mouse-face highlight
1957 help-echo "mouse-2, RET: visit breakpoint")) 1956 help-echo "mouse-2, RET: visit breakpoint"))
1958 (unless (file-exists-p file) 1957 (unless (file-exists-p file)
1959 (setq file (cdr (assoc bptno gdb-location-alist)))) 1958 (setq file (cdr (assoc bptno gdb-location-alist))))
1960 (if (and file 1959 (if (and file
1961 (not (string-equal file "File not found"))) 1960 (not (string-equal file "File not found")))
1962 (with-current-buffer 1961 (with-current-buffer
1973 (match-string-no-properties 1) ":1\n") 1972 (match-string-no-properties 1) ":1\n")
1974 'ignore)) 1973 'ignore))
1975 (gdb-enqueue-input 1974 (gdb-enqueue-input
1976 (list (concat gdb-server-prefix "info source\n") 1975 (list (concat gdb-server-prefix "info source\n")
1977 `(lambda () (gdb-get-location 1976 `(lambda () (gdb-get-location
1978 ,bptno ,line ,flag))))))) 1977 ,bptno ,line ,flag))))))
1979 (if (re-search-forward 1978 (if (re-search-forward
1980 "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" 1979 "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
1981 el t) 1980 el t)
1981 (add-text-properties
1982 (match-beginning 1) (match-end 1)
1983 '(face font-lock-function-name-face))
1984 (end-of-line)
1985 (re-search-backward "\\s-\\(\\S-*\\)"
1986 bl t)
1982 (add-text-properties 1987 (add-text-properties
1983 (match-beginning 1) (match-end 1) 1988 (match-beginning 1) (match-end 1)
1984 '(face font-lock-function-name-face)) 1989 '(face font-lock-variable-name-face)))))))
1985 (end-of-line) 1990 (end-of-line))))))
1986 (re-search-backward "\\s-\\(\\S-*\\)"
1987 bl t)
1988 (add-text-properties
1989 (match-beginning 1) (match-end 1)
1990 '(face font-lock-variable-name-face)))))))
1991 (end-of-line))))))
1992 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom)) 1991 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))
1993 1992
1994 ;; Breakpoints buffer is always present. Hack to just update 1993 ;; Breakpoints buffer is always present. Hack to just update
1995 ;; current frame if there's been no execution. 1994 ;; current frame if there's been no execution.
1996 (if gdb-stack-update 1995 (if gdb-stack-update
2199 "Display the breakpoint location specified at current line." 2198 "Display the breakpoint location specified at current line."
2200 (interactive (list last-input-event)) 2199 (interactive (list last-input-event))
2201 (if event (posn-set-point (event-end event))) 2200 (if event (posn-set-point (event-end event)))
2202 (save-excursion 2201 (save-excursion
2203 (beginning-of-line 1) 2202 (beginning-of-line 1)
2204 (if (looking-at "\\([0-9]+\\.?[0-9]*\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)") 2203 (if (looking-at "\\([0-9]+\\.?[0-9]*\\) .*\\s-+\\(\\S-+\\):\\([0-9]+\\)$")
2205 (let ((bptno (match-string 1)) 2204 (let ((bptno (match-string 1))
2206 (file (match-string 2)) 2205 (file (match-string 2))
2207 (line (match-string 3))) 2206 (line (match-string 3)))
2208 (save-selected-window 2207 (save-selected-window
2209 (let* ((buffer (find-file-noselect 2208 (let* ((buffer (find-file-noselect
2216 (goto-line (string-to-number line)) 2215 (goto-line (string-to-number line))
2217 (set-window-point window (point)))))) 2216 (set-window-point window (point))))))
2218 (error "No location specified.")))) 2217 (error "No location specified."))))
2219 2218
2220 2219
2221 ;; Frames buffer. This displays a perpetually correct bactracktrace 2220 ;; Frames buffer. This displays a perpetually correct backtrace
2222 ;; (from the command `where'). 2221 ;; (from the command `where').
2223 ;; 2222 ;;
2224 ;; Alas, if your stack is deep, it is costly. 2223 ;; Alas, if your stack is deep, it is costly.
2225 ;; 2224 ;;
2226 (defcustom gdb-max-frames 40 2225 (defcustom gdb-max-frames 40
3473 (setq flag (char-after (match-beginning 2))) 3472 (setq flag (char-after (match-beginning 2)))
3474 (setq address (match-string 3)) 3473 (setq address (match-string 3))
3475 (with-current-buffer buffer 3474 (with-current-buffer buffer
3476 (save-excursion 3475 (save-excursion
3477 (goto-char (point-min)) 3476 (goto-char (point-min))
3478 (if (search-forward address nil t) 3477 (if (re-search-forward (concat "^0x0*" address) nil t)
3479 (gdb-put-breakpoint-icon (eq flag ?y) bptno))))))) 3478 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))))
3480 (if (not (equal gdb-pc-address "main")) 3479 (if (not (equal gdb-pc-address "main"))
3481 (with-current-buffer buffer 3480 (with-current-buffer buffer
3482 (set-window-point (get-buffer-window buffer 0) pos))))) 3481 (set-window-point (get-buffer-window buffer 0) pos)))))
3483 3482