Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Sandra Loosemore <sandra@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: auto-retry TCP connections for "target remote"
Date: Sun, 28 Dec 2008 11:09:00 -0000	[thread overview]
Message-ID: <20081228110831.GB4216@adacore.com> (raw)
In-Reply-To: <49553C3A.2070000@codesourcery.com>

> When cross-debugging on a target that uses a debugging stub or external 
> simulator that speaks GDB remote protocol, we'd like to have Eclipse 
> automatically launch the stub, as well as GDB, when the user clicks on the 
> "Debug" button.  Unfortunately, there's a race condition here: GDB may try 
> to open the TCP port to the stub before the stub has finished its own 
> initialization and started listening for a connection, which leaves GDB 
> with a "connection refused" error and the stub stuck waiting for a 
> connection that never arrives.

It's really funny that we just started looking at the same issue as
well, as we're extending our own gdb-testsuite infrastructure to
support gdbserver testing.

In our case, we looked at the problem differently, and decided that
the gdb-testsuite would try a few times, rather than retrying at
the TCP level. I agree that a retry mechanism in GDB itself would
be very useful, as every front-end out there would otherwise have
to implement their own retry mechanism. So I really support the idea.

I'm just wondering why you chose to implement the idea inside ser-tcp?
Especially since the name of the associated settings "remote auto-retry"
and "remote connect-timeout" does not suggest that it is specific to
a particular transport protocol.

I wonder if it wouldn't be both simpler and more general to do everything
at the remote.c level.Something like replacing the call to serial_open ()
by a loop that calls serial_open a few times until we either succeed or
exceed the number of retries. What do others think? 

> +set remote auto-retry (on|off)
> +show remote auto-retry

Rather than having an on-off setting, can we have a setting that
allows us to configure the maximum number of retries. If set to zero,
then it's equivalent to "auto-retry off".



-- 
Joel


  parent reply	other threads:[~2008-12-28 11:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-26 20:20 Sandra Loosemore
2008-12-26 20:58 ` Eli Zaretskii
2008-12-28 11:09 ` Joel Brobecker [this message]
2008-12-28 17:51   ` Sandra Loosemore
2008-12-29  3:26     ` Joel Brobecker
2008-12-29  3:55   ` Daniel Jacobowitz
2008-12-29  4:38     ` Joel Brobecker
2008-12-29 13:49       ` Daniel Jacobowitz
2008-12-29 14:13         ` Joel Brobecker
2008-12-29 14:57           ` Sandra Loosemore
2008-12-29 19:31             ` Daniel Jacobowitz

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

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

  git send-email \
    --in-reply-to=20081228110831.GB4216@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sandra@codesourcery.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox