* [PATCH] Export fill_fpxregset
@ 2002-01-09 14:33 Michael Snyder
2002-01-09 15:02 ` Daniel Jacobowitz
2002-01-09 16:04 ` Elena Zannoni
0 siblings, 2 replies; 6+ messages in thread
From: Michael Snyder @ 2002-01-09 14:33 UTC (permalink / raw)
To: gdb-patches; +Cc: drow
2002-01-09 Michael Snyder <msnyder@redhat.com>
* i386-linux-nat.c (fill_fpxregset): Make global.
(store_fpxregset): Ditto.
Index: i386-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v
retrieving revision 1.33
diff -c -3 -p -r1.33 i386-linux-nat.c
*** i386-linux-nat.c 2001/12/27 19:52:31 1.33
--- i386-linux-nat.c 2002/01/09 22:25:44
***************
*** 1,5 ****
/* Native-dependent code for Linux/x86.
! Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
--- 1,5 ----
/* Native-dependent code for Linux/x86.
! Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
*************** static void store_fpregs (int tid, int r
*** 452,458 ****
/* Fill GDB's register array with the floating-point and SSE register
values in *FPXREGSETP. */
! static void
supply_fpxregset (elf_fpxregset_t *fpxregsetp)
{
i387_supply_fxsave ((char *) fpxregsetp);
--- 452,458 ----
/* Fill GDB's register array with the floating-point and SSE register
values in *FPXREGSETP. */
! void
supply_fpxregset (elf_fpxregset_t *fpxregsetp)
{
i387_supply_fxsave ((char *) fpxregsetp);
*************** supply_fpxregset (elf_fpxregset_t *fpxre
*** 462,468 ****
*FPXREGSETP with the value in GDB's register array. If REGNO is
-1, do this for all registers. */
! static void
fill_fpxregset (elf_fpxregset_t *fpxregsetp, int regno)
{
i387_fill_fxsave ((char *) fpxregsetp, regno);
--- 462,468 ----
*FPXREGSETP with the value in GDB's register array. If REGNO is
-1, do this for all registers. */
! void
fill_fpxregset (elf_fpxregset_t *fpxregsetp, int regno)
{
i387_fill_fxsave ((char *) fpxregsetp, regno);
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] Export fill_fpxregset 2002-01-09 14:33 [PATCH] Export fill_fpxregset Michael Snyder @ 2002-01-09 15:02 ` Daniel Jacobowitz 2002-01-09 16:04 ` Elena Zannoni 1 sibling, 0 replies; 6+ messages in thread From: Daniel Jacobowitz @ 2002-01-09 15:02 UTC (permalink / raw) To: gdb-patches On Wed, Jan 09, 2002 at 02:28:16PM -0800, Michael Snyder wrote: > 2002-01-09 Michael Snyder <msnyder@redhat.com> > > * i386-linux-nat.c (fill_fpxregset): Make global. > (store_fpxregset): Ditto. Thanks! -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Export fill_fpxregset 2002-01-09 14:33 [PATCH] Export fill_fpxregset Michael Snyder 2002-01-09 15:02 ` Daniel Jacobowitz @ 2002-01-09 16:04 ` Elena Zannoni 2002-01-10 11:52 ` Michael Snyder 1 sibling, 1 reply; 6+ messages in thread From: Elena Zannoni @ 2002-01-09 16:04 UTC (permalink / raw) To: Michael Snyder; +Cc: gdb-patches, drow Sorry, but does this conflict with the extern in gregset.h? extern void fill_fpxregset (gdb_fpxregset_t *fpxregs, int regno); We have gdb_fpxregset_t vs. elf_fpxregset_t. Should we just use one or the other? I just remembered running into a similar problem some time back. Thanks Elena Michael Snyder writes: > 2002-01-09 Michael Snyder <msnyder@redhat.com> > > * i386-linux-nat.c (fill_fpxregset): Make global. > (store_fpxregset): Ditto. > > Index: i386-linux-nat.c > =================================================================== > RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v > retrieving revision 1.33 > diff -c -3 -p -r1.33 i386-linux-nat.c > *** i386-linux-nat.c 2001/12/27 19:52:31 1.33 > --- i386-linux-nat.c 2002/01/09 22:25:44 > *************** > *** 1,5 **** > /* Native-dependent code for Linux/x86. > ! Copyright 1999, 2000, 2001 Free Software Foundation, Inc. > > This file is part of GDB. > > --- 1,5 ---- > /* Native-dependent code for Linux/x86. > ! Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. > > This file is part of GDB. > > *************** static void store_fpregs (int tid, int r > *** 452,458 **** > /* Fill GDB's register array with the floating-point and SSE register > values in *FPXREGSETP. */ > > ! static void > supply_fpxregset (elf_fpxregset_t *fpxregsetp) > { > i387_supply_fxsave ((char *) fpxregsetp); > --- 452,458 ---- > /* Fill GDB's register array with the floating-point and SSE register > values in *FPXREGSETP. */ > > ! void > supply_fpxregset (elf_fpxregset_t *fpxregsetp) > { > i387_supply_fxsave ((char *) fpxregsetp); > *************** supply_fpxregset (elf_fpxregset_t *fpxre > *** 462,468 **** > *FPXREGSETP with the value in GDB's register array. If REGNO is > -1, do this for all registers. */ > > ! static void > fill_fpxregset (elf_fpxregset_t *fpxregsetp, int regno) > { > i387_fill_fxsave ((char *) fpxregsetp, regno); > --- 462,468 ---- > *FPXREGSETP with the value in GDB's register array. If REGNO is > -1, do this for all registers. */ > > ! void > fill_fpxregset (elf_fpxregset_t *fpxregsetp, int regno) > { > i387_fill_fxsave ((char *) fpxregsetp, regno); ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Export fill_fpxregset 2002-01-09 16:04 ` Elena Zannoni @ 2002-01-10 11:52 ` Michael Snyder 2002-01-10 11:56 ` Daniel Jacobowitz 0 siblings, 1 reply; 6+ messages in thread From: Michael Snyder @ 2002-01-10 11:52 UTC (permalink / raw) To: Elena Zannoni; +Cc: Michael Snyder, gdb-patches, drow Elena Zannoni wrote: > > Sorry, but does this conflict with the extern in gregset.h? > > extern void fill_fpxregset (gdb_fpxregset_t *fpxregs, int regno); > > We have gdb_fpxregset_t vs. elf_fpxregset_t. > > Should we just use one or the other? > I just remembered running into a similar problem some time back. Hmm, well since this is (currently) only used on Linux, we COULD just use elf_gregset_t, but I was following a precident that was set for gregset_t and fpregset_t, to avoid potential portability problems. The types "gdb_gregset_t" and "gdb_fpregset_t" were introduced because there was no consistent definition across platforms for gregset and fpregset. Linux uses elf_fpregset, solaris uses prfpregset, sunos uses fpregset... The gregset.h header file defines a portable interface to the rest of gdb, which therefore does not need to know what the native types of fpregset etc. are. In this case, i386-linux-nat.c uses the native type elf_fpxregset_t, while the rest of gdb will use the portable type gdb_fpxregset_t. Since they are identical, there shouldn't be a problem. > > Thanks > > Elena > > Michael Snyder writes: > > 2002-01-09 Michael Snyder <msnyder@redhat.com> > > > > * i386-linux-nat.c (fill_fpxregset): Make global. > > (store_fpxregset): Ditto. > > > > Index: i386-linux-nat.c > > =================================================================== > > RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v > > retrieving revision 1.33 > > diff -c -3 -p -r1.33 i386-linux-nat.c > > *** i386-linux-nat.c 2001/12/27 19:52:31 1.33 > > --- i386-linux-nat.c 2002/01/09 22:25:44 > > *************** > > *** 1,5 **** > > /* Native-dependent code for Linux/x86. > > ! Copyright 1999, 2000, 2001 Free Software Foundation, Inc. > > > > This file is part of GDB. > > > > --- 1,5 ---- > > /* Native-dependent code for Linux/x86. > > ! Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. > > > > This file is part of GDB. > > > > *************** static void store_fpregs (int tid, int r > > *** 452,458 **** > > /* Fill GDB's register array with the floating-point and SSE register > > values in *FPXREGSETP. */ > > > > ! static void > > supply_fpxregset (elf_fpxregset_t *fpxregsetp) > > { > > i387_supply_fxsave ((char *) fpxregsetp); > > --- 452,458 ---- > > /* Fill GDB's register array with the floating-point and SSE register > > values in *FPXREGSETP. */ > > > > ! void > > supply_fpxregset (elf_fpxregset_t *fpxregsetp) > > { > > i387_supply_fxsave ((char *) fpxregsetp); > > *************** supply_fpxregset (elf_fpxregset_t *fpxre > > *** 462,468 **** > > *FPXREGSETP with the value in GDB's register array. If REGNO is > > -1, do this for all registers. */ > > > > ! static void > > fill_fpxregset (elf_fpxregset_t *fpxregsetp, int regno) > > { > > i387_fill_fxsave ((char *) fpxregsetp, regno); > > --- 462,468 ---- > > *FPXREGSETP with the value in GDB's register array. If REGNO is > > -1, do this for all registers. */ > > > > ! void > > fill_fpxregset (elf_fpxregset_t *fpxregsetp, int regno) > > { > > i387_fill_fxsave ((char *) fpxregsetp, regno); ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Export fill_fpxregset 2002-01-10 11:52 ` Michael Snyder @ 2002-01-10 11:56 ` Daniel Jacobowitz 2002-01-10 12:14 ` Kevin Buettner 0 siblings, 1 reply; 6+ messages in thread From: Daniel Jacobowitz @ 2002-01-10 11:56 UTC (permalink / raw) To: Michael Snyder; +Cc: Elena Zannoni, Michael Snyder, gdb-patches On Thu, Jan 10, 2002 at 11:47:26AM -0800, Michael Snyder wrote: > Elena Zannoni wrote: > > > > Sorry, but does this conflict with the extern in gregset.h? > > > > extern void fill_fpxregset (gdb_fpxregset_t *fpxregs, int regno); > > > > We have gdb_fpxregset_t vs. elf_fpxregset_t. > > > > Should we just use one or the other? > > I just remembered running into a similar problem some time back. > > Hmm, well since this is (currently) only used on Linux, we COULD > just use elf_gregset_t, but I was following a precident that was > set for gregset_t and fpregset_t, to avoid potential portability > problems. > > The types "gdb_gregset_t" and "gdb_fpregset_t" were introduced > because there was no consistent definition across platforms for > gregset and fpregset. Linux uses elf_fpregset, solaris uses > prfpregset, sunos uses fpregset... > > The gregset.h header file defines a portable interface to the > rest of gdb, which therefore does not need to know what the > native types of fpregset etc. are. > > In this case, i386-linux-nat.c uses the native type elf_fpxregset_t, > while the rest of gdb will use the portable type gdb_fpxregset_t. > Since they are identical, there shouldn't be a problem. I don't think there should be a gdb_fpxregset_t. There's no such thing as a portable fpxregset; PowerPC is going to have a vrregset instead, in fact. How this should be handled in generic code that wants to manipulate regsets remains to be seen. Ideal might be a list of available regset types in a struct somewhere. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Export fill_fpxregset 2002-01-10 11:56 ` Daniel Jacobowitz @ 2002-01-10 12:14 ` Kevin Buettner 0 siblings, 0 replies; 6+ messages in thread From: Kevin Buettner @ 2002-01-10 12:14 UTC (permalink / raw) To: Daniel Jacobowitz, Michael Snyder Cc: Elena Zannoni, Michael Snyder, gdb-patches On Jan 10, 2:56pm, Daniel Jacobowitz wrote: > > In this case, i386-linux-nat.c uses the native type elf_fpxregset_t, > > while the rest of gdb will use the portable type gdb_fpxregset_t. > > Since they are identical, there shouldn't be a problem. > > I don't think there should be a gdb_fpxregset_t. There's no such thing > as a portable fpxregset; PowerPC is going to have a vrregset instead, > in fact. How this should be handled in generic code that wants to > manipulate regsets remains to be seen. Ideal might be a list of > available regset types in a struct somewhere. In my opinion an xregset ought to just be passed as a void *. The underlying target code will need a method which may be called to tell the generic code the size (for allocation and copying purposes). If you want type safety, you can wrap the the pointer in a struct and pass the struct. Kevin ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-01-10 20:14 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-01-09 14:33 [PATCH] Export fill_fpxregset Michael Snyder 2002-01-09 15:02 ` Daniel Jacobowitz 2002-01-09 16:04 ` Elena Zannoni 2002-01-10 11:52 ` Michael Snyder 2002-01-10 11:56 ` Daniel Jacobowitz 2002-01-10 12:14 ` Kevin Buettner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox