diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-09-13 22:15:33 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-09-13 22:15:33 +0000 |
commit | 6415945597c5668558224a7241d6592d76419bc9 (patch) | |
tree | 1a75e7ec5ca7dbb2118f2042fb07ac12e772a686 /gdb | |
parent | 78d0849c9dd4056ecbb38b01408f416b050b5438 (diff) | |
download | gdb-6415945597c5668558224a7241d6592d76419bc9.zip gdb-6415945597c5668558224a7241d6592d76419bc9.tar.gz gdb-6415945597c5668558224a7241d6592d76419bc9.tar.bz2 |
Fri Sep 13 14:59:55 2002 Andrew Cagney <cagney@redhat.com>
* mips-tdep.c (read_next_frame_reg): Re-hack using
frame_register_unwind.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 30 |
2 files changed, 24 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 85319f9..6ef6233 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Fri Sep 13 14:59:55 2002 Andrew Cagney <cagney@redhat.com> + + * mips-tdep.c (read_next_frame_reg): Re-hack using + frame_register_unwind. + Fri Sep 13 07:42:09 2002 Andrew Cagney <cagney@redhat.com> * mips-tdep.c (mips_get_saved_register): Re-hack using diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 268894a..5071446 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -1589,21 +1589,29 @@ mips_frame_init_saved_regs (struct frame_info *frame) static CORE_ADDR read_next_frame_reg (struct frame_info *fi, int regno) { - for (; fi; fi = fi->next) + int optimized; + CORE_ADDR addr; + int realnum; + enum lval_type lval; + void *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); + frame_register_unwind (fi, regno, &optimized, &lval, &addr, &realnum, + raw_buffer); + /* FIXME: cagney/2002-09-13: This is just soooo bad. The MIPS + should have a pseudo register range that correspons to the ABI's, + rather than the ISA's, view of registers. These registers would + then implicitly describe their size and hence could be used + without the below munging. */ + if (lval == lval_memory) { - /* We have to get the saved sp from the sigcontext - if it is a signal handler frame. */ - if (regno == SP_REGNUM && !fi->signal_handler_caller) - return fi->frame; - else + if (regno < 32) { - if (fi->saved_regs == NULL) - FRAME_INIT_SAVED_REGS (fi); - if (fi->saved_regs[regno]) - return read_memory_integer (ADDR_BITS_REMOVE (fi->saved_regs[regno]), MIPS_SAVED_REGSIZE); + /* Only MIPS_SAVED_REGSIZE bytes of GP registers are + saved. */ + return read_memory_integer (addr, MIPS_SAVED_REGSIZE); } } - return read_signed_register (regno); + + return extract_signed_integer (raw_buffer, REGISTER_VIRTUAL_SIZE (regno)); } /* mips_addr_bits_remove - remove useless address bits */ |