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

> 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.

Unfortunatly, an event driven state machine is the "text book correct" 
way of implementing a protocol (anything less is a crock).  Thats why I 
wrote RDA the way I did, and thats why gdb's remote code continues to 
need an overhaul (hopefully eventually sharing code with gdbserver).  If 
the original author of that code had thought to read s/w telco text, 
your and my life today would have been a lot easier, sigh.

Anyway, if F is used as the interaction model, should F also be used as 
the packet format?  Can I suggest, for queries to GDB, 'f' be used as 
the packet prefix letter but use 'F' for the rest of the specification. 
  That would give us:

<- fSymbol,<symbol-name>

-> f0,0,;<symbol-value>
or
-> f0,EINTR,;
or
-> f0,EINTR,C;

I suspect that is sufficient (looking at the code I think "F" can be 
simplified somewhat - time permitting :-().

The other option would be to generate T00 packets - cause GDB to go 
through the motions but then resume it?

Andrew



      parent reply	other threads:[~2004-03-17 16:07 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
2004-03-12 19:45             ` Daniel Jacobowitz
2004-03-17 16:07             ` Andrew Cagney [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=405877DB.3060700@gnu.org \
    --to=cagney@gnu.org \
    --cc=drow@false.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