diff options
Diffstat (limited to 'lisp/progmodes/gdb-mi.el')
-rw-r--r-- | lisp/progmodes/gdb-mi.el | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 4bee7c1dfa2..bde030e3f26 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1630,7 +1630,7 @@ this trigger is subscribed to `gdb-buf-publisher' and called with (make-comint-in-buffer "gdb-inferior" (current-buffer) nil)) (defcustom gdb-display-io-nopopup nil - "When non-nil, and the 'gdb-inferior-io buffer is buried, don't pop it up." + "When non-nil, and the `gdb-inferior-io' buffer is buried, don't pop it up." :type 'boolean :group 'gdb :version "25.1") @@ -1766,7 +1766,8 @@ static char *magick[] = { (defvar gdb-control-commands-regexp (concat "^\\(" - "commands\\|if\\|while\\|define\\|document\\|python\\|" + "commands\\|if\\|while\\|define\\|document\\|" + "python\\|python-interactive\\|pi\\|guile\\|guile-repl\\|gr\\|" "while-stepping\\|stepping\\|ws\\|actions" "\\)\\([[:blank:]]+.*\\)?$") "Regexp matching GDB commands that enter a recursive reading loop. @@ -1782,21 +1783,27 @@ commands to be prefixed by \"-interpreter-exec console\".") (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) '(face)))) ;; mimic <RET> key to repeat previous command in GDB - (if (not (string= "" string)) - (if gdb-continuation - (setq gdb-last-command (concat gdb-continuation - (gdb-strip-string-backslash string) - " ")) - (setq gdb-last-command (gdb-strip-string-backslash string))) - (if gdb-last-command (setq string gdb-last-command)) - (setq gdb-continuation nil)) - (if (and (not gdb-continuation) (or (string-match "^-" string) - (> gdb-control-level 0))) + (when (= gdb-control-level 0) + (if (not (string= "" string)) + (if gdb-continuation + (setq gdb-last-command (concat gdb-continuation + (gdb-strip-string-backslash string) + " ")) + (setq gdb-last-command (gdb-strip-string-backslash string))) + (if gdb-last-command (setq string gdb-last-command)) + (setq gdb-continuation nil))) + (if (and (not gdb-continuation) + (or (string-match "^-" string) + (> gdb-control-level 0))) ;; Either MI command or we are feeding GDB's recursive reading loop. (progn (setq gdb-first-done-or-error t) (process-send-string proc (concat string "\n")) - (if (and (string-match "^end$" string) + (if (and (string-match + (concat "^\\(" + (if (eq system-type 'windows-nt) "\026" "\004") + "\\|,q\\|,quit\\|end\\)$") + string) (> gdb-control-level 0)) (setq gdb-control-level (1- gdb-control-level)))) ;; CLI command @@ -1812,7 +1819,11 @@ commands to be prefixed by \"-interpreter-exec console\".") (if gdb-enable-debug (push (cons 'mi-send to-send) gdb-debug-log)) (process-send-string proc to-send)) - (if (and (string-match "^end$" string) + (if (and (string-match + (concat "^\\(" + (if (eq system-type 'windows-nt) "\026" "\004") + "\\|,q\\|,quit\\|end\\)$") + string) (> gdb-control-level 0)) (setq gdb-control-level (1- gdb-control-level))) (setq gdb-continuation nil))) @@ -2788,7 +2799,7 @@ buffer with `gdb-bind-function-to-buffer'. If SIGNAL-LIST is non-nil, GDB-COMMAND is sent only when the defined trigger is called with an argument from SIGNAL-LIST. It's not recommended to define triggers with empty SIGNAL-LIST. -Normally triggers should respond at least to 'update signal. +Normally triggers should respond at least to the `update' signal. Normally the trigger defined by this command must be called from the buffer where HANDLER-NAME must work. This should be done so @@ -3252,7 +3263,7 @@ corresponding to the mode line clicked." "Define a NAME command which will act upon thread on the current line. CUSTOM-DEFUN may use locally bound `thread' variable, which will -be the value of 'gdb-thread property of the current line. +be the value of `gdb-thread' property of the current line. If `gdb-thread' is nil, error is signaled." `(defun ,name (&optional event) ,(when doc doc) |