From 51c118a0c18f35917bdc3d627b5032a3572dd93c Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Wed, 7 Jan 2004 23:21:56 +0000 Subject: [PATCH] (gdba): Avoid duplication, use gdb-ann3. Use GDB command "set width 0" to prevent word wrapping problems. (gdb-prompt): Set (renamed) gdb-first-prompt to nil in gdb-ann3. --- lisp/gdb-ui.el | 71 +++++--------------------------------------------- 1 file changed, 6 insertions(+), 65 deletions(-) diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el index 2171dc5a843..07e63af7566 100644 --- a/lisp/gdb-ui.el +++ b/lisp/gdb-ui.el @@ -116,7 +116,9 @@ The following interactive lisp functions help control operation : ;; ;; Let's start with a basic gud-gdb buffer and then modify it a bit. (gdb command-line) - ;; + (gdb-ann3)) + +(defun gdb-ann3 () (set (make-local-variable 'gud-minor-mode) 'gdba) (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter) ;; @@ -160,7 +162,7 @@ The following interactive lisp functions help control operation : (setq gdb-selected-view 'source) (setq gdb-var-list nil) (setq gdb-var-changed nil) - (setq gdb-first-pre-prompt nil) + (setq gdb-first-prompt nil) ;; (mapc 'make-local-variable gdb-variables) (setq gdb-buffer-type 'gdba) @@ -170,6 +172,7 @@ The following interactive lisp functions help control operation : (if (eq window-system 'w32) (gdb-enqueue-input (list "set new-console off\n" 'ignore))) (gdb-enqueue-input (list "set height 0\n" 'ignore)) + (gdb-enqueue-input (list "set width 0\n" 'ignore)) ;; find source file and compilation directory here (gdb-enqueue-input (list "server list main\n" 'ignore)) ; C program (gdb-enqueue-input (list "server list MAIN__\n" 'ignore)) ; Fortran program @@ -686,9 +689,7 @@ output from a previous command if that happens to be in effect." (defun gdb-prompt (ignored) "An annotation handler for `prompt'. This sends the next command (if any) to gdb." - (when gdb-first-pre-prompt - (gdb-ann3) - (setq gdb-first-pre-prompt nil)) + (when gdb-first-prompt (gdb-ann3)) (let ((sink (gdb-get-output-sink))) (cond ((eq sink 'user) t) @@ -708,66 +709,6 @@ This sends the next command (if any) to gdb." (gdb-set-prompting t) (gud-display-frame))))) -(defun gdb-ann3 () - (set (make-local-variable 'gud-minor-mode) 'gdba) - (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter) - ;; - (gud-def gud-break (if (not (string-equal mode-name "Machine")) - (gud-call "break %f:%l" arg) - (save-excursion - (beginning-of-line) - (forward-char 2) - (gud-call "break *%a" arg))) - "\C-b" "Set breakpoint at current line or address.") - ;; - (gud-def gud-remove (if (not (string-equal mode-name "Machine")) - (gud-call "clear %f:%l" arg) - (save-excursion - (beginning-of-line) - (forward-char 2) - (gud-call "clear *%a" arg))) - "\C-d" "Remove breakpoint at current line or address.") - ;; - (gud-def gud-until (if (not (string-equal mode-name "Machine")) - (gud-call "until %f:%l" arg) - (save-excursion - (beginning-of-line) - (forward-char 2) - (gud-call "until *%a" arg))) - "\C-u" "Continue to current line or address.") - - (define-key gud-minor-mode-map [left-margin mouse-1] - 'gdb-mouse-toggle-breakpoint) - (define-key gud-minor-mode-map [left-fringe mouse-1] - 'gdb-mouse-toggle-breakpoint) - - (setq comint-input-sender 'gdb-send) - ;; - ;; (re-)initialise - (setq gdb-current-address "main") - (setq gdb-previous-address nil) - (setq gdb-previous-frame nil) - (setq gdb-current-frame "main") - (setq gdb-view-source t) - (setq gdb-selected-view 'source) - (setq gdb-var-list nil) - (setq gdb-var-changed nil) - ;; - (mapc 'make-local-variable gdb-variables) - (setq gdb-buffer-type 'gdba) - ;; - (gdb-clear-inferior-io) - ;; - (if (eq window-system 'w32) - (gdb-enqueue-input (list "set new-console off\n" 'ignore))) - (gdb-enqueue-input (list "set height 0\n" 'ignore)) - ;; find source file and compilation directory here - (gdb-enqueue-input (list "server list main\n" 'ignore)) ; C program - (gdb-enqueue-input (list "server list MAIN__\n" 'ignore)) ; Fortran program - (gdb-enqueue-input (list "server info source\n" 'gdb-source-info)) - ;; - (run-hooks 'gdba-mode-hook)) - (defun gdb-subprompt (ignored) "An annotation handler for non-top-level prompts." (gdb-set-prompting t)) -- 2.39.2