summaryrefslogtreecommitdiff
path: root/lisp/progmodes/gdb-mi.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/gdb-mi.el')
-rw-r--r--lisp/progmodes/gdb-mi.el23
1 files changed, 21 insertions, 2 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 978b81699fc..4f8709a21d7 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1976,6 +1976,7 @@ is running."
(not gdb-non-stop))
gud-running)
(and gdb-gud-control-all-threads
+ (not (null gdb-running-threads-count))
(> gdb-running-threads-count 0))))
;; GUD displays the selected GDB frame. This might might not be the current
@@ -2492,7 +2493,9 @@ current thread and update GDB buffers."
;; Reason is available with target-async only
(let* ((result (gdb-json-string output-field))
(reason (bindat-get-field result 'reason))
- (thread-id (bindat-get-field result 'thread-id)))
+ (thread-id (bindat-get-field result 'thread-id))
+ (retval (bindat-get-field result 'return-value))
+ (varnum (bindat-get-field result 'gdb-result-var)))
;; -data-list-register-names needs to be issued for any stopped
;; thread
@@ -2518,6 +2521,15 @@ current thread and update GDB buffers."
(if (string-equal reason "exited-normally")
(setq gdb-active-process nil))
+ (when (and retval varnum
+ ;; When the user typed CLI commands, GDB/MI helpfully
+ ;; includes the "Value returned" response in the "~"
+ ;; record; here we avoid displaying it twice.
+ (not (string-match "^Value returned is " gdb-filter-output)))
+ (setq gdb-filter-output
+ (concat gdb-filter-output
+ (format "Value returned is %s = %s\n" varnum retval))))
+
;; Select new current thread.
;; Don't switch if we have no reasons selected
@@ -2650,8 +2662,15 @@ responses.
If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with
\"FIX-LIST=[..]\" prior to parsing. This is used to fix broken
-break-info output when it contains breakpoint script field
-incompatible with GDB/MI output syntax."
+incompatible with GDB/MI output syntax.
+
+If `default-directory' is remote, full file names are adapted accordingly."
(save-excursion
+ (let ((remote (file-remote-p default-directory)))
+ (when remote
+ (goto-char (point-min))
+ (while (re-search-forward "[\\[,]fullname=\"\\(.+\\)\"" nil t)
+ (replace-match (concat remote "\\1") nil nil nil 1))))
(goto-char (point-min))
(when fix-key
(save-excursion