diff options
| author | Nick Roberts | 2005-03-29 20:59:42 +0000 |
|---|---|---|
| committer | Nick Roberts | 2005-03-29 20:59:42 +0000 |
| commit | 63cc3b0975bd3e25b11311b1dc7983afb22311d0 (patch) | |
| tree | 9395a15812cb17bf58aaa72c7632fe9f3837fb30 /lisp | |
| parent | 5f9ffb03c99ab08048b78019385b744f1ddc5433 (diff) | |
| download | emacs-63cc3b0975bd3e25b11311b1dc7983afb22311d0.tar.gz emacs-63cc3b0975bd3e25b11311b1dc7983afb22311d0.zip | |
(gdb): (Re)-initialise gud-filter-pending-text.
(gud-filter-pending-text): Move in front of gdb.
(gud-overlay-arrow-position): New variable.
(gud-sentinel, gud-display-line): Use it in place of
overlay-arrow-position.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/gud.el | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 0988599ed54..1f9284db9cb 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -531,6 +531,9 @@ off the specialized speedbar mode." | |||
| 531 | 531 | ||
| 532 | (defvar gdb-first-prompt t) | 532 | (defvar gdb-first-prompt t) |
| 533 | 533 | ||
| 534 | (defvar gud-filter-pending-text nil | ||
| 535 | "Non-nil means this is text that has been saved for later in `gud-filter'.") | ||
| 536 | |||
| 534 | ;;;###autoload | 537 | ;;;###autoload |
| 535 | (defun gdb (command-line) | 538 | (defun gdb (command-line) |
| 536 | "Run gdb on program FILE in buffer *gud-FILE*. | 539 | "Run gdb on program FILE in buffer *gud-FILE*. |
| @@ -562,6 +565,7 @@ and source-file directory for your debugger." | |||
| 562 | (setq comint-prompt-regexp "^(.*gdb[+]?) *") | 565 | (setq comint-prompt-regexp "^(.*gdb[+]?) *") |
| 563 | (setq paragraph-start comint-prompt-regexp) | 566 | (setq paragraph-start comint-prompt-regexp) |
| 564 | (setq gdb-first-prompt t) | 567 | (setq gdb-first-prompt t) |
| 568 | (setq gud-filter-pending-text nil) | ||
| 565 | (run-hooks 'gdb-mode-hook)) | 569 | (run-hooks 'gdb-mode-hook)) |
| 566 | 570 | ||
| 567 | ;; One of the nice features of GDB is its impressive support for | 571 | ;; One of the nice features of GDB is its impressive support for |
| @@ -2445,9 +2449,6 @@ comint mode, which see." | |||
| 2445 | "Non-nil means don't process anything from the debugger right now. | 2449 | "Non-nil means don't process anything from the debugger right now. |
| 2446 | It is saved for when this flag is not set.") | 2450 | It is saved for when this flag is not set.") |
| 2447 | 2451 | ||
| 2448 | (defvar gud-filter-pending-text nil | ||
| 2449 | "Non-nil means this is text that has been saved for later in `gud-filter'.") | ||
| 2450 | |||
| 2451 | ;; These functions are responsible for inserting output from your debugger | 2452 | ;; These functions are responsible for inserting output from your debugger |
| 2452 | ;; into the buffer. The hard work is done by the method that is | 2453 | ;; into the buffer. The hard work is done by the method that is |
| 2453 | ;; the value of gud-marker-filter. | 2454 | ;; the value of gud-marker-filter. |
| @@ -2516,19 +2517,22 @@ It is saved for when this flag is not set.") | |||
| 2516 | (gud-filter proc "")))))) | 2517 | (gud-filter proc "")))))) |
| 2517 | 2518 | ||
| 2518 | (defvar gud-minor-mode-type nil) | 2519 | (defvar gud-minor-mode-type nil) |
| 2520 | (defvar gud-overlay-arrow-position nil) | ||
| 2521 | (put 'gud-overlay-arrow-position 'overlay-arrow-string "=>") | ||
| 2522 | (add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position) | ||
| 2519 | 2523 | ||
| 2520 | (defun gud-sentinel (proc msg) | 2524 | (defun gud-sentinel (proc msg) |
| 2521 | (cond ((null (buffer-name (process-buffer proc))) | 2525 | (cond ((null (buffer-name (process-buffer proc))) |
| 2522 | ;; buffer killed | 2526 | ;; buffer killed |
| 2523 | ;; Stop displaying an arrow in a source file. | 2527 | ;; Stop displaying an arrow in a source file. |
| 2524 | (setq overlay-arrow-position nil) | 2528 | (setq gud-overlay-arrow-position nil) |
| 2525 | (set-process-buffer proc nil) | 2529 | (set-process-buffer proc nil) |
| 2526 | (if (memq gud-minor-mode-type '(gdbmi gdba)) | 2530 | (if (memq gud-minor-mode-type '(gdbmi gdba)) |
| 2527 | (gdb-reset) | 2531 | (gdb-reset) |
| 2528 | (gud-reset))) | 2532 | (gud-reset))) |
| 2529 | ((memq (process-status proc) '(signal exit)) | 2533 | ((memq (process-status proc) '(signal exit)) |
| 2530 | ;; Stop displaying an arrow in a source file. | 2534 | ;; Stop displaying an arrow in a source file. |
| 2531 | (setq overlay-arrow-position nil) | 2535 | (setq gud-overlay-arrow-position nil) |
| 2532 | (with-current-buffer gud-comint-buffer | 2536 | (with-current-buffer gud-comint-buffer |
| 2533 | (if (memq gud-minor-mode-type '(gdbmi gdba)) | 2537 | (if (memq gud-minor-mode-type '(gdbmi gdba)) |
| 2534 | (gdb-reset) | 2538 | (gdb-reset) |
| @@ -2611,13 +2615,13 @@ Obeying it means displaying in another window the specified file and line." | |||
| 2611 | (goto-line line) | 2615 | (goto-line line) |
| 2612 | (setq pos (point)) | 2616 | (setq pos (point)) |
| 2613 | (setq overlay-arrow-string "=>") | 2617 | (setq overlay-arrow-string "=>") |
| 2614 | (or overlay-arrow-position | 2618 | (or gud-overlay-arrow-position |
| 2615 | (setq overlay-arrow-position (make-marker))) | 2619 | (setq gud-overlay-arrow-position (make-marker))) |
| 2616 | (set-marker overlay-arrow-position (point) (current-buffer))) | 2620 | (set-marker gud-overlay-arrow-position (point) (current-buffer))) |
| 2617 | (cond ((or (< pos (point-min)) (> pos (point-max))) | 2621 | (cond ((or (< pos (point-min)) (> pos (point-max))) |
| 2618 | (widen) | 2622 | (widen) |
| 2619 | (goto-char pos)))) | 2623 | (goto-char pos)))) |
| 2620 | (if window (set-window-point window overlay-arrow-position)))))) | 2624 | (if window (set-window-point window gud-overlay-arrow-position)))))) |
| 2621 | 2625 | ||
| 2622 | ;; The gud-call function must do the right thing whether its invoking | 2626 | ;; The gud-call function must do the right thing whether its invoking |
| 2623 | ;; keystroke is from the GUD buffer itself (via major-mode binding) | 2627 | ;; keystroke is from the GUD buffer itself (via major-mode binding) |