Re: new gdb remote packet type

Andrew Cagney
2004-05-12T18:20:00Z

Yes, this is the key, use it conditionally, nice.

+ switch (remote_protocol_p.support)
+ {
+ case PACKET_DISABLE:
+ break;
+ case PACKET_ENABLE:
+ if (fetch_register_using_p (regnum))
+ return;
+ else
+ error ("Protocol error: p packet not recognized by stub");
+ case PACKET_SUPPORT_UNKNOWN:
+ if (fetch_register_using_p (regnum))
+ {
+ /* The stub recognized the 'p' packet. Remember this. */
+ remote_protocol_p.support = PACKET_ENABLE;
+ return;
+ }
+ else
+ {
+ /* The stub does not support the 'P' packet. Use 'G'
+ instead, and don't try using 'P' in the future (it
+ will just waste our time). */
+ remote_protocol_p.support = PACKET_DISABLE;
+ break;
+ }
+ }

sprintf (buf, "g");
To get this in, there's some additional leg work:

- copyright assignment?

- documentation (see gdb/doc/gdb.texinfo near the end)

- a corresponding gdbserver patch

- not to forget, ChangeLogs :-)

Andrew