branch: master
commit 3b0e42cb95c88ed7a2bf2fab6864ece35186e793
Author: rocky <[email protected]>
Commit: rocky <[email protected]>
realgud-exec-shell: Make sure we switch to cmdbuf even when there is an
error. gdb.el: insert set-annotate only if process is running.
---
realgud/common/core.el | 24 ++++++++++++------------
realgud/common/run.el | 8 +++-----
realgud/debugger/gdb/gdb.el | 11 ++++++-----
3 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/realgud/common/core.el b/realgud/common/core.el
index 4f8f344..71b81b8 100644
--- a/realgud/common/core.el
+++ b/realgud/common/core.el
@@ -270,10 +270,10 @@ marginal icons is reset."
(error
(let ((text (format "%S\n" failure)))
(insert text)
- (message text)(sit-for 2)
- text)))
+ (message text)(sit-for 1)
+ text)))
- (setq process (get-buffer-process cmdproc-buffer))
+ (setq process (get-buffer-process cmdproc-buffer))
(if (and process (eq 'run (process-status process)))
(let ((src-buffer)
@@ -283,16 +283,16 @@ marginal icons is reset."
(setq src-buffer (find-file-noselect script-filename))
(point-max)
(realgud-srcbuf-init src-buffer cmdproc-buffer))
- )
+ (process-put process 'buffer cmdproc-buffer))
;; else
- (insert
- (format
- "Failed to invoke debugger %s on program %s with args %s\n"
- debugger-name program (mapconcat 'identity args " ")))
- (error cmdproc-buffer)
- )
- (process-put process 'buffer cmdproc-buffer)))
- cmdproc-buffer))
+ (let ((text
+ (format
+ "Failed to invoke debugger %s on program %s with args %s\n"
+ debugger-name program (mapconcat 'identity args " "))))
+ (with-current-buffer cmdproc-buffer (insert text))
+ (message text)
+ ))
+ cmdproc-buffer))))
;; Start of a term-output-filter for term.el
(defun realgud-term-output-filter (process string)
diff --git a/realgud/common/run.el b/realgud/common/run.el
index 5e4bc5f..1108673 100644
--- a/realgud/common/run.el
+++ b/realgud/common/run.el
@@ -118,11 +118,9 @@ the program, we will switch to the command buffer which
shows
details of the error. The command buffer or nil is returned."
(let ((cmd-buf))
- (condition-case nil
- (setq cmd-buf
- (apply 'realgud-exec-shell debugger-name script-filename
- (car cmd-args) no-reset (cdr cmd-args)))
- (error nil))
+ (setq cmd-buf
+ (apply 'realgud-exec-shell debugger-name script-filename
+ (car cmd-args) no-reset (cdr cmd-args)))
;; FIXME: Is there probably is a way to remove the
;; below test and combine in condition-case?
(let ((process (get-buffer-process cmd-buf)))
diff --git a/realgud/debugger/gdb/gdb.el b/realgud/debugger/gdb/gdb.el
index 168d2d2..c93c4db 100644
--- a/realgud/debugger/gdb/gdb.el
+++ b/realgud/debugger/gdb/gdb.el
@@ -83,12 +83,13 @@ fringe and marginal icons.
nil))
)
(if cmd-buf
- (with-current-buffer cmd-buf
- (realgud-command "set annotate 1" nil nil nil)
- )
+ (let ((process (get-buffer-process cmd-buf)))
+ (if (and process (eq 'run (process-status process)))
+ (with-current-buffer cmd-buf
+ (realgud-command "set annotate 1" nil nil nil)
+ )))
)
- )
- )
+ ))
(provide-me "realgud-")