emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112310: * lisp/progmodes/gdb-mi.el (


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112310: * lisp/progmodes/gdb-mi.el (gdbmi-bnf-incomplete-record-result):
Date: Tue, 16 Apr 2013 20:35:22 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112310
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14129
author: Jean-Philippe Gravel <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2013-04-16 20:35:22 -0400
message:
  * lisp/progmodes/gdb-mi.el (gdbmi-bnf-incomplete-record-result):
  Fix adjustment of offset when receiving incomplete responses from GDB.
modified:
  lisp/ChangeLog
  lisp/progmodes/gdb-mi.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-04-16 17:28:11 +0000
+++ b/lisp/ChangeLog    2013-04-17 00:35:22 +0000
@@ -1,3 +1,9 @@
+2013-04-17  Jean-Philippe Gravel  <address@hidden>
+
+       * progmodes/gdb-mi.el (gdbmi-bnf-incomplete-record-result):
+       Fix adjustment of offset when receiving incomplete responses from GDB
+       (bug#14129).
+
 2013-04-16  Stefan Monnier  <address@hidden>
 
        * progmodes/python.el (python-mode-skeleton-abbrev-table): Rename from

=== modified file 'lisp/progmodes/gdb-mi.el'
--- a/lisp/progmodes/gdb-mi.el  2013-03-11 17:13:39 +0000
+++ b/lisp/progmodes/gdb-mi.el  2013-04-17 00:35:22 +0000
@@ -2149,19 +2149,23 @@
     ;; Search the data stream for the end of the current record:
     (let* ((newline-pos (string-match "\n" gud-marker-acc gdbmi-bnf-offset))
           (is-progressive (equal (cdr class-command) 'progressive))
-          (is-complete (not (null newline-pos)))
-          result-str)
+       (is-complete (not (null newline-pos)))
+       result-str)
+
+      (when gdbmi-debug-mode
+        (message "gdbmi-bnf-incomplete-record-result: %s"
+                 (substring gud-marker-acc gdbmi-bnf-offset newline-pos)))
 
       ;; Update the gdbmi-bnf-offset only if the current chunk of data can
       ;; be processed by the class-command handler:
       (when (or is-complete is-progressive)
-       (setq result-str
+        (setq result-str
               (substring gud-marker-acc gdbmi-bnf-offset newline-pos))
-       (setq gdbmi-bnf-offset (+ 1 newline-pos)))
 
-      (if gdbmi-debug-mode
-          (message "gdbmi-bnf-incomplete-record-result: %s"
-                   (substring gud-marker-acc gdbmi-bnf-offset newline-pos)))
+        ;; Move gdbmi-bnf-offset past the end of the chunk.
+        (setq gdbmi-bnf-offset (+ gdbmi-bnf-offset (length result-str)))
+        (when newline-pos
+          (setq gdbmi-bnf-offset (1+ gdbmi-bnf-offset))))
 
       ;; Update the parsing state before invoking the handler in class-command
       ;; to make sure it's not left in an invalid state if the handler was


reply via email to

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