forked from Imagelibrary/binutils-gdb
2003-02-02 Andrew Cagney <ac131313@redhat.com>
* mips-nat.c (zerobuf): Delete. (fetch_inferior_registers): Alloc local zerobuf. (fetch_core_registers): Alloc local zerobuf. * d10v-tdep.c (show_regs): Don't allocate a dynamic array using MAX_REGISTER_RAW_SIZE or MAX_REGISTER_VIRTUAL_SIZE. * thread-db.c (thread_db_store_registers): Ditto. * sh-tdep.c (sh_do_register): Ditto. * rom68k-rom.c (rom68k_supply_one_register): Ditto. * remote-sim.c (gdbsim_store_register): Ditto. * remote-mips.c (mips_wait, mips_fetch_registers): Ditto. * remote-e7000.c (fetch_regs_from_dump): Ditto. * monitor.c (monitor_supply_register): Ditto. * mipsv4-nat.c (supply_gregset, supply_fpregset): Ditto. * mips-nat.c (fetch_inferior_registers): Ditto. * m68klinux-nat.c (fetch_register): Ditto. * lynx-nat.c (fetch_inferior_registers): Ditto. (fetch_inferior_registers): Ditto. * irix4-nat.c (supply_gregset, supply_fpregset): Ditto. * hpux-thread.c (hpux_thread_fetch_registers): Ditto. (hpux_thread_store_registers): Ditto. * hppah-nat.c (fetch_register): Ditto. * hppab-nat.c (fetch_register): Ditto. * hppa-tdep.c (pa_register_look_aside): Ditto. (pa_print_fp_reg, pa_strcat_fp_reg): Ditto. * dve3900-rom.c (fetch_bitmapped_register): Ditto.
This commit is contained in:
@@ -62,9 +62,6 @@
|
||||
: regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) \
|
||||
: 0)
|
||||
|
||||
static char zerobuf[MAX_REGISTER_RAW_SIZE] =
|
||||
{0};
|
||||
|
||||
static void fetch_core_registers (char *, unsigned, int, CORE_ADDR);
|
||||
|
||||
/* Get all registers from the inferior */
|
||||
@@ -73,8 +70,10 @@ void
|
||||
fetch_inferior_registers (int regno)
|
||||
{
|
||||
register unsigned int regaddr;
|
||||
char buf[MAX_REGISTER_RAW_SIZE];
|
||||
char *buf = alloca (max_register_size (current_gdbarch));
|
||||
register int i;
|
||||
char *zerobuf = alloca (max_register_size (current_gdbarch));
|
||||
memset (zerobuf, 0, max_register_size (current_gdbarch));
|
||||
|
||||
deprecated_registers_fetched ();
|
||||
|
||||
@@ -175,6 +174,10 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
|
||||
int bad_reg = -1;
|
||||
register reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */
|
||||
|
||||
char *zerobuf = alloca (max_register_size (current_gdbarch));
|
||||
memset (zerobuf, 0, max_register_size (current_gdbarch));
|
||||
|
||||
|
||||
/* If u.u_ar0 was an absolute address in the core file, relativize it now,
|
||||
so we can use it as an offset into core_reg_sect. When we're done,
|
||||
"register 0" will be at core_reg_sect+reg_ptr, and we can use
|
||||
|
||||
Reference in New Issue
Block a user