This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: new gdb remote packet type
- From: Andrew Cagney <cagney at gnu dot org>
- To: Robert Picco <Robert dot Picco at hp dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 12 May 2004 14:20:36 -0400
- Subject: Re: new gdb remote packet type
- References: <407F2BAB.4060408@hp.com> <40802711.3040104@gnu.org> <4087E8C0.30806@hp.com> <4087EE4B.4010805@gnu.org> <40912015.7070902@hp.com> <40928D64.8010209@gnu.org> <4097D9DE.2030004@hp.com> <40993C21.1040500@gnu.org> <409A95AB.6020101@hp.com>
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