* target remote-attach? @ 2008-02-29 20:23 Michael Snyder 2008-02-29 20:26 ` Paul Koning 2008-02-29 20:29 ` Daniel Jacobowitz 0 siblings, 2 replies; 4+ messages in thread From: Michael Snyder @ 2008-02-29 20:23 UTC (permalink / raw) To: gdb Just thinking aloud... we ought to have a sort of "remote-attach" command, that would allow us to connect to a remote target when it is already in a "run" state. Right now the initial handshake protocol prevents doing that. The target might be waiting to tell gdb "I stopped because of a SIGTRAP", or similar, or it might actually be running, and need to be stopped via a serial BRK or the like. After that, we would be in a sane state from which we could do the usual remote_open handshake. Or is there something like that already? ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: target remote-attach? 2008-02-29 20:23 target remote-attach? Michael Snyder @ 2008-02-29 20:26 ` Paul Koning 2008-02-29 22:20 ` Michael Snyder 2008-02-29 20:29 ` Daniel Jacobowitz 1 sibling, 1 reply; 4+ messages in thread From: Paul Koning @ 2008-02-29 20:26 UTC (permalink / raw) To: msnyder; +Cc: gdb >>>>> "Michael" == Michael Snyder <msnyder@specifix.com> writes: Michael> Just thinking aloud... we ought to have a sort of Michael> "remote-attach" command, that would allow us to connect to a Michael> remote target when it is already in a "run" state. Right Michael> now the initial handshake protocol prevents doing that. Michael> The target might be waiting to tell gdb "I stopped because Michael> of a SIGTRAP", or similar, or it might actually be running, Michael> and need to be stopped via a serial BRK or the like. After Michael> that, we would be in a sane state from which we could do the Michael> usual remote_open handshake. Michael> Or is there something like that already? I haven't seen the problem you mention. gdbserver allows attaching to a running process (by PID) and that has always worked for me. For that matter, it works also with a native gdb (local debug). Similarly, I've used the remote target protocol for kernel debug, connecting after the kernel panic handler has invoked the stub via a breakpoint instruction. That too works fine. paul ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: target remote-attach? 2008-02-29 20:26 ` Paul Koning @ 2008-02-29 22:20 ` Michael Snyder 0 siblings, 0 replies; 4+ messages in thread From: Michael Snyder @ 2008-02-29 22:20 UTC (permalink / raw) To: Paul Koning; +Cc: gdb On Fri, 2008-02-29 at 15:23 -0500, Paul Koning wrote: > >>>>> "Michael" == Michael Snyder <msnyder@specifix.com> writes: > > Michael> Just thinking aloud... we ought to have a sort of > Michael> "remote-attach" command, that would allow us to connect to a > Michael> remote target when it is already in a "run" state. Right > Michael> now the initial handshake protocol prevents doing that. > > Michael> The target might be waiting to tell gdb "I stopped because > Michael> of a SIGTRAP", or similar, or it might actually be running, > Michael> and need to be stopped via a serial BRK or the like. After > Michael> that, we would be in a sane state from which we could do the > Michael> usual remote_open handshake. > > Michael> Or is there something like that already? > > I haven't seen the problem you mention. gdbserver allows attaching to > a running process (by PID) and that has always worked for me. For > that matter, it works also with a native gdb (local debug). > > Similarly, I've used the remote target protocol for kernel debug, > connecting after the kernel panic handler has invoked the stub via a > breakpoint instruction. That too works fine. Yeah, the situation I have in mind is, say you've already been connected, and you've said "continue", and then while gdb was waiting for the target to say "OK, I've stopped", you lost the connection. The situation you mention (native "attach") is kind of analogous. You want to connect to a running target, possibly interrupt it, (native attach sends the child a signal), and then handshake. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: target remote-attach? 2008-02-29 20:23 target remote-attach? Michael Snyder 2008-02-29 20:26 ` Paul Koning @ 2008-02-29 20:29 ` Daniel Jacobowitz 1 sibling, 0 replies; 4+ messages in thread From: Daniel Jacobowitz @ 2008-02-29 20:29 UTC (permalink / raw) To: gdb On Fri, Feb 29, 2008 at 12:14:51PM -0800, Michael Snyder wrote: > Just thinking aloud... we ought to have a sort of "remote-attach" > command, that would allow us to connect to a remote target when it > is already in a "run" state. Right now the initial handshake > protocol prevents doing that. > > The target might be waiting to tell gdb "I stopped because of > a SIGTRAP", or similar, or it might actually be running, and > need to be stopped via a serial BRK or the like. After that, > we would be in a sane state from which we could do the usual > remote_open handshake. > > Or is there something like that already? It's true that we can't attach to a remote stub where the target is currently running; we'll be looking at that in the context of non-stop debugging but probably by changing the remote protocol somewhat. With the existing protocol it's hard because sending a query may be interpreted as an interrupt. If the stub's waiting to send something, how's the user supposed to figure out if it already has or not? -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-29 22:09 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-02-29 20:23 target remote-attach? Michael Snyder 2008-02-29 20:26 ` Paul Koning 2008-02-29 22:20 ` Michael Snyder 2008-02-29 20:29 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox