This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

[PATCH] irix5-nat.c, static array allocation


Oops, this was meant to accompany the previous patch.
Now that MAX_REGISTER_RAW_SIZE is gdbarch-ified, you can't
use it to initialize an array.
2002-08-15  Michael Snyder  <msnyder@redhat.com>

	* irix5-nat.c (supply_gregset): Allocate plenty-big buffer
	(32 bytes) instead of using MAX_REGISTER_RAW_SIZE.
	(supply_fpregset): Ditto.

Index: irix5-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/irix5-nat.c,v
retrieving revision 1.18
diff -p -r1.18 irix5-nat.c
*** irix5-nat.c	27 Jul 2002 01:05:07 -0000	1.18
--- irix5-nat.c	16 Aug 2002 01:52:14 -0000
*************** supply_gregset (gregset_t *gregsetp)
*** 56,63 ****
    register int regi;
    register greg_t *regp = &(*gregsetp)[0];
    int gregoff = sizeof (greg_t) - MIPS_REGSIZE;
!   static char zerobuf[MAX_REGISTER_RAW_SIZE] =
!   {0};
  
    for (regi = 0; regi <= CTX_RA; regi++)
      supply_register (regi, (char *) (regp + regi) + gregoff);
--- 56,62 ----
    register int regi;
    register greg_t *regp = &(*gregsetp)[0];
    int gregoff = sizeof (greg_t) - MIPS_REGSIZE;
!   static char zerobuf[32] = {0};
  
    for (regi = 0; regi <= CTX_RA; regi++)
      supply_register (regi, (char *) (regp + regi) + gregoff);
*************** void
*** 120,127 ****
  supply_fpregset (fpregset_t *fpregsetp)
  {
    register int regi;
!   static char zerobuf[MAX_REGISTER_RAW_SIZE] =
!   {0};
  
    /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
  
--- 119,125 ----
  supply_fpregset (fpregset_t *fpregsetp)
  {
    register int regi;
!   static char zerobuf[32] = {0};
  
    /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
  

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