diff options
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 13 |
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 |