Index: arch/mips/kernel/gdb-stub.c =================================================================== RCS file: /home/cvs/linux/arch/mips/kernel/gdb-stub.c,v retrieving revision 1.15.2.3 diff -u -r1.15.2.3 gdb-stub.c --- arch/mips/kernel/gdb-stub.c 7 Nov 2002 01:47:45 -0000 1.15.2.3 +++ arch/mips/kernel/gdb-stub.c 10 Dec 2002 11:50:35 -0000 @@ -166,7 +166,7 @@ * BUFMAX defines the maximum number of characters in inbound/outbound buffers * at least NUMREGBYTES*2 are needed for register packets */ -#define BUFMAX 2048 +#define BUFMAX 8192 static char input_buffer[BUFMAX]; static char output_buffer[BUFMAX]; @@ -218,7 +218,7 @@ * now, read until a # or end of buffer is found */ while (count < BUFMAX) { - ch = getDebugChar() & 0x7f; + ch = getDebugChar(); if (ch == '#') break; checksum = checksum + ch; @@ -324,19 +324,33 @@ * may_fault is non-zero if we are reading from arbitrary memory, but is currently * not used. */ -static char *hex2mem(char *buf, char *mem, int count, int may_fault) +static char *hex2mem(char *buf, char *mem, int count, int binary, int may_fault) { int i; unsigned char ch; + char *startadr = mem; for (i=0; ireg0+regno*4, ®val, 4); + strcpy (output_buffer, "OK"); + } + break; - /* - * Reset the whole machine (FIXME: system dependent) - */ case 'r': - break; + /* rNN[:SS] Return the value of CPU register NN (size SS) */ + { + int regno, regsize = 4; + ptr = &input_buffer[1]; + if (hexToInt (&ptr, ®no)) { + if (*ptr == ':') { + ptr++; + if (!hexToInt (&ptr, ®size)) + goto error; + } + + if (regsize != 4) + goto error; + (void) mem2hex((char *)®s->reg0+regno*4, + output_buffer, 4, 0); + } + else { + error: + strcpy(output_buffer,"E22 invalid arguments"); + } + } + break; + case 'D': + putpacket("OK"); + return; + /* NOTREACHED */ /* * Step to next instruction