all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* issue with gdb-mi.el and Guile
@ 2017-06-02  1:37 David Boles
  2017-06-03  8:04 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: David Boles @ 2017-06-02  1:37 UTC (permalink / raw)
  To: emacs-devel

When using the guile command at the gdb prompt within emacs, it is easy to end up in a state in which the behavior of repeating the previous gdb command when hitting return is disabled. Basically, the gdb-send function in gdb-mi.el thinks that if you’ve entered “guile” at the gdb command prompt, then you must be in guile mode until it sees you enter a “,q”, “,quit”, or “end”.

Most of the time I use the guile control command to execute single Guile expressions (otherwise, I’d enter the guile repl). The patch below modifies this behavior in gdb-mi.el. I am decidedly not a “real Emacs Lisp” developer so there may well be a better/cleaner way to accomplish the same task. Nevertheless, this patch greatly improves the experience of using Guile within gdb within Emacs. The diff below is against a fresh tree a few days old.

Thanks,

 - db

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 1af520d..438fb75 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1778,6 +1778,9 @@ static char *magick[] = {
 As long as GDB is in the recursive reading loop, it does not expect
 commands to be prefixed by \"-interpreter-exec console\".")
 
+(defvar gdb-guile-command-non-empty-regexp "^[[:blank:]]*\\(guile\\)\\([[:blank:]]+[[:graph:]].*\\)$"
+  "Regexp matching a non-empty GDB guile command.")
+
 (defun gdb-strip-string-backslash (string)
   (replace-regexp-in-string "\\\\$" "" string))
 
@@ -1831,7 +1834,8 @@ commands to be prefixed by \"-interpreter-exec console\".")
               (> gdb-control-level 0))
          (setq gdb-control-level (1- gdb-control-level)))
       (setq gdb-continuation nil)))
-  (if (string-match gdb-control-commands-regexp string)
+  (if (and (string-match gdb-control-commands-regexp string)
+           (not (string-match gdb-guile-command-non-empty-regexp string)))
       (setq gdb-control-level (1+ gdb-control-level))))
 
 (defun gdb-mi-quote (string)




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-10  8:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-02  1:37 issue with gdb-mi.el and Guile David Boles
2017-06-03  8:04 ` Eli Zaretskii
     [not found]   ` <512B3559-B3DD-46DE-9E8C-2D0A90260A4D@ieee.org>
2017-06-04 14:20     ` Eli Zaretskii
2017-06-10  8:31       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.