diff options
| -rw-r--r-- | lisp/progmodes/gud.el | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 1d58bcd732c..48a007aef27 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -319,10 +319,10 @@ t means that there is no stack, and we are in display-file mode.") | |||
| 319 | If the GUD BUFFER is not running a supported debugger, then turn | 319 | If the GUD BUFFER is not running a supported debugger, then turn |
| 320 | off the specialized speedbar mode." | 320 | off the specialized speedbar mode." |
| 321 | (let ((minor-mode (with-current-buffer buffer gud-minor-mode))) | 321 | (let ((minor-mode (with-current-buffer buffer gud-minor-mode))) |
| 322 | (cond | 322 | (cond |
| 323 | ((eq minor-mode 'gdba) | 323 | ((eq minor-mode 'gdba) |
| 324 | (when (or gdb-var-changed | 324 | (when (or gdb-var-changed |
| 325 | (not (save-excursion | 325 | (not (save-excursion |
| 326 | (goto-char (point-min)) | 326 | (goto-char (point-min)) |
| 327 | (let ((case-fold-search t)) | 327 | (let ((case-fold-search t)) |
| 328 | (looking-at "Watch Expressions:"))))) | 328 | (looking-at "Watch Expressions:"))))) |
| @@ -339,8 +339,8 @@ off the specialized speedbar mode." | |||
| 339 | (speedbar-make-tag-line 'bracket ?? nil nil | 339 | (speedbar-make-tag-line 'bracket ?? nil nil |
| 340 | (concat (car var) "\t" (nth 4 var)) | 340 | (concat (car var) "\t" (nth 4 var)) |
| 341 | 'gdb-edit-value | 341 | 'gdb-edit-value |
| 342 | nil | 342 | nil |
| 343 | (if (and (nth 5 var) | 343 | (if (and (nth 5 var) |
| 344 | gdb-show-changed-values) | 344 | gdb-show-changed-values) |
| 345 | 'font-lock-warning-face | 345 | 'font-lock-warning-face |
| 346 | nil) depth) | 346 | nil) depth) |
| @@ -354,7 +354,7 @@ off the specialized speedbar mode." | |||
| 354 | nil nil depth))) | 354 | nil nil depth))) |
| 355 | (setq var-list (cdr var-list)))) | 355 | (setq var-list (cdr var-list)))) |
| 356 | (setq gdb-var-changed nil))) | 356 | (setq gdb-var-changed nil))) |
| 357 | (t (if (and (save-excursion | 357 | (t (if (and (save-excursion |
| 358 | (goto-char (point-min)) | 358 | (goto-char (point-min)) |
| 359 | (looking-at "Current Stack")) | 359 | (looking-at "Current Stack")) |
| 360 | (equal gud-last-last-frame gud-last-speedbar-stackframe)) | 360 | (equal gud-last-last-frame gud-last-speedbar-stackframe)) |
| @@ -406,7 +406,7 @@ off the specialized speedbar mode." | |||
| 406 | ;; History of argument lists passed to gdb. | 406 | ;; History of argument lists passed to gdb. |
| 407 | (defvar gud-gdb-history nil) | 407 | (defvar gud-gdb-history nil) |
| 408 | 408 | ||
| 409 | (defcustom gud-gdb-command-name "gdb --fullname" | 409 | (defcustom gud-gdb-command-name "gdb --annotate=3" |
| 410 | "Default command to execute an executable under the GDB debugger." | 410 | "Default command to execute an executable under the GDB debugger." |
| 411 | :type 'string | 411 | :type 'string |
| 412 | :group 'gud) | 412 | :group 'gud) |
| @@ -447,6 +447,19 @@ off the specialized speedbar mode." | |||
| 447 | ;; Set the accumulator to the remaining text. | 447 | ;; Set the accumulator to the remaining text. |
| 448 | gud-marker-acc (substring gud-marker-acc (match-end 0)))) | 448 | gud-marker-acc (substring gud-marker-acc (match-end 0)))) |
| 449 | 449 | ||
| 450 | (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc) | ||
| 451 | (when (string-equal (match-string 1 gud-marker-acc) "prompt") | ||
| 452 | (require 'gdb-ui) | ||
| 453 | (gdb-prompt nil)) | ||
| 454 | (setq | ||
| 455 | ;; Append any text before the marker to the output we're going | ||
| 456 | ;; to return - we don't include the marker in this text. | ||
| 457 | output (concat output | ||
| 458 | (substring gud-marker-acc 0 (match-beginning 0))) | ||
| 459 | |||
| 460 | ;; Set the accumulator to the remaining text. | ||
| 461 | gud-marker-acc (substring gud-marker-acc (match-end 0)))) | ||
| 462 | |||
| 450 | ;; Does the remaining text look like it might end with the | 463 | ;; Does the remaining text look like it might end with the |
| 451 | ;; beginning of another marker? If it does, then keep it in | 464 | ;; beginning of another marker? If it does, then keep it in |
| 452 | ;; gud-marker-acc until we receive the rest of it. Since we | 465 | ;; gud-marker-acc until we receive the rest of it. Since we |
| @@ -492,6 +505,8 @@ off the specialized speedbar mode." | |||
| 492 | gud-minibuffer-local-map nil | 505 | gud-minibuffer-local-map nil |
| 493 | hist-sym))) | 506 | hist-sym))) |
| 494 | 507 | ||
| 508 | (defvar gdb-first-pre-prompt t) | ||
| 509 | |||
| 495 | ;;;###autoload | 510 | ;;;###autoload |
| 496 | (defun gdb (command-line) | 511 | (defun gdb (command-line) |
| 497 | "Run gdb on program FILE in buffer *gud-FILE*. | 512 | "Run gdb on program FILE in buffer *gud-FILE*. |
| @@ -522,8 +537,8 @@ and source-file directory for your debugger." | |||
| 522 | (local-set-key "\C-i" 'gud-gdb-complete-command) | 537 | (local-set-key "\C-i" 'gud-gdb-complete-command) |
| 523 | (setq comint-prompt-regexp "^(.*gdb[+]?) *") | 538 | (setq comint-prompt-regexp "^(.*gdb[+]?) *") |
| 524 | (setq paragraph-start comint-prompt-regexp) | 539 | (setq paragraph-start comint-prompt-regexp) |
| 525 | (run-hooks 'gdb-mode-hook) | 540 | (setq gdb-first-pre-prompt t) |
| 526 | ) | 541 | (run-hooks 'gdb-mode-hook)) |
| 527 | 542 | ||
| 528 | ;; One of the nice features of GDB is its impressive support for | 543 | ;; One of the nice features of GDB is its impressive support for |
| 529 | ;; context-sensitive command completion. We preserve that feature | 544 | ;; context-sensitive command completion. We preserve that feature |