Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* prgregset_t vs gdb_gregset_t on Linux: not the same!
@ 2001-06-08 13:27 Daniel Jacobowitz
  2001-06-08 15:58 ` Daniel Jacobowitz
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2001-06-08 13:27 UTC (permalink / raw)
  To: gdb

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...).

Now for the reason it's a problem: I don't have any idea where this
definition came from, but a prgregset_t on Linux/MIPS is smaller than an
elf_gregset_t by a considerable amount.  This caused me no end of confusion
while I was trying to add threads support to the MIPS port (which I've just
started feeding back patches for today).

Of course, the thread_db functions are defined to take a prgregset_t, so
it's unclear what we really can do.  Make sure we always allocate the size
of the larger one, perhaps, and assume glibc won't do too much damage?

The prgregset_t type unfortunately is one word too small for all the
registers we can get from ptrace(), even if I fill its pad words with data.

-- 
Daniel Jacobowitz                           Debian GNU/Linux Developer
Monta Vista Software                              Debian Security Team


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2001-06-11 10:45 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-08 13:27 prgregset_t vs gdb_gregset_t on Linux: not the same! 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
2001-06-09 11:50   ` Mark Kettenis
2001-06-09 15:42     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox