This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What's the correct type for {supply,fill}_fpregset?


On Nov 20, 11:50am, Elena Zannoni wrote:

> Is the type of {supply,fill}_fpregset's argument wrong? It matches
> what in gregset.h, but few other *-linux-nat.c declare those functions
> the same way ppc-linux-nat.c does.
> 
> The defintions in use are from ppc-linux-nat.c:
> void fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
> void supply_fpregset (gdb_fpregset_t * fpregsetp)
> 
> Or should the calls in thread-db.c be changed?

This has frequently been a source of annoyance for me and I had never
really taken a close look to see how things ought to be done...

It seems to me that reason for {supply,fill}_[fp,g}regset()'s existence
is to 1) communicate with /proc on Solaris, Unixware, and AIX5 systems
and 2) to communicate with the thread library.

For the floating point registers, the type used to communicate with this
underlying OS support is prfpregset_t.  Since there's some variablility
in how this is defined, we (quite sensibly) define gdb_prfpregset_t,
but we don't use it everywhere that we should.  In my opinion, it is
this type that ought to be used in the definition of fill_fpregset()
and supply_fpregset().  (And not just for Linux/PPC, but everywhere
else too.)

The other way to approach this is to define gdb_fpregset_t in terms of
prfpregset_t and to use gdb_fpregset_t everywhere.  (It accomplishes
the same thing, but with a different name.)

Kevin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]