;;
;; 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)
;;
(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)
(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
(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)
(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))