This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: remote stub store single register command error return value


Another pending patch:
    "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".

As before, ChangeLog is from original submission, the patch itself has 
been regenerated relative to the 20000204 snapshot.

        --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.1.1.5
retrieving revision 1.7
diff -c -r1.1.1.5 -r1.7
*** m32r-stub.c	1999/10/01 08:13:13	1.1.1.5
--- m32r-stub.c	2000/02/03 19:44:48	1.7
***************
*** 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.1.1.4
retrieving revision 1.9
diff -c -r1.1.1.4 -r1.9
*** sparcl-stub.c	1999/09/09 19:12:15	1.1.1.4
--- sparcl-stub.c	2000/02/06 00:16:36	1.9
***************
*** 50,55 ****
--- 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
***************
*** 831,837 ****
  		    hex2mem (ptr, (char *)&registers[regno], 4, 0);
  		else
  		  {
! 		    strcpy (remcomOutBuffer, "P01");
  		    break;
  		  }
  	      }
--- 832,838 ----
  		    hex2mem (ptr, (char *)&registers[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.1.1.4
diff -c -r1.1.1.4 sparclet-stub.c
*** sparclet-stub.c	1999/09/09 19:12:16	1.1.1.4
--- sparclet-stub.c	2000/02/06 00:15:10
***************
*** 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 *)&registers[regno], 4, 0);
                  else
                    {
!                     strcpy (remcomOutBuffer, "P01");
                      break;
                    }
  	      }
--- 938,944 ----
                      hex2mem (ptr, (char *)&registers[regno], 4, 0);
                  else
                    {
!                     strcpy (remcomOutBuffer, "E01");
                      break;
                    }
  	      }


-- 
J.T. Conklin
RedBack Networks

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]