aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-06-07 19:37:18 +0000
committerRichard M. Stallman1993-06-07 19:37:18 +0000
commitdcec1a3b1910fed638ee7521205bcdd757eb6cb7 (patch)
tree22ad2769fd381462daf824a3295e271ea5bc6fb0
parent4536d48457b2e2c448eead9ade2b2694f1bcf2c1 (diff)
downloademacs-dcec1a3b1910fed638ee7521205bcdd757eb6cb7.tar.gz
emacs-dcec1a3b1910fed638ee7521205bcdd757eb6cb7.zip
Doc fixes. Delete local variable list at the end.
(expr-forward-sexp): Renamed from forw-expr. (expr-backward-sexp): Renamed from back-expr.
-rw-r--r--lisp/gud.el84
1 files changed, 29 insertions, 55 deletions
diff --git a/lisp/gud.el b/lisp/gud.el
index 7be667ba8ba..dc1a5337186 100644
--- a/lisp/gud.el
+++ b/lisp/gud.el
@@ -362,8 +362,8 @@ and source-file directory for your debugger."
362 "Major mode for interacting with an inferior debugger process. 362 "Major mode for interacting with an inferior debugger process.
363 363
364 You start it up with one of the commands M-x gdb, M-x sdb, or 364 You start it up with one of the commands M-x gdb, M-x sdb, or
365M-x dbx. Each entry point finishes by executing a hook; gdb-mode-hook, 365M-x dbx. Each entry point finishes by executing a hook; `gdb-mode-hook',
366sdb-mode-hook or dbx-mode-hook respectively. 366`sdb-mode-hook' or `dbx-mode-hook' respectively.
367 367
368After startup, the following commands are available in both the GUD 368After startup, the following commands are available in both the GUD
369interaction buffer and any source buffer GUD visits due to a breakpoint stop 369interaction buffer and any source buffer GUD visits due to a breakpoint stop
@@ -398,14 +398,14 @@ frame. \\[gud-down] drops back down through one.
398If you are using gdb, \\[gdb-finish] runs execution to the return from 398If you are using gdb, \\[gdb-finish] runs execution to the return from
399the current function and stops. 399the current function and stops.
400 400
401All the keystrokes above have synonyms (in the GUD buffer only) with 401All the keystrokes above are accessible in the GUD buffer
402a prefix of C-c (this is for backward compatibility with old gdb.el). 402with the prefix C-c, and in all buffers through the prefix C-x C-a.
403 403
404All pre-defined functions for which the concept make sense repeat 404All pre-defined functions for which the concept make sense repeat
405themselves the appropriate number of times if you give a prefix 405themselves the appropriate number of times if you give a prefix
406argument. 406argument.
407 407
408You may use the gud-def macro in the initialization hook to define other 408You may use the `gud-def' macro in the initialization hook to define other
409commands. 409commands.
410 410
411Other commands for interacting with the debugger process are inherited from 411Other commands for interacting with the debugger process are inherited from
@@ -666,14 +666,13 @@ Obeying it means displaying in another window the specified file and line."
666 (interactive "P") 666 (interactive "P")
667 (recenter arg) 667 (recenter arg)
668 (gud-display-frame)) 668 (gud-display-frame))
669 669
670;;; Code for parsing expressions out of C code. The single entry point is 670;;; Code for parsing expressions out of C code. The single entry point is
671;;; find-c-expr, which tries to return an lvalue expression from around point. 671;;; find-c-expr, which tries to return an lvalue expression from around point.
672;;; 672;;;
673;;; The rest of this file is a hacked version of gdbsrc.el by 673;;; The rest of this file is a hacked version of gdbsrc.el by
674;;; Debby Ayers <ayers@asc.slb.com>, 674;;; Debby Ayers <ayers@asc.slb.com>,
675;;; Rich Schaefer <schaefer@asc.slb.com> Schlumberger, Austin, Tx. 675;;; Rich Schaefer <schaefer@asc.slb.com> Schlumberger, Austin, Tx.
676;;; ??? We're waiting on papers from these people
677 676
678(defun find-c-expr () 677(defun find-c-expr ()
679 "Returns the C expr that surrounds point." 678 "Returns the C expr that surrounds point."
@@ -686,50 +685,44 @@ Obeying it means displaying in another window the specified file and line."
686 (while (expr-compound test-expr expr) 685 (while (expr-compound test-expr expr)
687 (setq expr (cons (car test-expr) (cdr expr))) 686 (setq expr (cons (car test-expr) (cdr expr)))
688 (goto-char (car expr)) 687 (goto-char (car expr))
689 (setq test-expr (expr-prev)) 688 (setq test-expr (expr-prev)))
690 )
691 (goto-char p) 689 (goto-char p)
692 (setq test-expr (expr-next)) 690 (setq test-expr (expr-next))
693 (while (expr-compound expr test-expr) 691 (while (expr-compound expr test-expr)
694 (setq expr (cons (car expr) (cdr test-expr))) 692 (setq expr (cons (car expr) (cdr test-expr)))
695 (setq test-expr (expr-next)) 693 (setq test-expr (expr-next))
696 ) 694 )
697 (buffer-substring (car expr) (cdr expr)) 695 (buffer-substring (car expr) (cdr expr)))))
698 )
699 )
700 )
701 696
702(defun expr-cur () 697(defun expr-cur ()
703 "Returns the expr that point is in; point is set to beginning of expr. 698 "Returns the expr that point is in; point is set to beginning of expr.
704The expr is represented as a cons cell, where the car specifies the point in 699The expr is represented as a cons cell, where the car specifies the point in
705the current buffer that marks the beginning of the expr and the cdr specifies 700the current buffer that marks the beginning of the expr and the cdr specifies
706the character after the end of the expr" 701the character after the end of the expr."
707 (let ((p (point)) (begin) (end)) 702 (let ((p (point)) (begin) (end))
708 (back-expr) 703 (expr-backward-sexp)
709 (setq begin (point)) 704 (setq begin (point))
710 (forw-expr) 705 (expr-forward-sexp)
711 (setq end (point)) 706 (setq end (point))
712 (if (>= p end) 707 (if (>= p end)
713 (progn 708 (progn
714 (setq begin p) 709 (setq begin p)
715 (goto-char p) 710 (goto-char p)
716 (forw-expr) 711 (expr-forward-sexp)
717 (setq end (point)) 712 (setq end (point))
718 ) 713 )
719 ) 714 )
720 (goto-char begin) 715 (goto-char begin)
721 (cons begin end) 716 (cons begin end)))
722 )
723 )
724 717
725(defun back-expr () 718(defun expr-backward-sexp ()
726 "Version of backward-sexp that catches errors" 719 "Version of `backward-sexp' that catches errors."
727 (condition-case nil 720 (condition-case nil
728 (backward-sexp) 721 (backward-sexp)
729 (error t))) 722 (error t)))
730 723
731(defun forw-expr () 724(defun expr-forward-sexp ()
732 "Version of forward-sexp that catches errors" 725 "Version of `forward-sexp' that catches errors."
733 (condition-case nil 726 (condition-case nil
734 (forward-sexp) 727 (forward-sexp)
735 (error t))) 728 (error t)))
@@ -740,9 +733,9 @@ The expr is represented as a cons cell, where the car specifies the point in
740the current buffer that marks the beginning of the expr and the cdr specifies 733the current buffer that marks the beginning of the expr and the cdr specifies
741the character after the end of the expr" 734the character after the end of the expr"
742 (let ((begin) (end)) 735 (let ((begin) (end))
743 (back-expr) 736 (expr-backward-sexp)
744 (setq begin (point)) 737 (setq begin (point))
745 (forw-expr) 738 (expr-forward-sexp)
746 (setq end (point)) 739 (setq end (point))
747 (goto-char begin) 740 (goto-char begin)
748 (cons begin end))) 741 (cons begin end)))
@@ -751,16 +744,14 @@ the character after the end of the expr"
751 "Returns the following expr, point is set to beginning of that expr. 744 "Returns the following expr, point is set to beginning of that expr.
752The expr is represented as a cons cell, where the car specifies the point in 745The expr is represented as a cons cell, where the car specifies the point in
753the current buffer that marks the beginning of the expr and the cdr specifies 746the current buffer that marks the beginning of the expr and the cdr specifies
754the character after the end of the expr" 747the character after the end of the expr."
755 (let ((begin) (end)) 748 (let ((begin) (end))
756 (forw-expr) 749 (expr-forward-sexp)
757 (forw-expr) 750 (expr-forward-sexp)
758 (setq end (point)) 751 (setq end (point))
759 (back-expr) 752 (expr-backward-sexp)
760 (setq begin (point)) 753 (setq begin (point))
761 (cons begin end) 754 (cons begin end)))
762 )
763 )
764 755
765(defun expr-compound-sep (span-start span-end) 756(defun expr-compound-sep (span-start span-end)
766 "Returns '.' for '->' & '.', returns ' ' for white space, 757 "Returns '.' for '->' & '.', returns ' ' for white space,
@@ -780,15 +771,13 @@ returns '?' for other puctuation."
780 (t (setq span-start span-end) 771 (t (setq span-start span-end)
781 (setq result ??))))) 772 (setq result ??)))))
782 (setq span-start (+ span-start 1))) 773 (setq span-start (+ span-start 1)))
783 result 774 result))
784 )
785 )
786 775
787(defun expr-compound (first second) 776(defun expr-compound (first second)
788 "Returns non-nil if the concatenation of two exprs results in a single C 777 "Non-nil if concatenating FIRST and SECOND makes a single C token.
789token. The two exprs are represented as a cons cells, where the car 778The two exprs are represented as a cons cells, where the car
790specifies the point in the current buffer that marks the beginning of the 779specifies the point in the current buffer that marks the beginning of the
791expr and the cdr specifies the character after the end of the expr 780expr and the cdr specifies the character after the end of the expr.
792Link exprs of the form: 781Link exprs of the form:
793 Expr -> Expr 782 Expr -> Expr
794 Expr . Expr 783 Expr . Expr
@@ -814,21 +803,6 @@ Link exprs of the form:
814 ((= span-end ?[ ) t ) 803 ((= span-end ?[ ) t )
815 (t nil)) 804 (t nil))
816 ) 805 )
817 (t nil)) 806 (t nil))))
818 )
819 )
820
821;;; There appears to be a bug in the byte compiler somewhere near macro
822;;; handling that (a) generates a spurious message about gud-key-prefix
823;;; when the global-set-key clause in gud-def is compiled, (b) generates
824;;; incorrect bytecode for gud-def. The symptom of this incorrectness
825;;; is that loading gud.elc brings in a compiled gud-def that doesn't
826;;; properly perform both global (C-x C-a) and local (C-c) bindings.
827;;; The workaround is to always load from source. Consequently, we try
828;;; to disable byte-compilation here.
829;;;
830;;; Local Variables:
831;;; no-byte-compile: t
832;;; End:
833 807
834;;; gud.el ends here 808;;; gud.el ends here