aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2016-06-10 11:57:17 +0300
committerEli Zaretskii2016-06-10 11:57:17 +0300
commitc803af788d4140c7253b1d091e6f7fb63b5a214a (patch)
treee575e01de9921c8c56a3e27ab3c9e22a4bd25885
parentff9ddda9069da6b4dbcc64615cb4cab9a1f4f8b7 (diff)
downloademacs-c803af788d4140c7253b1d091e6f7fb63b5a214a.tar.gz
emacs-c803af788d4140c7253b1d091e6f7fb63b5a214a.zip
Show returned value after gdb-mi "finish" command
* lisp/progmodes/gdb-mi.el (gdb-stopped): Display the expected "Value returned" message in response to "finish", when not produced by GDB/MI. (Bug#23720)
-rw-r--r--lisp/progmodes/gdb-mi.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 5ad101df7bf..b2c06145187 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -2488,7 +2488,9 @@ current thread and update GDB buffers."
2488 ;; Reason is available with target-async only 2488 ;; Reason is available with target-async only
2489 (let* ((result (gdb-json-string output-field)) 2489 (let* ((result (gdb-json-string output-field))
2490 (reason (bindat-get-field result 'reason)) 2490 (reason (bindat-get-field result 'reason))
2491 (thread-id (bindat-get-field result 'thread-id))) 2491 (thread-id (bindat-get-field result 'thread-id))
2492 (retval (bindat-get-field result 'return-value))
2493 (varnum (bindat-get-field result 'gdb-result-var)))
2492 2494
2493 ;; -data-list-register-names needs to be issued for any stopped 2495 ;; -data-list-register-names needs to be issued for any stopped
2494 ;; thread 2496 ;; thread
@@ -2514,6 +2516,15 @@ current thread and update GDB buffers."
2514 (if (string-equal reason "exited-normally") 2516 (if (string-equal reason "exited-normally")
2515 (setq gdb-active-process nil)) 2517 (setq gdb-active-process nil))
2516 2518
2519 (when (and retval varnum
2520 ;; When the user typed CLI commands, GDB/MI helpfully
2521 ;; includes the "Value returned" response in the "~"
2522 ;; record; here we avoid displaying it twice.
2523 (not (string-match "^Value returned is " gdb-filter-output)))
2524 (setq gdb-filter-output
2525 (concat gdb-filter-output
2526 (format "Value returned is %s = %s\n" varnum retval))))
2527
2517 ;; Select new current thread. 2528 ;; Select new current thread.
2518 2529
2519 ;; Don't switch if we have no reasons selected 2530 ;; Don't switch if we have no reasons selected