This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
store single register command error return value
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: store single register command error return value
- From: jtc at redback dot com (J.T. Conklin)
- Date: 18 Oct 1999 11:25:44 -0700
- Reply-To: jtc at redback dot com
As pointed out on the gdb list earlier today, some of the sample stubs
return "P01" when the 'store single register' command (P) fails. This
does not conform to the remote protocol spec, which states that values
of the form "ENN" are to be used for reporting errors.
GDB does not currently check return value of register store commands,
If this is fixed, it should check for "OK" instead of "ENN".
--jtc
1999-10-18 J.T. Conklin <jtc@redback.com>
* m32r-stub.c, sparcl-stub.c, sparclet-stub.c (handle_exception):
Return E01 instead of P01 when 'P' command fails.
Index: m32r-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/m32r-stub.c,v
retrieving revision 1.6
diff -c -r1.6 m32r-stub.c
*** m32r-stub.c 1999/10/01 08:56:04 1.6
--- m32r-stub.c 1999/10/18 18:01:06
***************
*** 425,431 ****
strcpy (remcomOutBuffer, "OK");
break;
}
! strcpy (remcomOutBuffer, "P01");
break;
}
case 'G': /* set the value of the CPU registers - return OK */
--- 425,431 ----
strcpy (remcomOutBuffer, "OK");
break;
}
! strcpy (remcomOutBuffer, "E01");
break;
}
case 'G': /* set the value of the CPU registers - return OK */
Index: sparcl-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/sparcl-stub.c,v
retrieving revision 1.7
diff -c -r1.7 sparcl-stub.c
*** sparcl-stub.c 1999/09/01 06:29:31 1.7
--- sparcl-stub.c 1999/10/18 18:02:44
***************
*** 831,837 ****
hex2mem (ptr, (char *)®isters[regno], 4, 0);
else
{
! strcpy (remcomOutBuffer, "P01");
break;
}
}
--- 831,837 ----
hex2mem (ptr, (char *)®isters[regno], 4, 0);
else
{
! strcpy (remcomOutBuffer, "E01");
break;
}
}
Index: sparclet-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/sparclet-stub.c,v
retrieving revision 1.7
diff -c -r1.7 sparclet-stub.c
*** sparclet-stub.c 1999/09/01 06:29:31 1.7
--- sparclet-stub.c 1999/10/18 18:03:11
***************
*** 50,56 ****
*
* g return the value of the CPU registers hex data or ENN
* G set the value of the CPU registers OK or ENN
! * P set the value of a single CPU register OK or P01 (???)
*
* mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
* MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
--- 50,56 ----
*
* g return the value of the CPU registers hex data or ENN
* G set the value of the CPU registers OK or ENN
! * P set the value of a single CPU register OK or ENN
*
* mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
* MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
***************
*** 938,944 ****
hex2mem (ptr, (char *)®isters[regno], 4, 0);
else
{
! strcpy (remcomOutBuffer, "P01");
break;
}
}
--- 938,944 ----
hex2mem (ptr, (char *)®isters[regno], 4, 0);
else
{
! strcpy (remcomOutBuffer, "E01");
break;
}
}
--
J.T. Conklin
RedBack Networks