aboutsummaryrefslogtreecommitdiff
path: root/gdb/lynx-nat.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-02-02 05:46:14 +0000
committerAndrew Cagney <cagney@redhat.com>2003-02-02 05:46:14 +0000
commit6789195b4218084c38719f3c44e09eaa8108fc12 (patch)
treea61e9d2f314b5af8d49c163486a4862780e058eb /gdb/lynx-nat.c
parente669114a39e5e154e783a8d676bba9fee82b4325 (diff)
downloadfsf-binutils-gdb-6789195b4218084c38719f3c44e09eaa8108fc12.zip
fsf-binutils-gdb-6789195b4218084c38719f3c44e09eaa8108fc12.tar.gz
fsf-binutils-gdb-6789195b4218084c38719f3c44e09eaa8108fc12.tar.bz2
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.
Diffstat (limited to 'gdb/lynx-nat.c')
-rw-r--r--gdb/lynx-nat.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index 37edc2b..b5cb29a 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -282,7 +282,7 @@ fetch_inferior_registers (int regno)
if (whatregs & WHATREGS_GEN)
{
struct econtext ec; /* general regs */
- char buf[MAX_REGISTER_RAW_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
int retval;
int i;
@@ -510,29 +510,31 @@ fetch_inferior_registers (int regno)
ecp = registers_addr (PIDGET (inferior_ptid));
- for (regno = reglo; regno <= reghi; regno++)
- {
- char buf[MAX_REGISTER_RAW_SIZE];
- int ptrace_fun = PTRACE_PEEKTHREAD;
-
+ {
+ char *buf = alloca (max_register_size (current_gdbarch));
+ for (regno = reglo; regno <= reghi; regno++)
+ {
+ int ptrace_fun = PTRACE_PEEKTHREAD;
+
#ifdef M68K
- ptrace_fun = regno == SP_REGNUM ? PTRACE_PEEKUSP : PTRACE_PEEKTHREAD;
+ ptrace_fun = regno == SP_REGNUM ? PTRACE_PEEKUSP : PTRACE_PEEKTHREAD;
#endif
-
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- unsigned int reg;
-
- errno = 0;
- reg = ptrace (ptrace_fun, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) (ecp + regmap[regno] + i), 0);
- if (errno)
- perror_with_name ("ptrace(PTRACE_PEEKUSP)");
-
- *(int *) &buf[i] = reg;
- }
- supply_register (regno, buf);
- }
+
+ for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
+ {
+ unsigned int reg;
+
+ errno = 0;
+ reg = ptrace (ptrace_fun, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) (ecp + regmap[regno] + i), 0);
+ if (errno)
+ perror_with_name ("ptrace(PTRACE_PEEKUSP)");
+
+ *(int *) &buf[i] = reg;
+ }
+ supply_register (regno, buf);
+ }
+ }
}
/* Store our register values back into the inferior.