From: Daniel Jacobowitz <drow@mvista.com>
To: Andrew Cagney <cagney@gnu.org>
Cc: Michael Snyder <msnyder@redhat.com>,
gdb-patches@sources.redhat.com, cagney <cagney@redhat.com>
Subject: Re: [RFA] mips 32/64 register/stack fix
Date: Thu, 22 Apr 2004 21:29:00 -0000 [thread overview]
Message-ID: <20040422212917.GA24441@nevyn.them.org> (raw)
In-Reply-To: <4088242A.4070601@gnu.org>
On Thu, Apr 22, 2004 at 03:59:38PM -0400, Andrew Cagney wrote:
> >! if (mips_saved_regsize (tdep) < mips_regsize (gdbarch) &&
> >! trad_frame_addr_p (info->saved_regs, regnum))
> >! {
>
> This doesn't look right, can you post a backtrace?
>
> The MIPS has [0 .. NUM_REGS) ISA sized registers and [NUM_REGS ..
> 2*NUM_REGS) ABI sized registers. So if the caller wants an ABI register
> it should have passed in that register number.
Personally, I think the mistake is higher up - in mips_regsize or
further. Look at this:
int
mips_regsize (struct gdbarch *gdbarch)
{
return (gdbarch_bfd_arch_info (gdbarch)->bits_per_word
/ gdbarch_bfd_arch_info (gdbarch)->bits_per_byte);
}
bits_per_word is based on the BFD architecture, which is based on
EF_MIPS_MACH and EF_MIPS_ARCH. I don't think it's useful to have
-mcpu=mips64 -mabi=32 code (which is pretty much what Michael's
describing) behave differently from -mcpu=mips1 -mabi=32 code; a native
GNU/Linux GDB has to deal with 32-bit target registers and 32-bit saved
registers in either case. And that's what you get if you build the
optimal compiler for a 32-bit kernel on a 64-bit processor, which lots
of people do.
It's very easy to reproduce this problem if you have access to anything
that can run a MIPS64 GNU/Linux kernel. Build an n32 GDB, run it using
--target_board unix/-mabi=32/-mcpu=mips64, IIRC. I have a collection
of hacks to work around this and they're gross beyond all description,
which is why I tabled them until after I sort through the prologue
analysis issues.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2004-04-22 21:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-22 18:49 Michael Snyder
2004-04-22 19:59 ` Andrew Cagney
2004-04-22 21:29 ` Daniel Jacobowitz [this message]
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=20040422212917.GA24441@nevyn.them.org \
--to=drow@mvista.com \
--cc=cagney@gnu.org \
--cc=cagney@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=msnyder@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