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#13845: 24.3.50; gud commands stop responding when using gdb-mi Date: Mon, 29 Apr 2013 23:32:51 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1367292835 19929 80.91.229.3 (30 Apr 2013 03:33:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Apr 2013 03:33:55 +0000 (UTC) To: 13845@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 30 05:33:54 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 1UX1KC-00084t-CD for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Apr 2013 05:33:52 +0200 Original-Received: from localhost ([::1]:44534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX1KC-0004BV-0B for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Apr 2013 23:33:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX1K5-0004BN-1h for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2013 23:33:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UX1K2-0008ED-EQ for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2013 23:33:44 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX1K2-0008E7-9z for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2013 23:33:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UX1KM-0005y0-KK for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2013 23:34:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Jean-Philippe Gravel Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Apr 2013 03:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13845 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13845-submit@debbugs.gnu.org id=B13845.136729279622805 (code B ref 13845); Tue, 30 Apr 2013 03:34:02 +0000 Original-Received: (at 13845) by debbugs.gnu.org; 30 Apr 2013 03:33:16 +0000 Original-Received: from localhost ([127.0.0.1]:51292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UX1Jb-0005vl-US for submit@debbugs.gnu.org; Mon, 29 Apr 2013 23:33:16 -0400 Original-Received: from mail-bk0-f41.google.com ([209.85.214.41]:61490) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UX1JZ-0005vK-D6 for 13845@debbugs.gnu.org; Mon, 29 Apr 2013 23:33:14 -0400 Original-Received: by mail-bk0-f41.google.com with SMTP id jc3so28908bkc.28 for <13845@debbugs.gnu.org>; Mon, 29 Apr 2013 20:32:51 -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=Rd4TeKgcNFSkfdUv+Gf9SRrisDaDFcOVrwbvSvKv7Qw=; b=S6kvvW5AdZ2IcUQLZkvhNx5wG1ZcUti1xNiz2zFuoXKrv0bDzSeN+L77fUPhlaZZPr cBOg7rl8Cs01cwa3ODN+OEuzvwE3a1zX0COVcruNrH+MTHXuaklHjzcylOZORRXDozQs Uk9NQXSrV9MXsUsySen9iylHHTmt3ccLiqLWhb5CUHpEH7c+iQCc7T0wGtjDfhVRcd70 PusZc21Lsv1o+JsPtqVfDyZsjGFVF3ul0lc7JKjXwy/fg86Faec/4PUvjsV7+K0yGDKg 5QunhErsH7vNX+OpqjpaTeEV0A8lGkaTSZWMzGWZkvdEYpHSsKxAw+tBepY+DHUHOZ4Z tc3w== X-Received: by 10.205.116.131 with SMTP id fi3mr22117384bkc.58.1367292771594; Mon, 29 Apr 2013 20:32:51 -0700 (PDT) Original-Received: by 10.205.113.134 with HTTP; Mon, 29 Apr 2013 20:32:51 -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:73840 Archived-At: Hi, I have a fix ready for this bug. I just got write access to the repository and this will be the first commit I do on my own. I would therefore like to request a code review to make sure I got everything right. My branch is available on launchpad: https://code.launchpad.net/~jpgravel/emacs/bug13845 Please consider all revisions from 112234 to 112242. Revision 112233 is already in the trunk. The core of this branch consists of a rework of the way pending triggers are implemented. The new implementation will allow easy cleanup of dead pending triggers, whenever they are detected. There used to be two lists to keep track of the commands sent to gdb: gdb-handler-alist and gdb-pending-triggers. The first one was storing the callback to invoke when receiving the reply form GDB, the second was flagging some of those commands as pending, to prevent GDB from sending the same commands until the reply is received. With my changes, the two lists are merged into gdb-handler-list, making it easier to cleanly insert and remove handlers. I thought of two ways of detecting dead pending triggers: 1 - It seems that GDB always replies in the same order Emacs sends commands. Replies from GDB are therefore always received in increasing numerical order. Based on this observation, we can remove old pending triggers as soon as newer replies are received from GDB. 2 - We could add a timeout mechanism that would remove pending triggers if no replies is received after a certain amount of time. With this branch, I only implemented option 1, which can be enabled/disabled using `gdb-discard-unordered-replies'. I may implement Option 2 in a subsequent commit. Regarding this branch, I have three questions: - I needed the function cl-find-if and cl-delete-if. It seems there is a long history about not using the functions from cl.el at runtime. It also seems that lots of devs simply re-implemented those functions in their own modules. I couldn't find the functions I needed in a genetic utility package (other than cl.el). Instead, I found them re-implemented as erc-delete-if and org-find-if. For now, I copied those two functions in gdb-mi.el but I can't help but wonder if there is a place where those functions could be moved so that different modules could share their implementation. - I removed two strange ^L characters in gdb-mi.el. Am I right to remove them? Do they mean anything, or are they garbage ASCII character that got there by mistake? - When doing my commit, do I need to specify a bug tracker with the --fixes option, or is "--fixes 13845" enough? Thanks, Jean-Philippe