comparison lisp/progmodes/gdb-ui.el @ 67233:f8729e3300dc

(gdb-ann3): Bind mouse-2 to gdb-mouse-until in the margin also. (gdb-breakpoints-mode-map): Use D instead of d for gdb-delete-breakpoint. (gdb-get-frame-number): Require a number to match on. (gdb-threads-mode-map): Add follow-link binding.
author Nick Roberts <nickrob@snap.net.nz>
date Thu, 01 Dec 2005 02:17:15 +0000
parents c3990f178905
children ee8894ca3f64 1955a4462bf9
comparison
equal deleted inserted replaced
67232:003d50ec9805 67233:f8729e3300dc
39 ;; This file has evolved from gdba.el that was included with GDB 5.0 and 39 ;; This file has evolved from gdba.el that was included with GDB 5.0 and
40 ;; written by Tom Lord and Jim Kingdon. It uses GDB's annotation interface. 40 ;; written by Tom Lord and Jim Kingdon. It uses GDB's annotation interface.
41 ;; You don't need to know about annotations to use this mode as a debugger, 41 ;; You don't need to know about annotations to use this mode as a debugger,
42 ;; but if you are interested developing the mode itself, then see the 42 ;; but if you are interested developing the mode itself, then see the
43 ;; Annotations section in the GDB info manual. 43 ;; Annotations section in the GDB info manual.
44 ;; 44
45 ;; GDB developers plan to make the annotation interface obsolete. A new 45 ;; GDB developers plan to make the annotation interface obsolete. A new
46 ;; interface called GDB/MI (machine interface) has been designed to replace 46 ;; interface called GDB/MI (machine interface) has been designed to replace
47 ;; it. Some GDB/MI commands are used in this file through the CLI command 47 ;; it. Some GDB/MI commands are used in this file through the CLI command
48 ;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included with 48 ;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included with
49 ;; GDB (6.2 onwards) that uses GDB/MI as the primary interface to GDB. It is 49 ;; GDB (6.2 onwards) that uses GDB/MI as the primary interface to GDB. It is
50 ;; still under development and is part of a process to migrate Emacs from 50 ;; still under development and is part of a process to migrate Emacs from
51 ;; annotations to GDB/MI. 51 ;; annotations to GDB/MI.
52 ;; 52
53 ;; This mode SHOULD WORK WITH GDB 5.0 ONWARDS but you will NEED GDB 6.0 53 ;; This mode SHOULD WORK WITH GDB 5.0 onwards but you will NEED GDB 6.0
54 ;; ONWARDS TO USE WATCH EXPRESSIONS. 54 ;; onwards to use watch expressions.
55 ;; 55
56 ;; Windows Platforms: 56 ;;; Windows Platforms:
57 ;; 57
58 ;; If you are using Emacs and GDB on Windows you will need to flush the buffer 58 ;; If you are using Emacs and GDB on Windows you will need to flush the buffer
59 ;; explicitly in your program if you want timely display of I/O in Emacs. 59 ;; explicitly in your program if you want timely display of I/O in Emacs.
60 ;; Alternatively you can make the output stream unbuffered, for example, by 60 ;; Alternatively you can make the output stream unbuffered, for example, by
61 ;; using a macro: 61 ;; using a macro:
62 ;; 62
63 ;; #ifdef UNBUFFERED 63 ;; #ifdef UNBUFFERED
64 ;; setvbuf (stdout, (char *) NULL, _IONBF, 0); 64 ;; setvbuf (stdout, (char *) NULL, _IONBF, 0);
65 ;; #endif 65 ;; #endif
66 ;; 66
67 ;; and compiling with -DUNBUFFERED while debugging. 67 ;; and compiling with -DUNBUFFERED while debugging.
68 ;; 68
69 ;; Known Bugs: 69 ;;; Known Bugs:
70
70 ;; 1) Strings that are watched don't update in the speedbar when their 71 ;; 1) Strings that are watched don't update in the speedbar when their
71 ;; contents change. 72 ;; contents change.
72 ;; 2) Watch expressions go out of scope when the inferior is re-run. 73 ;; 2) Watch expressions go out of scope when the inferior is re-run.
73 ;; 74 ;; 3) Cannot handle multiple debug sessions.
74 ;; TODO: 75
76 ;;; TODO:
77
75 ;; 1) Use MI command -data-read-memory for memory window. 78 ;; 1) Use MI command -data-read-memory for memory window.
76 ;; 2) Highlight changed register values (use MI commands 79 ;; 2) Highlight changed register values (use MI commands
77 ;; -data-list-register-values and -data-list-changed-registers instead 80 ;; -data-list-register-values and -data-list-changed-registers instead
78 ;; of 'info registers'. 81 ;; of 'info registers'.
79 ;; 3) Use tree-widget.el instead of the speedbar for watch-expressions? 82 ;; 3) Use tree-widget.el instead of the speedbar for watch-expressions?
397 (define-key gud-minor-mode-map [left-fringe mouse-1] 400 (define-key gud-minor-mode-map [left-fringe mouse-1]
398 'gdb-mouse-set-clear-breakpoint) 401 'gdb-mouse-set-clear-breakpoint)
399 (define-key gud-minor-mode-map [left-fringe mouse-2] 402 (define-key gud-minor-mode-map [left-fringe mouse-2]
400 'gdb-mouse-until) 403 'gdb-mouse-until)
401 (define-key gud-minor-mode-map [left-fringe drag-mouse-1] 404 (define-key gud-minor-mode-map [left-fringe drag-mouse-1]
405 'gdb-mouse-until)
406 (define-key gud-minor-mode-map [left-margin mouse-2]
402 'gdb-mouse-until) 407 'gdb-mouse-until)
403 (define-key gud-minor-mode-map [left-margin mouse-3] 408 (define-key gud-minor-mode-map [left-margin mouse-3]
404 'gdb-mouse-toggle-breakpoint-margin) 409 'gdb-mouse-toggle-breakpoint-margin)
405 (define-key gud-minor-mode-map [left-fringe mouse-3] 410 (define-key gud-minor-mode-map [left-fringe mouse-3]
406 'gdb-mouse-toggle-breakpoint-fringe) 411 'gdb-mouse-toggle-breakpoint-fringe)
1565 (define-key menu [delete] '("Delete" . gdb-delete-breakpoint)) 1570 (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
1566 (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint)) 1571 (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint))
1567 (suppress-keymap map) 1572 (suppress-keymap map)
1568 (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu)) 1573 (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu))
1569 (define-key map " " 'gdb-toggle-breakpoint) 1574 (define-key map " " 'gdb-toggle-breakpoint)
1570 (define-key map "d" 'gdb-delete-breakpoint) 1575 (define-key map "D" 'gdb-delete-breakpoint)
1571 (define-key map "q" 'kill-this-buffer) 1576 (define-key map "q" 'kill-this-buffer)
1572 (define-key map "\r" 'gdb-goto-breakpoint) 1577 (define-key map "\r" 'gdb-goto-breakpoint)
1573 (define-key map [mouse-2] 'gdb-goto-breakpoint) 1578 (define-key map [mouse-2] 'gdb-goto-breakpoint)
1574 (define-key map [follow-link] 'mouse-face) 1579 (define-key map [follow-link] 'mouse-face)
1575 map)) 1580 map))
1738 'gdbmi-invalidate-frames)) 1743 'gdbmi-invalidate-frames))
1739 1744
1740 (defun gdb-get-frame-number () 1745 (defun gdb-get-frame-number ()
1741 (save-excursion 1746 (save-excursion
1742 (end-of-line) 1747 (end-of-line)
1743 (let* ((pos (re-search-backward "^#*\\([0-9]*\\)" nil t)) 1748 (let* ((start (line-beginning-position))
1749 (pos (re-search-backward "^#*\\([0-9]+\\)" start t))
1744 (n (or (and pos (match-string-no-properties 1)) "0"))) 1750 (n (or (and pos (match-string-no-properties 1)) "0")))
1745 n))) 1751 n)))
1746 1752
1747 (defun gdb-frames-select (&optional event) 1753 (defun gdb-frames-select (&optional event)
1748 "Select the frame and display the relevant source." 1754 "Select the frame and display the relevant source."
1798 (let ((map (make-sparse-keymap))) 1804 (let ((map (make-sparse-keymap)))
1799 (suppress-keymap map) 1805 (suppress-keymap map)
1800 (define-key map "q" 'kill-this-buffer) 1806 (define-key map "q" 'kill-this-buffer)
1801 (define-key map "\r" 'gdb-threads-select) 1807 (define-key map "\r" 'gdb-threads-select)
1802 (define-key map [mouse-2] 'gdb-threads-select) 1808 (define-key map [mouse-2] 'gdb-threads-select)
1809 (define-key map [follow-link] 'mouse-face)
1803 map)) 1810 map))
1804 1811
1805 (defvar gdb-threads-font-lock-keywords 1812 (defvar gdb-threads-font-lock-keywords
1806 '( 1813 '(
1807 (") +\\([^ ]+\\) (" (1 font-lock-function-name-face)) 1814 (") +\\([^ ]+\\) (" (1 font-lock-function-name-face))