]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #14847 with continued GDB command lines in gdb-mi.el.
authorSergio Durigan Junior <sergiodj@riseup.net>
Fri, 12 Jul 2013 18:17:17 +0000 (21:17 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 12 Jul 2013 18:17:17 +0000 (21:17 +0300)
 lisp/progmodes/gdb-mi.el (gdb-strip-string-backslash): New function.
 (gdb-send): Handle continued commands.

lisp/ChangeLog
lisp/progmodes/gdb-mi.el

index e312fde4672194f1aedfc6918a33d75ba5a9cd27..b4f3721dd93f2d1ee6db791e6d0cea8c68b2d482 100644 (file)
@@ -1,3 +1,11 @@
+2013-07-12  Sergio Durigan Junior  <sergiodj@riseup.net>  (tiny change)
+
+       * progmodes/gdb-mi.el (gdb-strip-string-backslash): New function.
+       (gdb-send): Handle continued commands.
+
+       * simple.el (next-line, previous-line): Document TRY-VSCROLL and ARG.
+       (Bug#14842)
+
 2013-07-12  Juanma Barranquero  <lekktu@gmail.com>
 
        * desktop.el (desktop--v2s): Remove unused local variable.
@@ -9,11 +17,6 @@
 
        * emacs-lisp/map-ynp.el (map-y-or-n-p): Fix last change.
 
-2013-07-12  Eli Zaretskii  <eliz@gnu.org>
-
-       * simple.el (next-line, previous-line): Document TRY-VSCROLL and ARG.
-       (Bug#14842)
-
 2013-07-12  Glenn Morris  <rgm@gnu.org>
 
        * doc-view.el: Require cl-lib at runtime too.
index 2c4d6a0e3d78fd890ca09b9cc1029d7d8739c9d2..10472ec5815afbb733accf88ac09101a2cc74d47 100644 (file)
@@ -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))