diff options
author | Daniel Jacobowitz <dan@debian.org> | 2002-08-19 14:24:56 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2002-08-19 14:24:56 +0000 |
commit | c6e3811ab20f4b18262ea08d2761d075638d575b (patch) | |
tree | e36d66ecdd76d3b5cf95f4e0eb4d683159435a72 | |
parent | 55749617fd8480fc32bf2a288cf32a0d1e3666ff (diff) | |
download | gdb-c6e3811ab20f4b18262ea08d2761d075638d575b.tar.gz |
* config/mips/tm-linux.h (REALTIME_LO, REALTIME_HI): Define
conditionally.
(JB_PC, JB_ELEMENT_SIZE): Rename to MIPS_LINUX_JB_PC and
MIPS_LINUX_JB_ELEMENT_SIZE.
* mips-linux-tdep.c (supply_gregset, fill_gregset): Use alloca
for MAX_REGISTER_RAW_SIZE arrays.
(mips_linux_get_longjmp_target): Use MIPS_LINUX_JB_PC and
MIPS_LINUX_JB_ELEMENT_SIZE.
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/config/mips/tm-linux.h | 6 | ||||
-rw-r--r-- | gdb/mips-linux-tdep.c | 17 |
3 files changed, 26 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4b90dc8e0d4..f85159396ae 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2002-08-19 Daniel Jacobowitz <drow@mvista.com> + + * config/mips/tm-linux.h (REALTIME_LO, REALTIME_HI): Define + conditionally. + (JB_PC, JB_ELEMENT_SIZE): Rename to MIPS_LINUX_JB_PC and + MIPS_LINUX_JB_ELEMENT_SIZE. + * mips-linux-tdep.c (supply_gregset, fill_gregset): Use alloca + for MAX_REGISTER_RAW_SIZE arrays. + (mips_linux_get_longjmp_target): Use MIPS_LINUX_JB_PC and + MIPS_LINUX_JB_ELEMENT_SIZE. + 2002-08-19 Pierre Muller <muller@ics.u-strasbg.fr> * i387-tdep.c (i387_print_float_info): Fix typo in comment. diff --git a/gdb/config/mips/tm-linux.h b/gdb/config/mips/tm-linux.h index 4236ea8bec4..68233c0a61b 100644 --- a/gdb/config/mips/tm-linux.h +++ b/gdb/config/mips/tm-linux.h @@ -33,8 +33,10 @@ /* GNU/Linux MIPS has __SIGRTMAX == 127. */ +#ifndef REALTIME_LO #define REALTIME_LO 32 #define REALTIME_HI 128 +#endif #include "config/tm-linux.h" @@ -51,8 +53,8 @@ extern struct link_map_offsets *mips_linux_svr4_fetch_link_map_offsets (void); /* Details about jmp_buf. */ -#define JB_ELEMENT_SIZE 4 -#define JB_PC 0 +#define MIPS_LINUX_JB_ELEMENT_SIZE 4 +#define MIPS_LINUX_JB_PC 0 /* Figure out where the longjmp will land. Slurp the arguments out of the stack. We expect the first arg to be a pointer to the jmp_buf structure diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index 3706e2d8673..b8d41db2e3b 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -56,8 +56,8 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; /* Figure out where the longjmp will land. We expect the first arg to be a pointer to the jmp_buf structure from - which we extract the pc (JB_PC) that we will land at. The pc is copied - into PC. This routine returns 1 on success. */ + which we extract the pc (MIPS_LINUX_JB_PC) that we will land at. The pc + is copied into PC. This routine returns 1 on success. */ int mips_linux_get_longjmp_target (CORE_ADDR *pc) @@ -67,8 +67,9 @@ mips_linux_get_longjmp_target (CORE_ADDR *pc) jb_addr = read_register (A0_REGNUM); - if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf, - TARGET_PTR_BIT / TARGET_CHAR_BIT)) + if (target_read_memory (jb_addr + + MIPS_LINUX_JB_PC * MIPS_LINUX_JB_ELEMENT_SIZE, + buf, TARGET_PTR_BIT / TARGET_CHAR_BIT)) return 0; *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); @@ -83,7 +84,9 @@ supply_gregset (elf_gregset_t *gregsetp) { int regi; elf_greg_t *regp = *gregsetp; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE); + + memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); for (regi = EF_REG0; regi <= EF_REG31; regi++) supply_register ((regi - EF_REG0), (char *)(regp + regi)); @@ -172,7 +175,9 @@ void supply_fpregset (elf_fpregset_t *fpregsetp) { register int regi; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE); + + memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); for (regi = 0; regi < 32; regi++) supply_register (FP0_REGNUM + regi, |