From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jean-Philippe Gravel Newsgroups: gmane.emacs.bugs Subject: bug#14129: 24.3.50; gdb/gud: wrong-type-argument Date: Fri, 5 Apr 2013 00:07:36 -0400 Message-ID: References: <1364996905.4008.6.camel@athena.config> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1365134888 14045 80.91.229.3 (5 Apr 2013 04:08:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Apr 2013 04:08:08 +0000 (UTC) To: 14129@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 05 06:08:36 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UNxx3-0002zN-8D for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Apr 2013 06:08:33 +0200 Original-Received: from localhost ([::1]:52121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNxwd-0005wY-Pg for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Apr 2013 00:08:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNxwU-0005vQ-6c for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2013 00:08:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNxwL-0007rR-Pa for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2013 00:07:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNxwL-0007rM-Lm for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2013 00:07:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UNxzS-0005ss-AB for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2013 00:11:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <1364996905.4008.6.camel@athena.config> Resent-From: Jean-Philippe Gravel Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Apr 2013 04:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14129 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14129-submit@debbugs.gnu.org id=B14129.136513505322603 (code B ref 14129); Fri, 05 Apr 2013 04:11:02 +0000 Original-Received: (at 14129) by debbugs.gnu.org; 5 Apr 2013 04:10:53 +0000 Original-Received: from localhost ([127.0.0.1]:34513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UNxzI-0005sW-RH for submit@debbugs.gnu.org; Fri, 05 Apr 2013 00:10:53 -0400 Original-Received: from mail-bk0-f42.google.com ([209.85.214.42]:43648) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UNxzH-0005sN-0f for 14129@debbugs.gnu.org; Fri, 05 Apr 2013 00:10:51 -0400 Original-Received: by mail-bk0-f42.google.com with SMTP id jc3so1874464bkc.29 for <14129@debbugs.gnu.org>; Thu, 04 Apr 2013 21:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=qBwrlCh5BROoZOY7yTReZ08pnUWpUSWKw/m/hXN+1Lg=; b=Ip9nH48cjl9aWbzaoXzkChlLNNyuGAa2V+jfUBT6CuIkx6sQQY3d1jyOxpPb7/NTTU 2LALdOfZWF3RacPR3g3CKbStsRGp9/kQktcEd4BCJ66P2u39E8re0wOvqlov/7BUa65p vGYHXs4+PbsNgysdwQT7v7gaFoAKzXG1P1lzPt55hjiE6w4JKEYCpiBL4J28MJ+6UKAc KOEX341wrVrELczxiV6UMJFSzT1l6/XQXHVTeVE/612PDYFyeZF1WkYADML/UP0gnnsQ IGHSOdm0hbw8t6EZZ2+mV4J2R6/ArElhhlYhmTgwXK8jwGaW0n7QTMEevaE8VOoY8C+C wd9Q== X-Received: by 10.205.24.76 with SMTP id rd12mr6037444bkb.98.1365134856862; Thu, 04 Apr 2013 21:07:36 -0700 (PDT) Original-Received: by 10.204.200.73 with HTTP; Thu, 4 Apr 2013 21:07:36 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73173 Archived-At: Try the following patch. The current buffer offset (gdbmi-bnf-offset) was incorrectly adjusted when receiving incomplete responses from GDB. === modified file 'lisp/progmodes/gdb-mi.el' *** lisp/progmodes/gdb-mi.el 2013-03-11 17:13:39 +0000 --- lisp/progmodes/gdb-mi.el 2013-04-05 03:47:08 +0000 *************** *** 2152,2167 **** (is-complete (not (null newline-pos))) result-str) ;; 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 (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))) ;; 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 --- 2152,2171 ---- (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 (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