This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFC] Bug in remote.c
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 10 Jun 2003 00:47:17 +0200 (CEST)
- Subject: [RFC] Bug in remote.c
While trying to get gdbserver working on FreeBSD, I discovered
something that really smells like a bug in remote.c.
In remote_prepare_to_store() we have the following:
/* Make sure the entire registers array is valid. */
switch (remote_protocol_P.support)
{
case PACKET_DISABLE:
case PACKET_SUPPORT_UNKNOWN:
/* NOTE: This isn't rs->sizeof_g_packet because here, we are
forcing the register cache to read its and not the target
registers. */
deprecated_read_register_bytes (0, (char *) NULL,
DEPRECATED_REGISTER_BYTES); /* OK */
Recently, Andrew has removed the need to set REGISTER_BYTES and turned
it into DEPRECATED_REGISTER_BYTES. On targets that don't set it,
DEPRECATED_REGISTER_BYTES will be zero, which reduces this
deprecated_read_register_bytes call to a no-op. As a result GDB tries
to write garbage into the registers on the remote target, and sooner
or later things blow up in your face.
A possible solution would be to introduce a new function that
completely fills the register cache upon request. Comments?
Mark