This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] irix5-nat.c, static array allocation
- From: Michael Snyder <msnyder at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: cagney at redhat dot com
- Date: Thu, 15 Aug 2002 18:40:04 -0700
- Subject: [PATCH] irix5-nat.c, static array allocation
- Organization: Red Hat, Inc.
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. */