From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
To: "H . J . Lu" <hjl@lucon.org>
Cc: gdb@sources.redhat.com
Subject: Re: prgregset_t vs gdb_gregset_t on Linux: not the same!
Date: Sat, 09 Jun 2001 15:23:00 -0000 [thread overview]
Message-ID: <20010609152347.B25090@nevyn.them.org> (raw)
In-Reply-To: <20010608221452.B3344@lucon.org>
On Fri, Jun 08, 2001 at 10:14:52PM -0700, H . J . Lu wrote:
> On Fri, Jun 08, 2001 at 03:59:07PM -0700, Daniel Jacobowitz wrote:
> > On Fri, Jun 08, 2001 at 01:27:30PM -0700, Daniel Jacobowitz wrote:
> > > In proc-service.c, we call fill_gregset and supply_gregset with a
> > > prgregset_t cast to a gdb_gregset_t *. The problem is, they really are
> > > different. We can mostly get away with this, because in almost all cases
> > > glibc won't do anything with the gregset except pass it back to gdb again
> > > (if the process has terminated, it will memset something the size of a
> > > prgregset_t, though...).
> >
> > The matching question here is that core-regset.c's fetch_core_registers
> > calls supply_gregset with a gregset_t, but supply_gregset is prototyped
> > with a gdb_gregset_t. That doesn't work very well either.
>
> I believe your Linux/MIPS patch is wrong. Please follow the examples in
> linux/alpha, linux/i386 and linux/ppc. Basically, you have to include
> config/tm-linux.h and config/nm-linux.h from the linux/mips header
> files. But in order to do that, please make sure you do
Huh? Did you even read what I wrote? gdb_gregset_t and
gregset_t/prgregset_t are NOT THE SAME SIZE.
config/nm-linux.h has:
/* Use elf_gregset_t and elf_fpregset_t, rather than
gregset_t and fpregset_t. */
#define GDB_GREGSET_T elf_gregset_t
#define GDB_FPREGSET_T elf_fpregset_t
So gdb_gregset_t is elg_gregset_t. which, the kernel defines as
an array of 45 elf_greg_t's in <asm/elf.h>.
But prgregset_t is gregset_t
(from <sys/procfs.h>:
/* Register sets. Linux has different names. */
typedef gregset_t prgregset_t;
typedef fpregset_t prfpregset_t;
)
And gregset_t is (<sys/ucontext.h>):
#define NGREG 37
#define NFPREG 33
/* Container for all general registers. */
/* gregset_t must be an array. The below declared array corresponds
to:
typedef struct gregset {
greg_t g_regs[32];
greg_t g_hi;
greg_t g_lo;
greg_t g_pad[3];
} gregset_t; */
typedef greg_t gregset_t[NGREG];
>
> #include <nm-linux.h>
> #include <tm-linux.h>
>
> not
>
> #include "nm-linux.h"
> #include "tm-linux.h"
>
> Otherwise, you may not get the header files you want since mips has
> both liltle and big endians. Once you have done that, your problem
> should go away.
The little endian config files are not named xm-linux.h and tm-linux.h
in a separate directory. They're named xm-littlelinux.h and
tm-littlelinux.h.
--
Daniel Jacobowitz Debian GNU/Linux Developer
Monta Vista Software Debian Security Team
next prev parent reply other threads:[~2001-06-09 15:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-08 13:27 Daniel Jacobowitz
2001-06-08 15:58 ` Daniel Jacobowitz
2001-06-08 22:14 ` H . J . Lu
2001-06-09 11:50 ` Mark Kettenis
2001-06-09 13:34 ` Andrew Cagney
2001-06-10 0:23 ` H . J . Lu
[not found] ` <Pine.SUN.3.91.1010610105519.5638E-100000@is>
2001-06-10 1:20 ` H . J . Lu
2001-06-11 6:48 ` Andrew Cagney
2001-06-11 8:58 ` H . J . Lu
2001-06-11 10:45 ` Andrew Cagney
2001-06-11 9:24 ` Daniel Jacobowitz
2001-06-11 9:45 ` H . J . Lu
2001-06-11 10:04 ` Daniel Jacobowitz
2001-06-11 10:45 ` H . J . Lu
2001-06-09 15:23 ` Daniel Jacobowitz [this message]
2001-06-09 11:50 ` Mark Kettenis
2001-06-09 15:42 ` Daniel Jacobowitz
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=20010609152347.B25090@nevyn.them.org \
--to=dmj+@andrew.cmu.edu \
--cc=gdb@sources.redhat.com \
--cc=hjl@lucon.org \
/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