comparison lisp/progmodes/gdb-ui.el @ 80536:4b0ab9e918cd

(gdb-info-breakpoints-custom): Fix mismatched parentheses.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 28 Apr 2008 07:18:03 +0000
parents 106730cfdf95
children e6565d8a8428 149436454788
comparison
equal deleted inserted replaced
80535:106730cfdf95 80536:4b0ab9e918cd
1909 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name)))) 1909 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name))))
1910 (gdb-remove-breakpoint-icons (point-min) (point-max))))) 1910 (gdb-remove-breakpoint-icons (point-min) (point-max)))))
1911 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) 1911 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
1912 (save-excursion 1912 (save-excursion
1913 (let ((buffer-read-only nil)) 1913 (let ((buffer-read-only nil))
1914 (goto-char (point-min)) 1914 (goto-char (point-min))
1915 (while (< (point) (- (point-max) 1)) 1915 (while (< (point) (- (point-max) 1))
1916 (forward-line 1) 1916 (forward-line 1)
1917 (if (looking-at gdb-breakpoint-regexp) 1917 (if (looking-at gdb-breakpoint-regexp)
1918 (progn 1918 (progn
1919 (setq bptno (or (match-string 1) (match-string 2))) 1919 (setq bptno (or (match-string 1) (match-string 2)))
1920 (setq flag (char-after (match-beginning 3))) 1920 (setq flag (char-after (match-beginning 3)))
1921 (if (match-string 1) 1921 (if (match-string 1)
1922 (setq gdb-parent-bptno-enabled (eq flag ?y))) 1922 (setq gdb-parent-bptno-enabled (eq flag ?y)))
1923 (add-text-properties 1923 (add-text-properties
1924 (match-beginning 3) (match-end 3) 1924 (match-beginning 3) (match-end 3)
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 (when (re-search-forward " in \\(.*\\) at" el t) 1930 (when (re-search-forward " in \\(.*\\) at" el t)
1931 (add-text-properties 1931 (add-text-properties
1932 (match-beginning 1) (match-end 1) 1932 (match-beginning 1) (match-end 1)
1933 '(face font-lock-function-name-face))) 1933 '(face font-lock-function-name-face)))
1934 (if (re-search-forward ".*\\s-+\\(\\S-+\\):\\([0-9]+\\)$") 1934 (if (re-search-forward ".*\\s-+\\(\\S-+\\):\\([0-9]+\\)$")
1935 (let ((line (match-string 2)) 1935 (let ((line (match-string 2))
1936 (file (match-string 1))) 1936 (file (match-string 1)))
1937 (add-text-properties bl el 1937 (add-text-properties bl el
1938 '(mouse-face highlight 1938 '(mouse-face highlight
1939 help-echo "mouse-2, RET: visit breakpoint")) 1939 help-echo "mouse-2, RET: visit breakpoint"))
1940 (unless (file-exists-p file) 1940 (unless (file-exists-p file)
1941 (setq file (cdr (assoc bptno gdb-location-alist)))) 1941 (setq file (cdr (assoc bptno gdb-location-alist))))
1942 (if (and file 1942 (if (and file
1943 (not (string-equal file "File not found"))) 1943 (not (string-equal file "File not found")))
1944 (with-current-buffer 1944 (with-current-buffer
1945 (find-file-noselect file 'nowarn) 1945 (find-file-noselect file 'nowarn)
1946 (gdb-init-buffer) 1946 (gdb-init-buffer)
1947 ;; Only want one breakpoint icon at each 1947 ;; Only want one breakpoint icon at each
1948 ;; location. 1948 ;; location.
1949 (save-excursion 1949 (save-excursion
1950 (goto-line (string-to-number line)) 1950 (goto-line (string-to-number line))
1951 (gdb-put-breakpoint-icon (eq flag ?y) bptno))) 1951 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))
1952 (gdb-enqueue-input 1952 (gdb-enqueue-input
1953 (list 1953 (list
1954 (concat gdb-server-prefix "list " 1954 (concat gdb-server-prefix "list "
1955 (match-string-no-properties 1) ":1\n") 1955 (match-string-no-properties 1) ":1\n")
1956 'ignore)) 1956 'ignore))
1957 (gdb-enqueue-input 1957 (gdb-enqueue-input
1958 (list (concat gdb-server-prefix "info source\n") 1958 (list (concat gdb-server-prefix "info source\n")
1959 `(lambda () (gdb-get-location 1959 `(lambda () (gdb-get-location
1960 ,bptno ,line ,flag))))))) 1960 ,bptno ,line ,flag))))))
1961 (if (re-search-forward 1961 (if (re-search-forward
1962 "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" 1962 "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
1963 el t) 1963 el t)
1964 (add-text-properties
1965 (match-beginning 1) (match-end 1)
1966 '(face font-lock-function-name-face))
1967 (end-of-line)
1968 (re-search-backward "\\s-\\(\\S-*\\)"
1969 bl t)
1964 (add-text-properties 1970 (add-text-properties
1965 (match-beginning 1) (match-end 1) 1971 (match-beginning 1) (match-end 1)
1966 '(face font-lock-function-name-face)) 1972 '(face font-lock-variable-name-face)))))))
1967 (end-of-line) 1973 (end-of-line))))))
1968 (re-search-backward "\\s-\\(\\S-*\\)"
1969 bl t)
1970 (add-text-properties
1971 (match-beginning 1) (match-end 1)
1972 '(face font-lock-variable-name-face)))))))
1973 (end-of-line))))))
1974 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) 1974 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom)))
1975 1975
1976 (defun gdb-mouse-set-clear-breakpoint (event) 1976 (defun gdb-mouse-set-clear-breakpoint (event)
1977 "Set/clear breakpoint in left fringe/margin with mouse click." 1977 "Set/clear breakpoint in left fringe/margin with mouse click."
1978 (interactive "e") 1978 (interactive "e")