]> git.eshelyaron.com Git - emacs.git/commitdiff
(gdba): Avoid duplication, use gdb-ann3. Use GDB
authorNick Roberts <nickrob@snap.net.nz>
Wed, 7 Jan 2004 23:21:56 +0000 (23:21 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Wed, 7 Jan 2004 23:21:56 +0000 (23:21 +0000)
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

index 2171dc5a843d2ae1d392620aa8ca5da7caadf7f4..07e63af756632e4f37173a2eb868ec5c682b2f06 100644 (file)
@@ -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))