Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Andrew Cagney <cagney@gnu.org>
Cc: gdb@sources.redhat.com
Subject: Re: [remote protocol] Allow qSymbol response to continue packets
Date: Thu, 11 Mar 2004 23:38:00 -0000	[thread overview]
Message-ID: <20040311233833.GA32710@nevyn.them.org> (raw)
In-Reply-To: <4050F435.1040906@gnu.org>

On Thu, Mar 11, 2004 at 06:20:21PM -0500, Andrew Cagney wrote:
> Protocol's can't make such assumptions.

I disagree.  I consider symbol lookup a _fundamentally non-blocking_
operation, and I'm sure there are other similar fundamentally
uninterruptible responses.  For instance, any notification events (for
things similar to tracepoints, though I don't know if it would apply to
our tracepoint implementation, since the remote protocol bits of
tracepoint support do not have documentation that I can find). Or a
revised version of the 'console output' response that doesn't have the
protocol-breaking problems you described to me the last time I tried to
model something after it.

> >I don't think we need to use the heavy-weight mechanism which supports
> >interruption for operations that don't need to be interrupted, and I
> >can't see a reason to support interruption of this lookup.  If you do,
> >please enlighten me.
> 
> I think we'll have to disagree on our definitions of heavy weight (if F 
> it is too heavy weight then perhaphs we need to remove a few things from 
> it).
> 
> The protocol needs to specify the failure states, the F packet provides 
> that for free.  As I said, I'm really not interested in cooking up 
> another callback packet with a different set of failure states.  One is 
> enough.
> 
> >>>You need to handle such race conditions anyway.
> >>>
> >>>-> c
> >>><- qSymbol | cntrl-c ->
> >
> >
> >That's a different problem, and it is already correctly handled by
> >gdbserver.  We'll write out the qSymbol, read in the Ctrl-C, signal the
> >inferior, look again for an ACK, eventually get the ACK.  Then we'd
> >wait for and get a qSymbol reply, resume the suspended thread that made
> >the lookup request, wait for it, and see the SIGINT we created.
> 
> If you've code to handle that you've code to handle a packet containing:
> 
> - <retry><cntrl-C>
> - <symbol><cntrl-C>

That's not correct, unfortunately.  A packet containing
<symbol><cntrl-C>, sure, that's easy.  But <retry><cntrl-C> is pretty
hard.  The call stack at this point goes through the middle of
libthread_db; I can't resume the inferior to give it a real SIGINT
without have to jump through hoops to re-initialize libthread_db after
processing the SIGINT, so I would have to:

 - stop all other running threads, if there are any; there could be
   depending on what libthread_db is trying to look up
 - forge a stop-with-SIGINT packet
 - handle whatever packets GDB sends me while I'm stopped
 - wait for GDB to resume
 - cause the resume to trigger re-issue of the queued qSymbol "stop
   response"
 - repeat until this succeeds
 - return that result to libthread_db

The long and short of it is that I'd have to duplicate or considerably
modularize the packet processing, to make the main loop re-entrant, to
support interruption of an otherwise non-blocking operation.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2004-03-11 23:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-06 23:52 Daniel Jacobowitz
2004-03-07  5:45 ` Eli Zaretskii
2004-03-11 20:06 ` Andrew Cagney
2004-03-11 20:16   ` Daniel Jacobowitz
2004-03-11 21:27     ` Andrew Cagney
2004-03-11 21:40       ` Daniel Jacobowitz
2004-03-11 23:21         ` Andrew Cagney
2004-03-11 23:38           ` Daniel Jacobowitz [this message]
2004-03-12 19:45             ` Daniel Jacobowitz
2004-03-17 16:07             ` Andrew Cagney

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=20040311233833.GA32710@nevyn.them.org \
    --to=drow@false.org \
    --cc=cagney@gnu.org \
    --cc=gdb@sources.redhat.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