From: Michael Snyder <msnyder@redhat.com>
To: gdb-patches@sources.redhat.com
Cc: cagney <cagney@redhat.com>, Daniel Jacobowitz <drow@mvista.com>
Subject: [RFA] mips 32/64 register/stack fix
Date: Thu, 22 Apr 2004 18:49:00 -0000 [thread overview]
Message-ID: <408813A9.6000402@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 664 bytes --]
Hi Andrew, Daniel,
This patch applies to the case where you have a mips64 target
(eg. mipsisa64-elf), but you're compiling in 32 bit mode (gcc -mips32).
In this case mips_regsize (gdbarch) is 64, but mips_saved_regsize (tdep)
is 32 (ie. only 32 bits are used to save a register on the stack).
trad_frame_prev_register can't handle that case (AFAICT), because
it relies on what the regcache says about the regsize.
So I've added come code to mips_mdebug_frame_prev_register
to handle it. This fixes at least 500 testsuite failures,
and in fact makes the results for -mips32 almost identical
with the results for -mips64 (they were woefully different
before).
[-- Attachment #2: mips2 --]
[-- Type: text/plain, Size: 2363 bytes --]
2004-04-22 Michael Snyder <msnyder@redhat.com>
* mips-tdep.c (mips_mdebug_frame_prev_register): Don't call
trad_frame_prev_register when stack-save-size is not equal
to register-size.
Index: mips-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/gnupro/gdb/mips-tdep.c,v
retrieving revision 1.11
diff -p -r1.11 mips-tdep.c
*** mips-tdep.c 14 Apr 2004 00:54:43 -0000 1.11
--- mips-tdep.c 22 Apr 2004 01:01:34 -0000
*************** mips_mdebug_frame_prev_register (struct
*** 1684,1693 ****
enum lval_type *lvalp, CORE_ADDR *addrp,
int *realnump, void *valuep)
{
struct mips_frame_cache *info = mips_mdebug_frame_cache (next_frame,
this_cache);
! trad_frame_prev_register (next_frame, info->saved_regs, regnum,
! optimizedp, lvalp, addrp, realnump, valuep);
}
static const struct frame_unwind mips_mdebug_frame_unwind =
--- 1684,1719 ----
enum lval_type *lvalp, CORE_ADDR *addrp,
int *realnump, void *valuep)
{
+ struct gdbarch *gdbarch = get_frame_arch (next_frame);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
struct mips_frame_cache *info = mips_mdebug_frame_cache (next_frame,
this_cache);
! if (mips_saved_regsize (tdep) < mips_regsize (gdbarch) &&
! trad_frame_addr_p (info->saved_regs, regnum))
! {
! char tmp[MAX_REGISTER_SIZE];
! /* The register was saved in memory, but the size on the stack
! is not the same as the size in the regcache. Trad_frame
! cannot handle this case. */
! *optimizedp = 0;
! *lvalp = lval_memory;
! *addrp = info->saved_regs[regnum].addr;
! *realnump = -1;
! if (valuep != NULL)
! {
! /* Clear the input buffer, read the value into it from memory
! (offset by the difference between its size on the stack and
! its size in the register). */
! get_frame_memory (next_frame, info->saved_regs[regnum].addr,
! tmp, mips_saved_regsize (tdep));
! store_signed_integer (valuep, mips_regsize (gdbarch),
! extract_signed_integer (tmp,
! mips_saved_regsize (tdep)));
! }
! }
! else
! trad_frame_prev_register (next_frame, info->saved_regs, regnum,
! optimizedp, lvalp, addrp, realnump, valuep);
}
static const struct frame_unwind mips_mdebug_frame_unwind =
next reply other threads:[~2004-04-22 18:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-22 18:49 Michael Snyder [this message]
2004-04-22 19:59 ` Andrew Cagney
2004-04-22 21:29 ` Daniel Jacobowitz
2004-04-22 21:43 ` Michael Snyder
2004-04-22 22:04 ` Andrew Cagney
2004-04-22 22:49 ` Michael Snyder
2004-04-28 21:45 ` Andrew Cagney
2004-04-29 3:12 ` Daniel Jacobowitz
2004-04-29 13:40 ` Andrew Cagney
2004-04-29 14:34 ` Daniel Jacobowitz
2004-04-29 18:32 ` [commit] mips_isa_regsize, mips_abi_regsize; Was: " Andrew Cagney
2004-04-29 19:45 ` [commit] compute abi regsize; Was: Andrew Cagney
2004-04-29 17:58 ` [RFA] mips 32/64 register/stack fix Michael Snyder
2004-04-29 19:49 ` Andrew Cagney
2004-04-29 21:15 ` Michael Snyder
2004-04-29 21:36 ` Andrew Cagney
2004-04-30 0:40 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=408813A9.6000402@redhat.com \
--to=msnyder@redhat.com \
--cc=cagney@redhat.com \
--cc=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox