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]

Re: [RFC] Extend remote protocol to allow symbol look-up service.



> Does anyone else have an opinion?  I don't like unreadable messages.

The packet intent is still readable, just not the symbol.  I know its a
pain.  However I'd rather that pain then have to later go and
re-implement the packet because it did turn up problems. Look at the
constant retro-fitting required by the X packet.

> > Is the protocol stateless?  That is, would repeating the query:
> >
> >         qSymbol::__pthread_max_threads
> >
> > always return the same value?

Oops, not quite the right question.

> It's not stateless; both the target and the debugger have state.
> On the debugger, the 'state' is whether the symbol is available or not.
> On the target, the state is whether this symbol's value has been obtained.
> Also whether it has been requested since the last shared library event.
> The target should ask for a given symbol only once per shared library
> event.  There won't be any harm in asking for the same symbol twice --
> except for the possibility of getting into an infinite loop.

Would the following sequence (first line is GDB -> target) occure:

	-> qSymbol:4321:sym1
	<- qSymbol:sym2

	-> qSymbol:4321:sym1
	<- qSymbol:sym2

	-> qSymbol:1234:sym2
	<- qSymbol:sym3

>From what you've said, I think that is the case and that I think that is
the correct behavour. The target should be using the last symbol it
received from GDB to determine the next symbol.  It should not be solely
reliant on internal state.

Compare this to the ThreadInfo packet :-(

--

What about a simplification along the lines of:

	-> qSymbol
	<- ""	Don't know what you're talking about
	<- OK	Thanks, that's all
	<- HEX-SYMBOL
		please try to tell me the value of the symbol.

	-> qSymbol:BE-HEX-VAL:HEX-SYMBOL
	<- ""	Don't know what you're talking about
	<- OK	Thanks, that's all
	<- HEX-SYMBOL
		please try to tell me the value of the symbol.

With a note that the target must use the packet contents when
determining the next symbol to request query.

	Andrew


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