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]

more stub patches, make input/output buffers static


It turns out that my earlier patch had an error --- getpacket() was
changed to use to &remcomInBuffer[0], but that variable had not yet
been declared/defined.  This patch fixes up that goof, plus it adds
the static qualifier to those variables.  Not that it's likely that 
a user is going to have variables with those names, but it's better
to be safe none the less...

        --jtc

1999-08-31  J.T. Conklin  <jtc@redback.com>

	* i386-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c,
 	sparcl-stub.c, sparclet-stub.c (remcomInBuffer, remcomOutBuffer):
	Make static.

Index: i386-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/i386-stub.c,v
retrieving revision 1.6
diff -c -r1.6 i386-stub.c
*** i386-stub.c	1999/08/31 18:54:34	1.6
--- i386-stub.c	1999/09/01 06:08:54
***************
*** 456,461 ****
--- 456,464 ----
    return (-1);
  }
  
+ static char remcomInBuffer[BUFMAX];
+ static char remcomOutBuffer[BUFMAX];
+ 
  /* scan for the sequence $<data>#<checksum>     */
  
  unsigned char *
***************
*** 557,564 ****
  
  }
  
- char  remcomInBuffer[BUFMAX];
- char  remcomOutBuffer[BUFMAX];
  static short error;
  
  
--- 560,565 ----
Index: m68k-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/m68k-stub.c,v
retrieving revision 1.6
diff -c -r1.6 m68k-stub.c
*** m68k-stub.c	1999/08/31 18:54:35	1.6
--- m68k-stub.c	1999/09/01 06:10:31
***************
*** 522,527 ****
--- 522,530 ----
    return (-1);
  }
  
+ static char remcomInBuffer[BUFMAX];
+ static char remcomOutBuffer[BUFMAX];
+ 
  /* scan for the sequence $<data>#<checksum>     */
  
  unsigned char *
***************
*** 623,630 ****
    
  }
  
- char  remcomInBuffer[BUFMAX];
- char  remcomOutBuffer[BUFMAX];
  static short error;
  
  
--- 626,631 ----
Index: sh-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/sh-stub.c,v
retrieving revision 1.7
diff -c -r1.7 sh-stub.c
*** sh-stub.c	1999/08/31 18:54:36	1.7
--- sh-stub.c	1999/09/01 06:10:54
***************
*** 277,284 ****
  stepData instrBuffer;
  char stepped;
  static const char hexchars[] = "0123456789abcdef";
! char remcomInBuffer[BUFMAX];
! char remcomOutBuffer[BUFMAX];
  
  char highhex(int  x)
  {
--- 277,284 ----
  stepData instrBuffer;
  char stepped;
  static const char hexchars[] = "0123456789abcdef";
! static char remcomInBuffer[BUFMAX];
! static char remcomOutBuffer[BUFMAX];
  
  char highhex(int  x)
  {
Index: sparc-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/sparc-stub.c,v
retrieving revision 1.6
diff -c -r1.6 sparc-stub.c
*** sparc-stub.c	1999/08/31 18:54:37	1.6
--- sparc-stub.c	1999/09/01 06:11:26
***************
*** 281,286 ****
--- 281,289 ----
    return -1;
  }
  
+ static char remcomInBuffer[BUFMAX];
+ static char remcomOutBuffer[BUFMAX];
+ 
  /* scan for the sequence $<data>#<checksum>     */
  
  unsigned char *
***************
*** 378,386 ****
      }
    while (getDebugChar() != '+');
  }
- 
- static char remcomInBuffer[BUFMAX];
- static char remcomOutBuffer[BUFMAX];
  
  /* Indicate to caller of mem2hex or hex2mem that there has been an
     error.  */
--- 381,386 ----
Index: sparcl-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/sparcl-stub.c,v
retrieving revision 1.6
diff -c -r1.6 sparcl-stub.c
*** sparcl-stub.c	1999/08/31 18:54:37	1.6
--- sparcl-stub.c	1999/09/01 06:11:43
***************
*** 377,382 ****
--- 377,385 ----
    return -1;
  }
  
+ static char remcomInBuffer[BUFMAX];
+ static char remcomOutBuffer[BUFMAX];
+ 
  /* scan for the sequence $<data>#<checksum>     */
  
  unsigned char *
***************
*** 474,482 ****
      }
    while (getDebugChar() != '+');
  }
- 
- static char remcomInBuffer[BUFMAX];
- static char remcomOutBuffer[BUFMAX];
  
  /* Indicate to caller of mem2hex or hex2mem that there has been an
     error.  */
--- 477,482 ----
Index: sparclet-stub.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/sparclet-stub.c,v
retrieving revision 1.6
diff -c -r1.6 sparclet-stub.c
*** sparclet-stub.c	1999/08/31 18:54:38	1.6
--- sparclet-stub.c	1999/09/01 06:12:10
***************
*** 447,452 ****
--- 447,455 ----
    return -1;
  }
  
+ static char remcomInBuffer[BUFMAX];
+ static char remcomOutBuffer[BUFMAX];
+ 
  /* scan for the sequence $<data>#<checksum>     */
  
  unsigned char *
***************
*** 544,552 ****
      }
    while (getDebugChar() != '+');
  }
- 
- static char remcomInBuffer[BUFMAX];
- static char remcomOutBuffer[BUFMAX];
  
  /* Indicate to caller of mem2hex or hex2mem that there has been an
     error.  */
--- 547,552 ----


-- 
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]