[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40250: 26.3; gdb-mode incorrectly handles gdb's `explore' command

From: Eli Zaretskii
Subject: bug#40250: 26.3; gdb-mode incorrectly handles gdb's `explore' command
Date: Sat, 04 Apr 2020 14:19:31 +0300

> From: Vladimir Nikishkin <lockywolf@gmail.com>
> Date: Mon, 30 Mar 2020 22:49:28 +0800
> I'm not sure it matters much. The main thing is that exploration works now.

OK, I've pushed the fix to the master branch.  the full patch appears
below, so you could use it with your version of Emacs right now.

Thanks again for help in testing the fix.

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 7fb3687..0750683 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1850,7 +1850,8 @@ gdb-control-commands-regexp
-   "\\)\\([[:blank:]]+\\([^[:blank:]]*\\)\\)?$")
+   "\\|expl\\(o\\(r\\e?\\)?\\)?"
+   "\\)\\([[:blank:]]+\\([^[:blank:]]*\\)\\)*$")
   "Regexp matching GDB commands that enter a recursive reading loop.
 As long as GDB is in the recursive reading loop, it does not expect
 commands to be prefixed by \"-interpreter-exec console\".")
@@ -2508,7 +2509,13 @@ gud-gdbmi-marker-filter
-(defun gdb-gdb (_output-field))
+(defun gdb-gdb (_output-field)
+  ;; This is needed because the "explore" command is not ended by the
+  ;; likes of "end" or "quit", but instead by a RET at the approriate
+  ;; place, and we know we have exited "explore" when we get the
+  ;; "(gdb)" prompt.
+  (and (> gdb-control-level 0)
+       (setq gdb-control-level (1- gdb-control-level))))
 (defun gdb-shell (output-field)
   (setq gdb-filter-output

reply via email to

[Prev in Thread] Current Thread [Next in Thread]