aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-xdep.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1991-11-04 23:15:31 +0000
committerPer Bothner <per@bothner.com>1991-11-04 23:15:31 +0000
commitabefb1f107afeef549f30b47d73dd0b4d9cbe08b (patch)
tree71d887f16381f6ee775ccc1e3a3c216edcd50353 /gdb/mips-xdep.c
parent6a8687f3c73e4054f225e034a009afb7803db294 (diff)
downloadgdb-abefb1f107afeef549f30b47d73dd0b4d9cbe08b.zip
gdb-abefb1f107afeef549f30b47d73dd0b4d9cbe08b.tar.gz
gdb-abefb1f107afeef549f30b47d73dd0b4d9cbe08b.tar.bz2
* infrun.c: Fixed typo in comment.
* utils.c: All the v*fprintf emulation is now in libiberty, so we can get rid of some junk. * xm-sun3os4.h, xm-sun4os4.h, xconfig/decstation, xconfig/i386sco, xconfig/sun3os4, xconfig/sun4os4: Don`t need HAVE_STRSTR any more. * m68k-pinsn.c (print_insn_arg): Support BB/BW/BL type operands, as used by branch instructions. * gmalloc.c: Fix prototype of memcpy. * elfread.c: Comment out register_addr, since it conflicts with the one in coredep.c. * buildsym.h: Remove extern declarations of two functions that are really static in buildsym.c. * tm-mips.h: Add symbolic names for more registers. * mips-xdep.c (store_inferior_registers): Use new register names. * xm-mips.h: Simplify REGISTER_U_ADDR, since it is now only used for core files, not ptrace. Therefore, the KERNEL_U_ADDR hack is no longer needed. The mapping to ptrace number is now in in mips-xdep.c. * mips-xdep.c: Define REGISTER_PTRACE_ADDR (using the mapping from the old REGISTER_U_ADDR), and use it in {fetch,store}_inferior_registers. * mipsread.c: Rename #include ecoff.h to new name coff-mips.h. * mips-tdep.c (mips_push_dummy_frame, mips_pop_frame): Save/restore FP regs correctly (?). * dbxread.c: Remove duplicate define_symbol and type_synonym_name (these had been previously moved to buildsym.c). Hence, define_symbol becomes extern instead of static. * buildsym.c (read_struct_type): Comment out bogus handling of C++ operator methods. Minor hacking of reading of class contexts. Make define_symbol non-static, so dbxread.c can call it.
Diffstat (limited to 'gdb/mips-xdep.c')
-rw-r--r--gdb/mips-xdep.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/gdb/mips-xdep.c b/gdb/mips-xdep.c
index 51984e7..a5b0b03 100644
--- a/gdb/mips-xdep.c
+++ b/gdb/mips-xdep.c
@@ -73,6 +73,19 @@ store_inferior_registers (regno)
#else
+/* Map gdb internal register number to ptrace address. */
+
+#define REGISTER_PTRACE_ADDR(regno) \
+ (regno < 32 ? regno \
+ : regno == PC_REGNUM ? 96 \
+ : regno == CAUSE_REGNUM ? 97 \
+ : regno == HI_REGNUM ? 98 \
+ : regno == LO_REGNUM ? 99 \
+ : regno == FCRCS_REGNUM ? 100 \
+ : regno == FCRIR_REGNUM ? 101 \
+ : regno >= FP0_REGNUM ? regno - (FP0_REGNUM-32)\
+ : 0)
+
/* Get all registers from the inferior */
void
@@ -87,7 +100,7 @@ fetch_inferior_registers ()
for (regno = 1; regno < NUM_REGS; regno++)
{
- regaddr = register_addr (regno, 1);
+ regaddr = REGISTER_PTRACE_ADDR (regno);
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
{
*(int *) &buf[i] = ptrace (3, inferior_pid, regaddr, 0);
@@ -113,7 +126,7 @@ store_inferior_registers (regno)
if (regno > 0)
{
- regaddr = register_addr (regno, 1);
+ regaddr = REGISTER_PTRACE_ADDR (regno);
errno = 0;
ptrace (6, inferior_pid, regaddr, read_register (regno));
if (errno != 0)
@@ -124,10 +137,11 @@ store_inferior_registers (regno)
}
else
{
- for (regno = 1; regno < NUM_REGS; regno++)
+ for (regno = 0; regno < NUM_REGS; regno++)
{
- if (regno == 32 || regno == 35 || regno == 36
- || regno == 71 || regno == FP_REGNUM)
+ if (regno == ZERO_REGNUM || regno == PS_REGNUM
+ || regno == BADVADDR_REGNUM || regno == CAUSE_REGNUM
+ || regno == FCRIR_REGNUM || regno == FP_REGNUM)
continue;
regaddr = register_addr (regno, 1);
errno = 0;