comparison lisp/progmodes/gdb-ui.el @ 80535:106730cfdf95

(gdb-info-breakpoints-custom): Make breakpoint icons work for assembler, i.e. FILE.s, FILE.S (not disassembly). (gdb-goto-breakpoint): Likewise for visiting breakpoints. (gdb-assembler-custom): Be careful not to match other addresses.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 28 Apr 2008 03:24:43 +0000
parents f3ac5401fa8e
children 4b0ab9e918cd
comparison
equal deleted inserted replaced
80534:3d112d86803d 80535:106730cfdf95
1925 (if (eq flag ?y) 1925 (if (eq flag ?y)
1926 '(face font-lock-warning-face) 1926 '(face font-lock-warning-face)
1927 '(face font-lock-type-face))) 1927 '(face font-lock-type-face)))
1928 (let ((bl (point)) 1928 (let ((bl (point))
1929 (el (line-end-position))) 1929 (el (line-end-position)))
1930 (if (re-search-forward " in \\(.*\\) at\\s-+" el t) 1930 (when (re-search-forward " in \\(.*\\) at" el t)
1931 (progn 1931 (add-text-properties
1932 (add-text-properties 1932 (match-beginning 1) (match-end 1)
1933 (match-beginning 1) (match-end 1) 1933 '(face font-lock-function-name-face)))
1934 '(face font-lock-function-name-face)) 1934 (if (re-search-forward ".*\\s-+\\(\\S-+\\):\\([0-9]+\\)$")
1935 (looking-at "\\(\\S-+\\):\\([0-9]+\\)") 1935 (let ((line (match-string 2))
1936 (let ((line (match-string 2)) 1936 (file (match-string 1)))
1937 (file (match-string 1))) 1937 (add-text-properties bl el
1938 (add-text-properties bl el 1938 '(mouse-face highlight
1939 '(mouse-face highlight 1939 help-echo "mouse-2, RET: visit breakpoint"))
1940 help-echo "mouse-2, RET: visit breakpoint")) 1940 (unless (file-exists-p file)
1941 (unless (file-exists-p file) 1941 (setq file (cdr (assoc bptno gdb-location-alist))))
1942 (setq file (cdr (assoc bptno gdb-location-alist)))) 1942 (if (and file
1943 (if (and file 1943 (not (string-equal file "File not found")))
1944 (not (string-equal file "File not found"))) 1944 (with-current-buffer
1945 (with-current-buffer 1945 (find-file-noselect file 'nowarn)
1946 (find-file-noselect file 'nowarn) 1946 (gdb-init-buffer)
1947 (gdb-init-buffer) 1947 ;; Only want one breakpoint icon at each
1948 ;; Only want one breakpoint icon at each 1948 ;; location.
1949 ;; location. 1949 (save-excursion
1950 (save-excursion 1950 (goto-line (string-to-number line))
1951 (goto-line (string-to-number line)) 1951 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))
1952 (gdb-put-breakpoint-icon (eq flag ?y) bptno))) 1952 (gdb-enqueue-input
1953 (gdb-enqueue-input 1953 (list
1954 (list 1954 (concat gdb-server-prefix "list "
1955 (concat gdb-server-prefix "list " 1955 (match-string-no-properties 1) ":1\n")
1956 (match-string-no-properties 1) ":1\n") 1956 'ignore))
1957 'ignore)) 1957 (gdb-enqueue-input
1958 (gdb-enqueue-input 1958 (list (concat gdb-server-prefix "info source\n")
1959 (list (concat gdb-server-prefix "info source\n") 1959 `(lambda () (gdb-get-location
1960 `(lambda () (gdb-get-location 1960 ,bptno ,line ,flag)))))))
1961 ,bptno ,line ,flag)))))))
1962 (if (re-search-forward 1961 (if (re-search-forward
1963 "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" 1962 "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
1964 el t) 1963 el t)
1965 (add-text-properties 1964 (add-text-properties
1966 (match-beginning 1) (match-end 1) 1965 (match-beginning 1) (match-end 1)
2129 "Display the breakpoint location specified at current line." 2128 "Display the breakpoint location specified at current line."
2130 (interactive (list last-input-event)) 2129 (interactive (list last-input-event))
2131 (if event (posn-set-point (event-end event))) 2130 (if event (posn-set-point (event-end event)))
2132 (save-excursion 2131 (save-excursion
2133 (beginning-of-line 1) 2132 (beginning-of-line 1)
2134 (if (looking-at "\\([0-9]+\\.?[0-9]*\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)") 2133 (if (looking-at "\\([0-9]+\\.?[0-9]*\\) .*\\s-+\\(\\S-+\\):\\([0-9]+\\)$")
2135 (let ((bptno (match-string 1)) 2134 (let ((bptno (match-string 1))
2136 (file (match-string 2)) 2135 (file (match-string 2))
2137 (line (match-string 3))) 2136 (line (match-string 3)))
2138 (save-selected-window 2137 (save-selected-window
2139 (let* ((buffer (find-file-noselect 2138 (let* ((buffer (find-file-noselect
2146 (goto-line (string-to-number line)) 2145 (goto-line (string-to-number line))
2147 (set-window-point window (point)))))) 2146 (set-window-point window (point))))))
2148 (error "No location specified.")))) 2147 (error "No location specified."))))
2149 2148
2150 2149
2151 ;; Frames buffer. This displays a perpetually correct bactracktrace 2150 ;; Frames buffer. This displays a perpetually correct backtrace
2152 ;; (from the command `where'). 2151 ;; (from the command `where').
2153 ;; 2152 ;;
2154 ;; Alas, if your stack is deep, it is costly. 2153 ;; Alas, if your stack is deep, it is costly.
2155 ;; 2154 ;;
2156 (defcustom gdb-max-frames 40 2155 (defcustom gdb-max-frames 40
3335 (setq flag (char-after (match-beginning 2))) 3334 (setq flag (char-after (match-beginning 2)))
3336 (setq address (match-string 3)) 3335 (setq address (match-string 3))
3337 (with-current-buffer buffer 3336 (with-current-buffer buffer
3338 (save-excursion 3337 (save-excursion
3339 (goto-char (point-min)) 3338 (goto-char (point-min))
3340 (if (search-forward address nil t) 3339 (if (re-search-forward (concat "^0x0*" address) nil t)
3341 (gdb-put-breakpoint-icon (eq flag ?y) bptno))))))) 3340 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))))
3342 (if (not (equal gdb-pc-address "main")) 3341 (if (not (equal gdb-pc-address "main"))
3343 (with-current-buffer buffer 3342 (with-current-buffer buffer
3344 (set-window-point (get-buffer-window buffer 0) pos))))) 3343 (set-window-point (get-buffer-window buffer 0) pos)))))
3345 3344