unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jean-Philippe Gravel <jpgravel@gmail.com>
To: 13845@debbugs.gnu.org
Subject: bug#13845: 24.3.50; gud commands stop responding when using gdb-mi
Date: Mon, 29 Apr 2013 23:32:51 -0400	[thread overview]
Message-ID: <CAB3yAohON8JxguoxhmQcQxoUsSo5ohuyD=1xXDX8KCKhdmEwPQ@mail.gmail.com> (raw)
In-Reply-To: <CAB3yAogsVoUKarAPU2KBSsG0yV2PHnSkbCuR0Q5EN2beNbYPPw@mail.gmail.com>

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





  reply	other threads:[~2013-04-30  3:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-01  2:02 bug#13845: 24.3.50; gud commands stop responding when using gdb-mi Jean-Philippe Gravel
2013-04-30  3:32 ` Jean-Philippe Gravel [this message]
2013-04-30 18:54   ` Glenn Morris
2013-05-01  2:46     ` Jean-Philippe Gravel
2013-05-02  2:20       ` Glenn Morris
2013-05-05  5:28         ` Stefan Monnier
2013-05-06  2:05           ` Jean-Philippe Gravel
2013-05-14 18:52             ` Jean-Philippe Gravel
2013-05-14 19:23               ` Glenn Morris
2013-05-15  1:47                 ` Jean-Philippe Gravel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB3yAohON8JxguoxhmQcQxoUsSo5ohuyD=1xXDX8KCKhdmEwPQ@mail.gmail.com' \
    --to=jpgravel@gmail.com \
    --cc=13845@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).