This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] remote_rcmd


On Sun, Jul 14, 2002 at 01:48:38PM -0400, Andrew Cagney wrote:

>
>Actually, the current docs suggest:
>
>-> qRcmd command
><- O <HEX-OUTPUT>
><- O <HEX-OUTPUT>
><- <HEX-OUTPUT>
><- OK

Where?

                              COMMAND (hex encoded) is passed to the
                              local interpreter for execution.  Invalid
                              commands should be reported using the
                              output string.  Before the final result
                              packet, the target may also respond with
                              number of intermediate `O'OUTPUT console
                              output packets.
``before the final _result_ packet''

...

               reply OUTPUT   A command response with the hex encoded
                              output string OUTPUT.
This is one of several ``_result_'' packets.

>which confuses me.  What's supposed to differentiate the O <HEX-OUTPUT>
>packets from the final <HEX-OUTPUT> packet (what difference in purpose,
>I mean)?

Valid replies to ``qRcmd'' are:

	``OK''
	``''
	``<HEX-OUTPUT>''
	``Enn''

The ``O'' packet is something separate.

I think I wasn't clear in my question.  qRcmd can send some O packets,
which are supposed to provide some ambiguous form of "output" from the
"console", and then one <HEX-OUTPUT> packet.  What is supposed to go in
which?  It doesn't make sense to me to limit this to one <HEX-OUTPUT>
packet if it is arbitrary output; it may simply be too large.  On the
other hand I'm not sure I see why both O<HEX> and <HEX> are allowed.
Sorry, you've lost me. There are a number of choices and which is used is left to the implementor. Sequences like:

<- O output
<- O output
<- OK
and
<- O output
<- output
and
<- output
and
<- OK

are all valid. To be honest, I've only seen targets use the last two. Typically the command response is so small that it can be safely squeesed into a single reply packet.

Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]