Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Paul Koning <pkoning@equallogic.com>
Cc: brendan@zen.org, gdb@sources.redhat.com
Subject: Re: cont vs run -- the real deal
Date: Thu, 06 Jul 2006 16:47:00 -0000	[thread overview]
Message-ID: <20060706164653.GA25337@nevyn.them.org> (raw)
In-Reply-To: <17581.15261.101388.267541@gargle.gargle.HOWL>

On Thu, Jul 06, 2006 at 12:34:37PM -0400, Paul Koning wrote:
> >>>>> "Brendan" == Brendan Kehoe <brendan@zen.org> writes:
> 
>  Brendan> Does there exist in writing an explanation of why "run"
>  Brendan> works for native programs and "target sim" targets, but
>  Brendan> "cont" is the correct approach for "target remote ..." ?
>  Brendan> The docs I'm able to see, and the sources for the various
>  Brendan> stubs and infcmd.c all seem to leave it implied somehow.
> 
> With remote targets, you're connecting GDB to a program that has
> already been started (by some other means, done at the remote end).
> So you're gaining control afterwards, which means that you're going to
> continue from where it left off.
> 
> The gdbserver case is a bit confusing: when you start an application
> via gdbserver, you're getting control on the first instruction.  But
> it's still "after" the run, though well before main().

Yes, this is a fairly accurate description.

This is how I've been thinking about it recently: when you connect to
"target child" (native), or "target sim", there's a concept of "nothing
is running now, start something".  When you connect to "target remote",
there isn't such a concept.  You're connected to a physical piece of
hardware and you're looking at its physical registers; they're always
there.

I've been sketching a remote protocol extension, like the existing
extended-remote target but much more complete, which would allow a
remote connection to work along with this model.  In that case, you can
be connected to a remote target but have nothing running, and even
cause the remote stub to attach to something else running on its end of
the wire.

I'll post more about that in a week or three, once I have a chance to
sketch out the usage model a bit better; I've already implemented this
but I'm not entirely happy with how, and I have another project to post
about first (file transfer is next, I think).

-- 
Daniel Jacobowitz
CodeSourcery


      reply	other threads:[~2006-07-06 16:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06 16:29 Brendan Kehoe
2006-07-06 16:34 ` Paul Koning
2006-07-06 16:47   ` Daniel Jacobowitz [this message]

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=20060706164653.GA25337@nevyn.them.org \
    --to=drow@false.org \
    --cc=brendan@zen.org \
    --cc=gdb@sources.redhat.com \
    --cc=pkoning@equallogic.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