GNU bug report logs - #23720
25.0.94; Issues with GUD (gdb-mi) after upgrade from Emacs 23 to 24/25

Previous Next

Package: emacs;

Reported by: Guilhem Bichot <guilhem.bichot <at> oracle.com>

Date: Tue, 7 Jun 2016 15:34:01 UTC

Severity: minor

Found in version 25.0.94

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: guilhem.bichot <at> oracle.com
Cc: 23720 <at> debbugs.gnu.org
Subject: bug#23720: 25.0.94; Issues with GUD (gdb-mi) after upgrade from Emacs 23 to 24/25
Date: Tue, 07 Jun 2016 21:54:58 +0300
> Date: Tue, 07 Jun 2016 20:15:34 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 23720 <at> debbugs.gnu.org
> 
> > ISSUE 3: STEPPING OUT DOESN'T PRINT RETURN VALUE
> > ================================================
> > 
> > The program is in the stepped-in function, clicking "Step out" steps out
> > of it, but this doesn't print the returned value.
> > Emacs23 prints it ("Value returned is $1 = false").
> 
> Looks like a missing feature in gdb-mi: the return value sent by MI is
> not processed.

Please try the patch below, I think it will fix this.

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 5ad101d..195acaf 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -2488,7 +2488,9 @@ gdb-stopped
   ;; 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
@@ -2514,6 +2516,11 @@ gdb-stopped
     (if (string-equal reason "exited-normally")
 	(setq gdb-active-process nil))
 
+    (when (and retval varnum)
+      (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




This bug report was last modified 4 years and 328 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.