From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Michael Snyder Cc: gdb-patches@sources.redhat.com, jtc@redback.com Subject: Re: [RFC] Extend remote protocol to allow symbol look-up service. Date: Fri, 27 Apr 2001 08:20:00 -0000 Message-id: <3AE98DE1.84FE55D5@cygnus.com> References: <3ADCD1B8.772C5247@cygnus.com> <3AE21A6E.EEFBF3CC@cygnus.com> <3AE8928A.18E07030@cygnus.com> X-SW-Source: 2001-04/msg00261.html > 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