comparison lisp/gud.el @ 2532:17a6b6d079cf

(gud-mode): Created C-c synonym bindings in the GUD buffer's local map. (gud-key-prefix): Changed to C-x C-a.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Wed, 14 Apr 1993 16:41:51 +0000
parents d567a93d9408
children 839d67a1dc58
comparison
equal deleted inserted replaced
2531:fd182baaa0a3 2532:17a6b6d079cf
1 ;;; gud.el --- Grand Unified Debugger mode for gdb, sdb, or dbx under Emacs 1 ;;; gud.el --- Grand Unified Debugger mode for gdb, sdb, or dbx under Emacs
2 2
3 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> 3 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
4 ;; Version: 1.1 4 ;; Version: 1.2
5 ;; Keywords: unix, tools 5 ;; Keywords: unix, tools
6 6
7 ;; Copyright (C) 1992 Free Software Foundation, Inc. 7 ;; Copyright (C) 1992 Free Software Foundation, Inc.
8 8
9 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
31 ;; who also hacked the mode to use comint.el. 31 ;; who also hacked the mode to use comint.el.
32 32
33 ;; This code will not work under Emacs 18. It relies on Emacs 19's 33 ;; This code will not work under Emacs 18. It relies on Emacs 19's
34 ;; minor-mode-keymap support and the find-tag-noselect entry point of etags. 34 ;; minor-mode-keymap support and the find-tag-noselect entry point of etags.
35 35
36 ;;; Change Log:
37
38 ;; Version 1.1: ESR 6 Apr 1993
39 ;; * Facility to accept and parse command-line switches other than the
40 ;; filename added.
41 ;; * System V Release 4 support added.
42 ;; * Can now set temporary breakpoints in sdb.
43 ;; * A GUD minor mode using the 19 minor-mode-keymap facilities is now
44 ;; enabled in visited C buffers.
45 ;; * Command bindings are now automatically the same in gud-minor-mode
46 ;; as they are in the GUD buffer itself, and use ^XX as a common
47 ;; prefix (for compatibility with electric-debug).
48 ;; * There is a new command for printing the C expression around point.
49
50 ;; Version 1.0: ESR
51 ;; * Created.
52
53 ;;; Code: 36 ;;; Code:
54 37
55 (require 'comint) 38 (require 'comint)
56 (require 'etags) 39 (require 'etags)
57 40
58 ;; ====================================================================== 41 ;; ======================================================================
59 ;; minor-mode machinery for C buffers visited by GUD 42 ;; minor-mode machinery for C buffers visited by GUD
60 43
61 (defvar gud-key-prefix "\C-xX" 44 (defvar gud-key-prefix "\C-x\C-a"
62 "Prefix of all GUD minor-mode commands valid in C buffers.") 45 "Prefix of all GUD minor-mode commands valid in C buffers.")
63 46
64 (defvar gud-minor-mode nil) 47 (defvar gud-minor-mode nil)
65 (or (assq 'gud-minor-mode minor-mode-alist) 48 (or (assq 'gud-minor-mode minor-mode-alist)
66 (setq minor-mode-alist 49 (setq minor-mode-alist
419 402
420 \\[gud-break] sets a breakpoint at the current file and line. In the 403 \\[gud-break] sets a breakpoint at the current file and line. In the
421 GUD buffer, the current file and line are those of the last breakpoint or 404 GUD buffer, the current file and line are those of the last breakpoint or
422 step. In a source buffer, they are the buffer's file and current line. 405 step. In a source buffer, they are the buffer's file and current line.
423 406
407 \\[gud-remove] removes breakpoints on the current file and line.
408
424 \\[gud-refresh] displays in the source window the last line referred to 409 \\[gud-refresh] displays in the source window the last line referred to
425 in the gud buffer. 410 in the gud buffer.
426 411
427 \\[gud-step], \\[gud-next], and \\[gud-stepi] do a step-one-line, 412 \\[gud-step], \\[gud-next], and \\[gud-stepi] do a step-one-line,
428 step-one-line (not entering function calls), and step-one-instruction 413 step-one-line (not entering function calls), and step-one-instruction
441 Under gdb and dbx, \\[gud-up] pops up through an enclosing stack 426 Under gdb and dbx, \\[gud-up] pops up through an enclosing stack
442 frame. \\[gud-down] drops back down through one. 427 frame. \\[gud-down] drops back down through one.
443 428
444 If you are using gdb, \\[gdb-finish] runs execution to the return from 429 If you are using gdb, \\[gdb-finish] runs execution to the return from
445 the current function and stops. 430 the current function and stops.
431
432 All the keystrokes above have synonyms (in the GUD buffer only) with
433 a prefix of C-c (this is for backward compatibility with old gdb.el).
446 434
447 All pre-defined functions for which the concept make sense repeat 435 All pre-defined functions for which the concept make sense repeat
448 themselves the appropriate number of times if you give a prefix 436 themselves the appropriate number of times if you give a prefix
449 argument. 437 argument.
450 438
459 (setq mode-name "Debugger") 447 (setq mode-name "Debugger")
460 (setq mode-line-process '(": %s")) 448 (setq mode-line-process '(": %s"))
461 (use-local-map (copy-keymap comint-mode-map)) 449 (use-local-map (copy-keymap comint-mode-map))
462 (define-key (current-local-map) 450 (define-key (current-local-map)
463 gud-key-prefix (lookup-key gud-mode-map gud-key-prefix)) 451 gud-key-prefix (lookup-key gud-mode-map gud-key-prefix))
452 (define-key (current-local-map)
453 "\C-c" (lookup-key gud-mode-map gud-key-prefix))
464 (make-local-variable 'gud-last-frame) 454 (make-local-variable 'gud-last-frame)
465 (setq gud-last-frame nil) 455 (setq gud-last-frame nil)
466 (make-local-variable 'comint-prompt-regexp) 456 (make-local-variable 'comint-prompt-regexp)
467 (make-local-variable 'gud-delete-prompt-marker) 457 (make-local-variable 'gud-delete-prompt-marker)
468 (setq gud-delete-prompt-marker (make-marker)) 458 (setq gud-delete-prompt-marker (make-marker))