aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-10-29 22:38:04 +0000
committerStefan Monnier2004-10-29 22:38:04 +0000
commitd94dccc60884d8c2b5bed7edbb75da1377acb3a4 (patch)
treedb4ed4afba11480fb236b05aa5083a3b13779405
parent6f4e005dd9f8e02e88a0354a41e999f20d6c365f (diff)
downloademacs-d94dccc60884d8c2b5bed7edbb75da1377acb3a4.tar.gz
emacs-d94dccc60884d8c2b5bed7edbb75da1377acb3a4.zip
Docstring fixes.
-rw-r--r--lisp/progmodes/gdb-ui.el128
1 files changed, 65 insertions, 63 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 64f8808c7f1..1486ec7e5cf 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -25,28 +25,28 @@
25 25
26;;; Commentary: 26;;; Commentary:
27 27
28;; This mode acts as a graphical user interface to GDB. You can interact with 28;; This mode acts as a graphical user interface to GDB. You can interact with
29;; GDB through the GUD buffer in the usual way, but there are also further 29;; GDB through the GUD buffer in the usual way, but there are also further
30;; buffers which control the execution and describe the state of your program. 30;; buffers which control the execution and describe the state of your program.
31;; It separates the input/output of your program from that of GDB, if 31;; It separates the input/output of your program from that of GDB, if
32;; required, and watches expressions in the speedbar. It also uses features of 32;; required, and watches expressions in the speedbar. It also uses features of
33;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar 33;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar
34;; (see the GDB Graphical Interface section in the Emacs info manual). 34;; (see the GDB Graphical Interface section in the Emacs info manual).
35 35
36;; Start the debugger with M-x gdba. 36;; Start the debugger with M-x gdba.
37 37
38;; This file has evolved from gdba.el from GDB 5.0 written by Tom Lord and Jim 38;; This file has evolved from gdba.el from GDB 5.0 written by Tom Lord and Jim
39;; Kingdon and uses GDB's annotation interface. You don't need to know about 39;; Kingdon and uses GDB's annotation interface. You don't need to know about
40;; annotations to use this mode as a debugger, but if you are interested 40;; annotations to use this mode as a debugger, but if you are interested
41;; developing the mode itself, then see the Annotations section in the GDB 41;; developing the mode itself, then see the Annotations section in the GDB
42;; info manual. 42;; info manual.
43;; 43;;
44;; GDB developers plan to make the annotation interface obsolete. A new 44;; GDB developers plan to make the annotation interface obsolete. A new
45;; interface called GDB/MI (machine interface) has been designed to replace 45;; interface called GDB/MI (machine interface) has been designed to replace
46;; it. Some GDB/MI commands are used in this file through the CLI command 46;; it. Some GDB/MI commands are used in this file through the CLI command
47;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included in the 47;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included in the
48;; GDB repository for future releases (6.2 onwards) that uses GDB/MI as the 48;; GDB repository for future releases (6.2 onwards) that uses GDB/MI as the
49;; primary interface to GDB. It is still under development and is part of a 49;; primary interface to GDB. It is still under development and is part of a
50;; process to migrate Emacs from annotations to GDB/MI. 50;; process to migrate Emacs from annotations to GDB/MI.
51;; 51;;
52;; Known Bugs: 52;; Known Bugs:
@@ -63,7 +63,7 @@
63(defvar gdb-current-language nil) 63(defvar gdb-current-language nil)
64(defvar gdb-view-source t "Non-nil means that source code can be viewed.") 64(defvar gdb-view-source t "Non-nil means that source code can be viewed.")
65(defvar gdb-selected-view 'source "Code type that user wishes to view.") 65(defvar gdb-selected-view 'source "Code type that user wishes to view.")
66(defvar gdb-var-list nil "List of variables in watch window") 66(defvar gdb-var-list nil "List of variables in watch window.")
67(defvar gdb-var-changed nil "Non-nil means that gdb-var-list has changed.") 67(defvar gdb-var-changed nil "Non-nil means that gdb-var-list has changed.")
68(defvar gdb-buffer-type nil) 68(defvar gdb-buffer-type nil)
69(defvar gdb-overlay-arrow-position nil) 69(defvar gdb-overlay-arrow-position nil)
@@ -85,12 +85,12 @@ other with the source file with the main routine of the inferior.
85If `gdb-many-windows' is t, regardless of the value of 85If `gdb-many-windows' is t, regardless of the value of
86`gdb-show-main', the layout below will appear unless 86`gdb-show-main', the layout below will appear unless
87`gdb-use-inferior-io-buffer' is nil when the source buffer 87`gdb-use-inferior-io-buffer' is nil when the source buffer
88occupies the full width of the frame. Keybindings are given in 88occupies the full width of the frame. Keybindings are given in
89relevant buffer. 89relevant buffer.
90 90
91Watch expressions appear in the speedbar/slowbar. 91Watch expressions appear in the speedbar/slowbar.
92 92
93The following interactive lisp functions help control operation : 93The following commands help control operation :
94 94
95`gdb-many-windows' - Toggle the number of windows gdb uses. 95`gdb-many-windows' - Toggle the number of windows gdb uses.
96`gdb-restore-windows' - To restore the window layout. 96`gdb-restore-windows' - To restore the window layout.
@@ -120,8 +120,7 @@ detailed description of this mode.
120 RET gdb-frames-select | SPC gdb-toggle-breakpoint 120 RET gdb-frames-select | SPC gdb-toggle-breakpoint
121 | RET gdb-goto-breakpoint 121 | RET gdb-goto-breakpoint
122 | d gdb-delete-breakpoint 122 | d gdb-delete-breakpoint
123--------------------------------------------------------------------- 123---------------------------------------------------------------------"
124"
125 ;; 124 ;;
126 (interactive (list (gud-query-cmdline 'gdba))) 125 (interactive (list (gud-query-cmdline 'gdba)))
127 ;; 126 ;;
@@ -210,8 +209,7 @@ detailed description of this mode.
210 (run-hooks 'gdba-mode-hook)) 209 (run-hooks 'gdba-mode-hook))
211 210
212(defcustom gdb-use-colon-colon-notation nil 211(defcustom gdb-use-colon-colon-notation nil
213 "Non-nil means use FUNCTION::VARIABLE format to display variables in the 212 "If non-nil use FUN::VAR format to display variables in the speedbar." ;
214speedbar."
215 :type 'boolean 213 :type 'boolean
216 :group 'gud) 214 :group 'gud)
217 215
@@ -376,7 +374,7 @@ speedbar."
376 (setq gdb-var-changed t)))))) 374 (setq gdb-var-changed t))))))
377 375
378(defun gdb-edit-value (text token indent) 376(defun gdb-edit-value (text token indent)
379 "Assign a value to a variable displayed in the speedbar" 377 "Assign a value to a variable displayed in the speedbar."
380 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) 378 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
381 (varnum (cadr var)) (value)) 379 (varnum (cadr var)) (value))
382 (setq value (read-string "New value: ")) 380 (setq value (read-string "New value: "))
@@ -389,8 +387,8 @@ speedbar."
389 'ignore)))) 387 'ignore))))
390 388
391(defcustom gdb-show-changed-values t 389(defcustom gdb-show-changed-values t
392 "Non-nil means use font-lock-warning-face to display values that have 390 "If non-nil highlight values that have recently changed in the speedbar.
393recently changed in the speedbar." 391The highlighting is done with `font-lock-warning-face'."
394 :type 'boolean 392 :type 'boolean
395 :group 'gud) 393 :group 'gud)
396 394
@@ -422,23 +420,23 @@ INDENT is the current indentation depth."
422 "The disposition of the output of the current gdb command. 420 "The disposition of the output of the current gdb command.
423Possible values are these symbols: 421Possible values are these symbols:
424 422
425 user -- gdb output should be copied to the GUD buffer 423 `user' -- gdb output should be copied to the GUD buffer
426 for the user to see. 424 for the user to see.
427 425
428 inferior -- gdb output should be copied to the inferior-io buffer 426 `inferior' -- gdb output should be copied to the inferior-io buffer
429 427
430 pre-emacs -- output should be ignored util the post-prompt 428 `pre-emacs' -- output should be ignored util the post-prompt
431 annotation is received. Then the output-sink 429 annotation is received. Then the output-sink
432 becomes:... 430 becomes:...
433 emacs -- output should be collected in the partial-output-buffer 431 `emacs' -- output should be collected in the partial-output-buffer
434 for subsequent processing by a command. This is the 432 for subsequent processing by a command. This is the
435 disposition of output generated by commands that 433 disposition of output generated by commands that
436 gdb mode sends to gdb on its own behalf. 434 gdb mode sends to gdb on its own behalf.
437 post-emacs -- ignore output until the prompt annotation is 435 `post-emacs' -- ignore output until the prompt annotation is
438 received, then go to USER disposition. 436 received, then go to USER disposition.
439 437
440gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two 438gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two
441(user and emacs).") 439\(`user' and `emacs').")
442 440
443(defvar gdb-current-item nil 441(defvar gdb-current-item nil
444 "The most recent command item sent to gdb.") 442 "The most recent command item sent to gdb.")
@@ -619,7 +617,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
619 617
620(defun gdb-send (proc string) 618(defun gdb-send (proc string)
621 "A comint send filter for gdb. 619 "A comint send filter for gdb.
622This filter may simply queue output for a later time." 620This filter may simply queue input for a later time."
623 (if gud-running 621 (if gud-running
624 (process-send-string proc (concat string "\n")) 622 (process-send-string proc (concat string "\n"))
625 (gdb-enqueue-input (concat string "\n")))) 623 (gdb-enqueue-input (concat string "\n"))))
@@ -705,25 +703,25 @@ This filter may simply queue output for a later time."
705 (setq gdb-current-item item) 703 (setq gdb-current-item item)
706 (with-current-buffer gud-comint-buffer 704 (with-current-buffer gud-comint-buffer
707 (if (eq gud-minor-mode 'gdba) 705 (if (eq gud-minor-mode 'gdba)
708 (progn 706 (if (stringp item)
709 (if (stringp item)
710 (progn
711 (setq gdb-output-sink 'user)
712 (process-send-string (get-buffer-process gud-comint-buffer) item))
713 (progn 707 (progn
714 (gdb-clear-partial-output) 708 (setq gdb-output-sink 'user)
715 (setq gdb-output-sink 'pre-emacs) 709 (process-send-string (get-buffer-process gud-comint-buffer) item))
716 (process-send-string (get-buffer-process gud-comint-buffer) 710 (progn
717 (car item))))) 711 (gdb-clear-partial-output)
718 ; case: eq gud-minor-mode 'gdbmi 712 (setq gdb-output-sink 'pre-emacs)
713 (process-send-string (get-buffer-process gud-comint-buffer)
714 (car item))))
715 ;; case: eq gud-minor-mode 'gdbmi
719 (gdb-clear-partial-output) 716 (gdb-clear-partial-output)
720 (setq gdb-output-sink 'emacs) 717 (setq gdb-output-sink 'emacs)
721 (process-send-string (get-buffer-process gud-comint-buffer) 718 (process-send-string (get-buffer-process gud-comint-buffer)
722 (car item))))) 719 (car item)))))
723 720
724(defun gdb-pre-prompt (ignored) 721(defun gdb-pre-prompt (ignored)
725 "An annotation handler for `pre-prompt'. This terminates the collection of 722 "An annotation handler for `pre-prompt'.
726output from a previous command if that happens to be in effect." 723This terminates the collection of output from a previous command if that
724happens to be in effect."
727 (let ((sink gdb-output-sink)) 725 (let ((sink gdb-output-sink))
728 (cond 726 (cond
729 ((eq sink 'user) t) 727 ((eq sink 'user) t)
@@ -761,8 +759,9 @@ This sends the next command (if any) to gdb."
761 (setq gdb-prompting t)) 759 (setq gdb-prompting t))
762 760
763(defun gdb-starting (ignored) 761(defun gdb-starting (ignored)
764 "An annotation handler for `starting'. This says that I/O for the 762 "An annotation handler for `starting'.
765subprocess is now the program being debugged, not GDB." 763This says that I/O for the subprocess is now the program being debugged,
764not GDB."
766 (let ((sink gdb-output-sink)) 765 (let ((sink gdb-output-sink))
767 (cond 766 (cond
768 ((eq sink 'user) 767 ((eq sink 'user)
@@ -773,8 +772,9 @@ subprocess is now the program being debugged, not GDB."
773 (t (error "Unexpected `starting' annotation"))))) 772 (t (error "Unexpected `starting' annotation")))))
774 773
775(defun gdb-stopping (ignored) 774(defun gdb-stopping (ignored)
776 "An annotation handler for `exited' and other annotations which say that I/O 775 "An annotation handler for `exited' and other annotations.
777for the subprocess is now GDB, not the program being debugged." 776They say that I/O for the subprocess is now GDB, not the program
777being debugged."
778 (if gdb-use-inferior-io-buffer 778 (if gdb-use-inferior-io-buffer
779 (let ((sink gdb-output-sink)) 779 (let ((sink gdb-output-sink))
780 (cond 780 (cond
@@ -792,8 +792,9 @@ for the subprocess is now GDB, not the program being debugged."
792 (t (error "Unexpected frame-begin annotation (%S)" sink))))) 792 (t (error "Unexpected frame-begin annotation (%S)" sink)))))
793 793
794(defun gdb-stopped (ignored) 794(defun gdb-stopped (ignored)
795 "An annotation handler for `stopped'. It is just like gdb-stopping, except 795 "An annotation handler for `stopped'.
796that if we already set the output sink to 'user in gdb-stopping, that is fine." 796It is just like `gdb-stopping', except that if we already set the output
797sink to `user' in `gdb-stopping', that is fine."
797 (setq gud-running nil) 798 (setq gud-running nil)
798 (let ((sink gdb-output-sink)) 799 (let ((sink gdb-output-sink))
799 (cond 800 (cond
@@ -803,8 +804,9 @@ that if we already set the output sink to 'user in gdb-stopping, that is fine."
803 (t (error "Unexpected stopped annotation"))))) 804 (t (error "Unexpected stopped annotation")))))
804 805
805(defun gdb-post-prompt (ignored) 806(defun gdb-post-prompt (ignored)
806 "An annotation handler for `post-prompt'. This begins the collection of 807 "An annotation handler for `post-prompt'.
807output from the current command if that happens to be appropriate." 808This begins the collection of output from the current command if that
809happens to be appropriate."
808 (if (not gdb-pending-triggers) 810 (if (not gdb-pending-triggers)
809 (progn 811 (progn
810 (gdb-get-current-frame) 812 (gdb-get-current-frame)
@@ -832,7 +834,7 @@ output from the current command if that happens to be appropriate."
832 (error "Phase error in gdb-post-prompt (got %s)" sink))))) 834 (error "Phase error in gdb-post-prompt (got %s)" sink)))))
833 835
834(defun gud-gdba-marker-filter (string) 836(defun gud-gdba-marker-filter (string)
835 "A gud marker filter for gdb. Handle a burst of output from GDB." 837 "A gud marker filter for gdb. Handle a burst of output from GDB."
836 (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log)) 838 (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log))
837 ;; Recall the left over gud-marker-acc from last time 839 ;; Recall the left over gud-marker-acc from last time
838 (setq gud-marker-acc (concat gud-marker-acc string)) 840 (setq gud-marker-acc (concat gud-marker-acc string))
@@ -1065,10 +1067,10 @@ static char *magick[] = {
1065 "PBM data used for disabled breakpoint icon.") 1067 "PBM data used for disabled breakpoint icon.")
1066 1068
1067(defvar breakpoint-enabled-icon nil 1069(defvar breakpoint-enabled-icon nil
1068 "Icon for enabled breakpoint in display margin") 1070 "Icon for enabled breakpoint in display margin.")
1069 1071
1070(defvar breakpoint-disabled-icon nil 1072(defvar breakpoint-disabled-icon nil
1071 "Icon for disabled breakpoint in display margin") 1073 "Icon for disabled breakpoint in display margin.")
1072 1074
1073;; Bitmap for breakpoint in fringe 1075;; Bitmap for breakpoint in fringe
1074(define-fringe-bitmap 'breakpoint 1076(define-fringe-bitmap 'breakpoint
@@ -1133,7 +1135,7 @@ static char *magick[] = {
1133 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) 1135 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom)))
1134 1136
1135(defun gdb-mouse-toggle-breakpoint (event) 1137(defun gdb-mouse-toggle-breakpoint (event)
1136 "Toggle breakpoint in left fringe/margin with mouse click" 1138 "Toggle breakpoint in left fringe/margin with mouse click."
1137 (interactive "e") 1139 (interactive "e")
1138 (mouse-minibuffer-check event) 1140 (mouse-minibuffer-check event)
1139 (let ((posn (event-end event))) 1141 (let ((posn (event-end event)))
@@ -1718,11 +1720,11 @@ static char *magick[] = {
1718 (other-window 1)) 1720 (other-window 1))
1719 1721
1720(defcustom gdb-many-windows nil 1722(defcustom gdb-many-windows nil
1721 "Nil (the default value) means just pop up the GUD buffer 1723 "Nil means just pop up the GUD buffer unless `gdb-show-main' is t.
1722unless `gdb-show-main' is t. In this case it starts with two 1724In this case it starts with two windows: one displaying the GUD
1723windows: one displaying the GUD buffer and the other with the 1725buffer and the other with the source file with the main routine
1724source file with the main routine of the inferior. Non-nil means 1726of the inferior. Non-nil means display the layout shown for
1725display the layout shown for `gdba'." 1727`gdba'."
1726 :type 'boolean 1728 :type 'boolean
1727 :group 'gud) 1729 :group 'gud)
1728 1730
@@ -1760,8 +1762,8 @@ This arrangement depends on the value of `gdb-many-windows'."
1760 (other-window 1))) 1762 (other-window 1)))
1761 1763
1762(defun gdb-reset () 1764(defun gdb-reset ()
1763 "Exit a debugging session cleanly by killing the gdb buffers and resetting 1765 "Exit a debugging session cleanly.
1764 the source buffers." 1766Kills the gdb buffers and resets the source buffers."
1765 (dolist (buffer (buffer-list)) 1767 (dolist (buffer (buffer-list))
1766 (unless (eq buffer gud-comint-buffer) 1768 (unless (eq buffer gud-comint-buffer)
1767 (with-current-buffer buffer 1769 (with-current-buffer buffer