comparison lisp/progmodes/gdb-ui.el @ 62614:dd9b63b29d80

(gdb-info-locals-handler): Make regexps more general and work when GDB variable "print pretty" is on, as with Emacs, for example.
author Nick Roberts <nickrob@snap.net.nz>
date Sun, 22 May 2005 12:37:24 +0000
parents 327af4f748d5
children 2a8fbbf1f0f4
comparison
equal deleted inserted replaced
62613:d2953bb80941 62614:dd9b63b29d80
1301 (if (re-search-forward " in .* at\\s-+" nil t) 1301 (if (re-search-forward " in .* at\\s-+" nil t)
1302 (progn 1302 (progn
1303 (looking-at "\\(\\S-+\\):\\([0-9]+\\)") 1303 (looking-at "\\(\\S-+\\):\\([0-9]+\\)")
1304 (let ((line (match-string 2)) (buffer-read-only nil) 1304 (let ((line (match-string 2)) (buffer-read-only nil)
1305 (file (match-string 1))) 1305 (file (match-string 1)))
1306 (add-text-properties (point-at-bol) (point-at-eol) 1306 (add-text-properties (line-beginning-position)
1307 (line-end-position)
1307 '(mouse-face highlight 1308 '(mouse-face highlight
1308 help-echo "mouse-2, RET: visit breakpoint")) 1309 help-echo "mouse-2, RET: visit breakpoint"))
1309 (unless (file-exists-p file) 1310 (unless (file-exists-p file)
1310 (setq file (cdr (assoc bptno gdb-location-alist)))) 1311 (setq file (cdr (assoc bptno gdb-location-alist))))
1311 (if (and file 1312 (if (and file
1502 (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer) 1503 (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
1503 (save-excursion 1504 (save-excursion
1504 (let ((buffer-read-only nil)) 1505 (let ((buffer-read-only nil))
1505 (goto-char (point-min)) 1506 (goto-char (point-min))
1506 (while (< (point) (point-max)) 1507 (while (< (point) (point-max))
1507 (add-text-properties (point-at-bol) (point-at-eol) 1508 (add-text-properties (line-beginning-position) (line-end-position)
1508 '(mouse-face highlight 1509 '(mouse-face highlight
1509 help-echo "mouse-2, RET: Select frame")) 1510 help-echo "mouse-2, RET: Select frame"))
1510 (beginning-of-line) 1511 (beginning-of-line)
1511 (when (and (looking-at "^#\\([0-9]+\\)") 1512 (when (and (looking-at "^#\\([0-9]+\\)")
1512 (equal (match-string 1) gdb-current-stack-level)) 1513 (equal (match-string 1) gdb-current-stack-level))
1513 (put-text-property (point-at-bol) (point-at-eol) 1514 (put-text-property (line-beginning-position) (line-end-position)
1514 'face '(:inverse-video t))) 1515 'face '(:inverse-video t)))
1515 (forward-line 1)))))) 1516 (forward-line 1))))))
1516 1517
1517 (defun gdb-stack-buffer-name () 1518 (defun gdb-stack-buffer-name ()
1518 (with-current-buffer gud-comint-buffer 1519 (with-current-buffer gud-comint-buffer
1586 (defun gdb-info-threads-custom () 1587 (defun gdb-info-threads-custom ()
1587 (with-current-buffer (gdb-get-buffer 'gdb-threads-buffer) 1588 (with-current-buffer (gdb-get-buffer 'gdb-threads-buffer)
1588 (let ((buffer-read-only nil)) 1589 (let ((buffer-read-only nil))
1589 (goto-char (point-min)) 1590 (goto-char (point-min))
1590 (while (< (point) (point-max)) 1591 (while (< (point) (point-max))
1591 (add-text-properties (point-at-bol) (point-at-eol) 1592 (add-text-properties (line-beginning-position) (line-end-position)
1592 '(mouse-face highlight 1593 '(mouse-face highlight
1593 help-echo "mouse-2, RET: select thread")) 1594 help-echo "mouse-2, RET: select thread"))
1594 (forward-line 1))))) 1595 (forward-line 1)))))
1595 1596
1596 (defun gdb-threads-buffer-name () 1597 (defun gdb-threads-buffer-name ()
1972 (setq gdb-pending-triggers (delq 'gdb-invalidate-locals 1973 (setq gdb-pending-triggers (delq 'gdb-invalidate-locals
1973 gdb-pending-triggers)) 1974 gdb-pending-triggers))
1974 (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer))) 1975 (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
1975 (with-current-buffer buf 1976 (with-current-buffer buf
1976 (goto-char (point-min)) 1977 (goto-char (point-min))
1977 (while (re-search-forward "^ .*\n" nil t) 1978 (while (re-search-forward "^[ }].*\n" nil t)
1978 (replace-match "" nil nil)) 1979 (replace-match "" nil nil))
1979 (goto-char (point-min)) 1980 (goto-char (point-min))
1980 (while (re-search-forward "{[-0-9, {}\]*\n" nil t) 1981 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t)
1981 (replace-match "(array);\n" nil nil)) 1982 (replace-match "(structure);\n" nil nil))
1982 (goto-char (point-min)) 1983 (goto-char (point-min))
1983 (while (re-search-forward "{.*=.*\n" nil t) 1984 (while (re-search-forward "\\s-*{.*\n" nil t)
1984 (replace-match "(structure);\n" nil nil)))) 1985 (replace-match " (array);\n" nil nil))))
1985 (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) 1986 (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
1986 (and buf (with-current-buffer buf 1987 (and buf (with-current-buffer buf
1987 (let ((p (point)) 1988 (let ((p (point))
1988 (buffer-read-only nil)) 1989 (buffer-read-only nil))
1989 (delete-region (point-min) (point-max)) 1990 (delete-region (point-min) (point-max))
2314 (dolist (overlay (overlays-in start end)) 2315 (dolist (overlay (overlays-in start end))
2315 (when (overlay-get overlay 'put-break) 2316 (when (overlay-get overlay 'put-break)
2316 (delete-overlay overlay)))) 2317 (delete-overlay overlay))))
2317 2318
2318 (defun gdb-put-breakpoint-icon (enabled bptno) 2319 (defun gdb-put-breakpoint-icon (enabled bptno)
2319 (let ((start (progn (beginning-of-line) (- (point) 1))) 2320 (let ((start (- (line-beginning-position) 1))
2320 (end (progn (end-of-line) (+ (point) 1))) 2321 (end (+ (line-end-position) 1))
2321 (putstring (if enabled "B" "b"))) 2322 (putstring (if enabled "B" "b")))
2322 (add-text-properties 2323 (add-text-properties
2323 0 1 '(help-echo "mouse-1: set/clear bkpt, mouse-3: enable/disable bkpt") 2324 0 1 '(help-echo "mouse-1: set/clear bkpt, mouse-3: enable/disable bkpt")
2324 putstring) 2325 putstring)
2325 (if enabled (add-text-properties 2326 (if enabled (add-text-properties