diff options
| author | Tom Tromey <tromey@redhat.com> | 2013-07-12 18:44:13 -0600 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2013-07-12 18:44:13 -0600 |
| commit | b34a529f177a6ea32da5cb1254f91bf9d71838db (patch) | |
| tree | 477131abc15d3107b30b635223d87a22550b480b /lisp/progmodes/gdb-mi.el | |
| parent | e6f63071a3f7721f55220514b6d9a8ee8c1232d8 (diff) | |
| parent | 5e301d7651c0691bb2bc7f3fbe711fdbe26ac471 (diff) | |
| download | emacs-b34a529f177a6ea32da5cb1254f91bf9d71838db.tar.gz | |
Merge from trunk
Diffstat (limited to 'lisp/progmodes/gdb-mi.el')
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 2c4d6a0e3d7..10472ec5815 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1759,6 +1759,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\".") +(defun gdb-strip-string-backslash (string) + (replace-regexp-in-string "\\\\$" "" string)) + (defun gdb-send (proc string) "A comint send filter for gdb." (with-current-buffer gud-comint-buffer @@ -1766,10 +1769,15 @@ commands to be prefixed by \"-interpreter-exec console\".") (remove-text-properties (point-min) (point-max) '(face)))) ;; mimic <RET> key to repeat previous command in GDB (if (not (string= "" string)) - (setq gdb-last-command string) - (if gdb-last-command (setq string gdb-last-command))) - (if (or (string-match "^-" string) - (> gdb-control-level 0)) + (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) @@ -1779,10 +1787,13 @@ commands to be prefixed by \"-interpreter-exec console\".") (setq gdb-control-level (1- gdb-control-level)))) ;; CLI command (if (string-match "\\\\$" string) - (setq gdb-continuation (concat gdb-continuation string "\n")) + (setq gdb-continuation + (concat gdb-continuation (gdb-strip-string-backslash + string) + " ")) (setq gdb-first-done-or-error t) (let ((to-send (concat "-interpreter-exec console " - (gdb-mi-quote string) + (gdb-mi-quote (concat gdb-continuation string " ")) "\n"))) (if gdb-enable-debug (push (cons 'mi-send to-send) gdb-debug-log)) |
