* Re: RFA: use constructor to build 'struct regset' objects
[not found] <vt2smdy93u9.fsf@zenia.home>
@ 2004-05-17 21:32 ` Jim Blandy
2004-05-17 21:48 ` Mark Kettenis
0 siblings, 1 reply; 8+ messages in thread
From: Jim Blandy @ 2004-05-17 21:32 UTC (permalink / raw)
To: gdb-patches
Jim Blandy <jimb@redhat.com> writes:
> 2004-05-17 Jim Blandy <jimb@redhat.com>
>
> Use a constructor function to create regset structures.
> * regset.h (supply_regset_ftype): New typedef.
> (struct regset): Use supply_regset_ftype.
> (readonly_regset_xmalloc): New declaration.
> * regset.c: New file.
> * am64-tdep.c (amd64_regset_from_core_section): Use
> readonly_regset_xmalloc to construct regset structures.
> * amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
> * i386-tdep.c (i386_regset_from_core_section): Same.
> * i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
> * i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
> * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
> * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
> * sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
> * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
> * Makefile.in (COMMON_OBS): Add regset.o.
> (regset.o): New rule.
Sorry --- this needs more explanation.
At the moment, 'struct regset' contains a pointer to a function that
extracts register values from a register set in some target-specific
format, and stores them in a regcache. I'd like to extend 'struct
regset' to include a function pointer for going the other direction:
filling a target-specific register set structure with values from a
register cache.
This patch is a preliminary step for that: once we have a centralized
constructor function, we can add more function pointer fields to
'struct regset' and have them initialized properly without updating
every point that builds a target-specific regset structure. Code
calling 'readonly_regset_malloc' would get a regset with a 'fill'
function set to some value indicating "this regset does not support
filling". Then, targets could add filling functions as they get
around to it, calling a different constructor function expecting an
additional function pointer argument.
Having a regset writing function could be used for better gcore
support, but I'm immediately interested in using it to improve GDB's
thread support:
The libthread_db library provides functions for fetching and restoring
gregset and fpregset structures, as well as a user-defined catchall
structure referred to as the 'xregs' structure. GDB only uses the
gregset and fpregset functions at the moment, so registers that aren't
carried by either of those structures are inaccessible in multi-
threaded programs. For example, on my Linux system, GDB can't print
SSE registers in programs that use threads, but it can in programs
that are not linked against -lpthread. I have a test script for this,
which I'll submit in a bit.
I've got further patches for GDB that implement the xregs functions.
Also, since glibc's libthread_db doesn't implement the xregs functions
(why bother? GDB doesn't use them!), I've got a patch for that, too.
Everything checks (and produces) the appropriate error codes for
compatibility with older libthread_dbs that don't support the xregs
functions, so the GDB and glibc patches are independent of each other.
Then, I've got a patch that adds a gdbarch method that thread-db.c
and proc-service.c can call to find an xregset descriptor for the
current architecture (if it has one).
The final step is a patch that actually provides an xregset descriptor
for the E500, a PowerPC variant with 64-bit GPRS, but 32-bit gregset
entries. That's not a great reference implementation --- why isn't
E500 Linux's gregset big enough to actually hold its gprs? But
something similar would also solve the SSE case, in a more exemplary
fashion. I may write up a patch for that, but I haven't yet.
So, that's the story. What do people think?
Is 'readonly_regset_xmalloc' a good name, or would something like
'supplyonly_regset_malloc' be better? I mean, both 'supply' and
'fill' functions read one thing and write another; if you don't
already know the plot, it's not clear which direction a 'readonly'
regset would go.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RFA: use constructor to build 'struct regset' objects
2004-05-17 21:32 ` RFA: use constructor to build 'struct regset' objects Jim Blandy
@ 2004-05-17 21:48 ` Mark Kettenis
2004-05-19 4:15 ` Jim Blandy
0 siblings, 1 reply; 8+ messages in thread
From: Mark Kettenis @ 2004-05-17 21:48 UTC (permalink / raw)
To: jimb; +Cc: gdb-patches
From: Jim Blandy <jimb@redhat.com>
Date: 17 May 2004 16:28:29 -0500
Jim Blandy <jimb@redhat.com> writes:
> 2004-05-17 Jim Blandy <jimb@redhat.com>
>
> Use a constructor function to create regset structures.
> * regset.h (supply_regset_ftype): New typedef.
> (struct regset): Use supply_regset_ftype.
> (readonly_regset_xmalloc): New declaration.
> * regset.c: New file.
> * am64-tdep.c (amd64_regset_from_core_section): Use
> readonly_regset_xmalloc to construct regset structures.
> * amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
> * i386-tdep.c (i386_regset_from_core_section): Same.
> * i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
> * i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
> * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
> * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
> * sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
> * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
> * Makefile.in (COMMON_OBS): Add regset.o.
> (regset.o): New rule.
So, that's the story. What do people think?
Ah, you guessed my grand plan (that I never fully implemented). It
would also be used for the gcore support. So, yes, by all means go
for it!
Is 'readonly_regset_xmalloc' a good name, or would something like
'supplyonly_regset_malloc' be better? I mean, both 'supply' and
'fill' functions read one thing and write another; if you don't
already know the plot, it's not clear which direction a 'readonly'
regset would go.
I was wondering what readonly_ was supposed to mean in your first
patch. Why not avoid inventing a wierd name at all. Just call the
function `regset_xmalloc', and add a third argument right from the
start. Just pass NULL as the third argument for now.
Mark
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RFA: use constructor to build 'struct regset' objects
2004-05-17 21:48 ` Mark Kettenis
@ 2004-05-19 4:15 ` Jim Blandy
2004-05-19 8:36 ` kettenis
2004-05-19 14:56 ` Andrew Cagney
0 siblings, 2 replies; 8+ messages in thread
From: Jim Blandy @ 2004-05-19 4:15 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
Mark Kettenis <kettenis@chello.nl> writes:
> From: Jim Blandy <jimb@redhat.com>
> Date: 17 May 2004 16:28:29 -0500
>
> Jim Blandy <jimb@redhat.com> writes:
> > 2004-05-17 Jim Blandy <jimb@redhat.com>
> >
> > Use a constructor function to create regset structures.
> > * regset.h (supply_regset_ftype): New typedef.
> > (struct regset): Use supply_regset_ftype.
> > (readonly_regset_xmalloc): New declaration.
> > * regset.c: New file.
> > * am64-tdep.c (amd64_regset_from_core_section): Use
> > readonly_regset_xmalloc to construct regset structures.
> > * amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
> > * i386-tdep.c (i386_regset_from_core_section): Same.
> > * i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
> > * i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
> > * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
> > * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
> > * sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
> > * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
> > * Makefile.in (COMMON_OBS): Add regset.o.
> > (regset.o): New rule.
>
> So, that's the story. What do people think?
>
> Ah, you guessed my grand plan (that I never fully implemented). It
> would also be used for the gcore support. So, yes, by all means go
> for it!
Great!
How's this:
2004-05-17 Jim Blandy <jimb@redhat.com>
Use a constructor function to create regset structures.
* regset.h (supply_regset_ftype, fill_regset_ftype): New typedefs.
(struct regset): Use supply_regset_ftype. Add new
'fill_regset' member.
(regset_xmalloc): New declaration.
* regset.c: New file.
* am64-tdep.c (amd64_regset_from_core_section): Use
regset_xmalloc to construct regset structures.
* amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
* i386-tdep.c (i386_regset_from_core_section): Same.
* i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
* i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
* sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
* sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
* sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
* sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
* Makefile.in (COMMON_OBS): Add regset.o.
(regset.o): New rule.
Index: gdb/regset.h
===================================================================
RCS file: /cvs/src/src/gdb/regset.h,v
retrieving revision 1.1
diff -c -p -r1.1 regset.h
*** gdb/regset.h 26 Sep 2003 14:36:56 -0000 1.1
--- gdb/regset.h 19 May 2004 04:12:35 -0000
*************** struct gdbarch;
*** 26,31 ****
--- 26,35 ----
struct regcache;
/* Data structure describing a register set. */
+ typedef void (supply_regset_ftype) (const struct regset *, struct regcache *,
+ int, const void *, size_t);
+ typedef void (fill_regset_ftype) (const struct regset *, struct regcache *,
+ int, const void *, size_t);
struct regset
{
*************** struct regset
*** 34,41 ****
const void *descr;
/* Function supplying a register set to a register cache. */
! void (*supply_regset) (const struct regset *, struct regcache *,
! int, const void *, size_t);
};
#endif /* regset.h */
--- 38,59 ----
const void *descr;
/* Function supplying a register set to a register cache. */
! supply_regset_ftype *supply_regset;
!
! /* Function filling a register set with values from a register cache. */
! fill_regset_ftype *fill_regset;
};
+
+
+ /* Allocate a fresh 'struct regset' whose descr is DESCR, whose
+ supply_regset function is SUPPLY_REGSET, and whose fill_regset
+ function is FILL_REGSET. If the regset has no fill function, pass
+ NULL for FILL_REGSET.
+
+ The object returned is allocated using xmalloc. */
+ extern struct regset *regset_xmalloc (void *descr,
+ supply_regset_ftype *supply_regset,
+ fill_regset_ftype *fill_regset);
+
#endif /* regset.h */
Index: gdb/regset.c
===================================================================
RCS file: gdb/regset.c
diff -N gdb/regset.c
*** gdb/regset.c 1 Jan 1970 00:00:00 -0000
--- gdb/regset.c 19 May 2004 04:12:35 -0000
***************
*** 0 ****
--- 1,38 ----
+ /* Regset support functions, for GDB.
+
+ Copyright 2004 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+ #include "defs.h"
+ #include "regset.h"
+ #include "gdb_assert.h"
+
+
+ struct regset *regset_xmalloc (void *descr,
+ supply_regset_ftype *supply_regset,
+ fill_regset_ftype *fill_regset)
+ {
+ struct regset *r = (struct regset *) xmalloc (sizeof (*r));
+
+ r->descr = descr;
+ r->supply_regset = supply_regset;
+ r->fill_regset = fill_regset;
+
+ return r;
+ }
Index: gdb/amd64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
retrieving revision 1.10
diff -c -p -r1.10 amd64-tdep.c
*** gdb/amd64-tdep.c 18 May 2004 21:20:25 -0000 1.10
--- gdb/amd64-tdep.c 19 May 2004 04:12:33 -0000
*************** amd64_regset_from_core_section (struct g
*** 1074,1084 ****
if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
{
if (tdep->fpregset == NULL)
! {
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->descr = tdep;
! tdep->fpregset->supply_regset = amd64_supply_fpregset;
! }
return tdep->fpregset;
}
--- 1074,1080 ----
if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
{
if (tdep->fpregset == NULL)
! tdep->fpregset = regset_xmalloc (tdep, amd64_supply_fpregset, NULL);
return tdep->fpregset;
}
Index: gdb/amd64obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64obsd-tdep.c,v
retrieving revision 1.10
diff -c -p -r1.10 amd64obsd-tdep.c
*** gdb/amd64obsd-tdep.c 15 May 2004 21:06:50 -0000 1.10
--- gdb/amd64obsd-tdep.c 19 May 2004 04:12:34 -0000
*************** amd64obsd_regset_from_core_section (stru
*** 63,73 ****
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE)
{
if (tdep->gregset == NULL)
! {
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = tdep;
! tdep->gregset->supply_regset = amd64obsd_supply_regset;
! }
return tdep->gregset;
}
--- 63,69 ----
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE)
{
if (tdep->gregset == NULL)
! tdep->gregset = regset_xmalloc (tdep, amd64obsd_supply_regset, NULL);
return tdep->gregset;
}
Index: gdb/i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.191
diff -c -p -r1.191 i386-tdep.c
*** gdb/i386-tdep.c 8 May 2004 23:02:10 -0000 1.191
--- gdb/i386-tdep.c 19 May 2004 04:12:35 -0000
*************** i386_regset_from_core_section (struct gd
*** 1662,1672 ****
if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
{
if (tdep->gregset == NULL)
! {
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = tdep;
! tdep->gregset->supply_regset = i386_supply_gregset;
! }
return tdep->gregset;
}
--- 1662,1668 ----
if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
{
if (tdep->gregset == NULL)
! tdep->gregset = regset_xmalloc (tdep, i386_supply_gregset, NULL);
return tdep->gregset;
}
*************** i386_regset_from_core_section (struct gd
*** 1675,1685 ****
&& sect_size == I387_SIZEOF_FXSAVE))
{
if (tdep->fpregset == NULL)
! {
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->descr = tdep;
! tdep->fpregset->supply_regset = i386_supply_fpregset;
! }
return tdep->fpregset;
}
--- 1671,1677 ----
&& sect_size == I387_SIZEOF_FXSAVE))
{
if (tdep->fpregset == NULL)
! tdep->fpregset = regset_xmalloc (tdep, i386_supply_fpregset, NULL);
return tdep->fpregset;
}
Index: gdb/i386nbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386nbsd-tdep.c,v
retrieving revision 1.24
diff -c -p -r1.24 i386nbsd-tdep.c
*** gdb/i386nbsd-tdep.c 9 Apr 2004 23:26:19 -0000 1.24
--- gdb/i386nbsd-tdep.c 19 May 2004 04:12:35 -0000
*************** i386nbsd_aout_regset_from_core_section (
*** 86,96 ****
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
{
if (tdep->gregset == NULL)
! {
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = tdep;
! tdep->gregset->supply_regset = i386nbsd_aout_supply_regset;
! }
return tdep->gregset;
}
--- 86,93 ----
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
{
if (tdep->gregset == NULL)
! tdep->gregset
! = regset_xmalloc (tdep, i386nbsd_aout_supply_regset, NULL);
return tdep->gregset;
}
Index: gdb/i386obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386obsd-tdep.c,v
retrieving revision 1.15
diff -c -p -r1.15 i386obsd-tdep.c
*** gdb/i386obsd-tdep.c 9 Apr 2004 23:26:19 -0000 1.15
--- gdb/i386obsd-tdep.c 19 May 2004 04:12:35 -0000
*************** i386obsd_aout_regset_from_core_section (
*** 141,151 ****
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
{
if (tdep->gregset == NULL)
! {
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = tdep;
! tdep->gregset->supply_regset = i386obsd_aout_supply_regset;
! }
return tdep->gregset;
}
--- 141,148 ----
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
{
if (tdep->gregset == NULL)
! tdep->gregset
! = regset_xmalloc (tdep, i386obsd_aout_supply_regset, NULL);
return tdep->gregset;
}
Index: gdb/sparc64fbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64fbsd-tdep.c,v
retrieving revision 1.6
diff -c -p -r1.6 sparc64fbsd-tdep.c
*** gdb/sparc64fbsd-tdep.c 10 Apr 2004 09:40:02 -0000 1.6
--- gdb/sparc64fbsd-tdep.c 19 May 2004 04:12:35 -0000
*************** sparc64fbsd_init_abi (struct gdbarch_inf
*** 199,211 ****
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = &sparc64fbsd_gregset;
! tdep->gregset->supply_regset = sparc64fbsd_supply_gregset;
tdep->sizeof_gregset = 256;
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->supply_regset = sparc64fbsd_supply_fpregset;
tdep->sizeof_fpregset = 272;
frame_unwind_append_sniffer (gdbarch, sparc64fbsd_sigtramp_frame_sniffer);
--- 199,209 ----
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset
! = regset_xmalloc (&sparc64fbsd_gregset, sparc64fbsd_supply_gregset, NULL);
tdep->sizeof_gregset = 256;
! tdep->fpregset = regset_xmalloc (NULL, sparc64fbsd_supply_fpregset, NULL);
tdep->sizeof_fpregset = 272;
frame_unwind_append_sniffer (gdbarch, sparc64fbsd_sigtramp_frame_sniffer);
Index: gdb/sparc64nbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64nbsd-tdep.c,v
retrieving revision 1.7
diff -c -p -r1.7 sparc64nbsd-tdep.c
*** gdb/sparc64nbsd-tdep.c 10 Apr 2004 09:40:02 -0000 1.7
--- gdb/sparc64nbsd-tdep.c 19 May 2004 04:12:35 -0000
*************** sparc64nbsd_init_abi (struct gdbarch_inf
*** 226,238 ****
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = &sparc64nbsd_gregset;
! tdep->gregset->supply_regset = sparc64nbsd_supply_gregset;
tdep->sizeof_gregset = 160;
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->supply_regset = sparc64nbsd_supply_fpregset;
tdep->sizeof_fpregset = 272;
frame_unwind_append_sniffer (gdbarch, sparc64nbsd_sigtramp_frame_sniffer);
--- 226,236 ----
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset
! = regset_xmalloc (&sparc64nbsd_gregset, sparc64nbsd_supply_gregset, NULL);
tdep->sizeof_gregset = 160;
! tdep->fpregset = regset_xmalloc (NULL, sparc64nbsd_supply_fpregset, NULL);
tdep->sizeof_fpregset = 272;
frame_unwind_append_sniffer (gdbarch, sparc64nbsd_sigtramp_frame_sniffer);
Index: gdb/sparc64obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64obsd-tdep.c,v
retrieving revision 1.3
diff -c -p -r1.3 sparc64obsd-tdep.c
*** gdb/sparc64obsd-tdep.c 10 Apr 2004 09:40:02 -0000 1.3
--- gdb/sparc64obsd-tdep.c 19 May 2004 04:12:35 -0000
*************** sparc64obsd_init_abi (struct gdbarch_inf
*** 184,192 ****
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = &sparc64obsd_core_gregset;
! tdep->gregset->supply_regset = sparc64obsd_supply_gregset;
tdep->sizeof_gregset = 832;
frame_unwind_append_sniffer (gdbarch, sparc64obsd_sigtramp_frame_sniffer);
--- 184,192 ----
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset = regset_xmalloc (&sparc64obsd_core_gregset,
! sparc64obsd_supply_gregset,
! NULL);
tdep->sizeof_gregset = 832;
frame_unwind_append_sniffer (gdbarch, sparc64obsd_sigtramp_frame_sniffer);
Index: gdb/sparcnbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparcnbsd-tdep.c,v
retrieving revision 1.18
diff -c -p -r1.18 sparcnbsd-tdep.c
*** gdb/sparcnbsd-tdep.c 18 Apr 2004 22:58:06 -0000 1.18
--- gdb/sparcnbsd-tdep.c 19 May 2004 04:12:36 -0000
*************** sparc32nbsd_init_abi (struct gdbarch_inf
*** 274,286 ****
set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = &sparc32nbsd_gregset;
! tdep->gregset->supply_regset = sparc32nbsd_supply_gregset;
tdep->sizeof_gregset = 20 * 4;
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->supply_regset = sparc32nbsd_supply_fpregset;
tdep->sizeof_fpregset = 33 * 4;
frame_unwind_append_sniffer (gdbarch, sparc32nbsd_sigtramp_frame_sniffer);
--- 274,284 ----
set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
! tdep->gregset
! = regset_xmalloc (&sparc32nbsd_gregset, sparc32nbsd_supply_gregset, NULL);
tdep->sizeof_gregset = 20 * 4;
! tdep->fpregset = regset_xmalloc (NULL, sparc32nbsd_supply_fpregset, NULL);
tdep->sizeof_fpregset = 33 * 4;
frame_unwind_append_sniffer (gdbarch, sparc32nbsd_sigtramp_frame_sniffer);
Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.572
diff -c -p -r1.572 Makefile.in
*** gdb/Makefile.in 17 May 2004 15:16:39 -0000 1.572
--- gdb/Makefile.in 19 May 2004 04:12:33 -0000
*************** COMMON_OBS = $(DEPFILES) $(YYOBJ) \
*** 910,916 ****
frame-base.o \
gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \
cp-namespace.o \
! reggroups.o \
trad-frame.o \
tramp-frame.o
--- 910,916 ----
frame-base.o \
gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \
cp-namespace.o \
! reggroups.o regset.o \
trad-frame.o \
tramp-frame.o
*************** regcache.o: regcache.c $(defs_h) $(infer
*** 2197,2202 ****
--- 2197,2203 ----
$(gdb_string_h) $(gdbcmd_h) $(observer_h)
reggroups.o: reggroups.c $(defs_h) $(reggroups_h) $(gdbtypes_h) \
$(gdb_assert_h) $(regcache_h) $(command_h) $(gdbcmd_h)
+ regset.o: regset.c $(defs_h) $(regset_h) $(gdb_assert_h)
remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \
$(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) $(gdb_stabs_h) \
$(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) $(gdb_assert_h) \
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RFA: use constructor to build 'struct regset' objects
2004-05-19 4:15 ` Jim Blandy
@ 2004-05-19 8:36 ` kettenis
2004-05-20 3:11 ` Jim Blandy
2004-05-19 14:56 ` Andrew Cagney
1 sibling, 1 reply; 8+ messages in thread
From: kettenis @ 2004-05-19 8:36 UTC (permalink / raw)
To: jimb; +Cc: gdb-patches
From: Jim Blandy <jimb@redhat.com>
Date: 18 May 2004 23:11:06 -0500
How's this:
2004-05-17 Jim Blandy <jimb@redhat.com>
Use a constructor function to create regset structures.
* regset.h (supply_regset_ftype, fill_regset_ftype): New typedefs.
(struct regset): Use supply_regset_ftype. Add new
'fill_regset' member.
(regset_xmalloc): New declaration.
* regset.c: New file.
* am64-tdep.c (amd64_regset_from_core_section): Use
regset_xmalloc to construct regset structures.
* amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
* i386-tdep.c (i386_regset_from_core_section): Same.
* i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
* i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
* sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
* sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
* sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
* sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
* Makefile.in (COMMON_OBS): Add regset.o.
(regset.o): New rule.
Could you use collect_regset instead of fill_regset. I deliberately
added regcache_raw_collect instead of regcache_raw_fill. Oh, and your
prototype for fill_regset_ftype is wrong. Should be:
typedef void (collect_regset_ftype) (const struct regsecache *,
const struct regcache *,
int, void *, size_t);
(watch the `const').
Consider a patch with those changes pre-approved.
Mark
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RFA: use constructor to build 'struct regset' objects
2004-05-19 4:15 ` Jim Blandy
2004-05-19 8:36 ` kettenis
@ 2004-05-19 14:56 ` Andrew Cagney
2004-05-20 3:11 ` Jim Blandy
1 sibling, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2004-05-19 14:56 UTC (permalink / raw)
To: Jim Blandy; +Cc: Mark Kettenis, gdb-patches
+ struct regset *regset_xmalloc (void *descr,
+ supply_regset_ftype *supply_regset,
+ fill_regset_ftype *fill_regset)
+ {
Can you run the file through gdb_indent.sh?
+ struct regset *r = (struct regset *) xmalloc (sizeof (*r));
Since this data belongs to an architecture, this should be allocated
from the architecture's obstack. I suspect this is a pre-existing bug
but can you still fix it?
Andrew
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RFA: use constructor to build 'struct regset' objects
2004-05-19 8:36 ` kettenis
@ 2004-05-20 3:11 ` Jim Blandy
2004-05-20 6:51 ` Jim Blandy
0 siblings, 1 reply; 8+ messages in thread
From: Jim Blandy @ 2004-05-20 3:11 UTC (permalink / raw)
To: kettenis; +Cc: gdb-patches
kettenis@gnu.org writes:
> From: Jim Blandy <jimb@redhat.com>
> Date: 18 May 2004 23:11:06 -0500
>
> How's this:
>
> 2004-05-17 Jim Blandy <jimb@redhat.com>
>
> Use a constructor function to create regset structures.
> * regset.h (supply_regset_ftype, fill_regset_ftype): New typedefs.
> (struct regset): Use supply_regset_ftype. Add new
> 'fill_regset' member.
> (regset_xmalloc): New declaration.
> * regset.c: New file.
> * am64-tdep.c (amd64_regset_from_core_section): Use
> regset_xmalloc to construct regset structures.
> * amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
> * i386-tdep.c (i386_regset_from_core_section): Same.
> * i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
> * i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
> * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
> * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
> * sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
> * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
> * Makefile.in (COMMON_OBS): Add regset.o.
> (regset.o): New rule.
>
> Could you use collect_regset instead of fill_regset. I deliberately
> added regcache_raw_collect instead of regcache_raw_fill. Oh, and your
> prototype for fill_regset_ftype is wrong. Should be:
>
> typedef void (collect_regset_ftype) (const struct regsecache *,
> const struct regcache *,
> int, void *, size_t);
>
> (watch the `const').
>
> Consider a patch with those changes pre-approved.
Committed, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RFA: use constructor to build 'struct regset' objects
2004-05-19 14:56 ` Andrew Cagney
@ 2004-05-20 3:11 ` Jim Blandy
0 siblings, 0 replies; 8+ messages in thread
From: Jim Blandy @ 2004-05-20 3:11 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Mark Kettenis, gdb-patches
Andrew Cagney <cagney@gnu.org> writes:
> > + struct regset *regset_xmalloc (void *descr,
> > + supply_regset_ftype *supply_regset,
> > + fill_regset_ftype *fill_regset)
> > + {
>
> Can you run the file through gdb_indent.sh?
I thought that looked odd. Thanks; this is fixed in the change I
committed.
> > + struct regset *r = (struct regset *) xmalloc (sizeof (*r));
>
> Since this data belongs to an architecture, this should be allocated
> From the architecture's obstack. I suspect this is a pre-existing
> bug but can you still fix it?
I'll take a look at it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RFA: use constructor to build 'struct regset' objects
2004-05-20 3:11 ` Jim Blandy
@ 2004-05-20 6:51 ` Jim Blandy
0 siblings, 0 replies; 8+ messages in thread
From: Jim Blandy @ 2004-05-20 6:51 UTC (permalink / raw)
To: kettenis; +Cc: gdb-patches
Jim Blandy <jimb@redhat.com> writes:
> kettenis@gnu.org writes:
> > From: Jim Blandy <jimb@redhat.com>
> > Date: 18 May 2004 23:11:06 -0500
> >
> > How's this:
> >
> > 2004-05-17 Jim Blandy <jimb@redhat.com>
> >
> > Use a constructor function to create regset structures.
> > * regset.h (supply_regset_ftype, fill_regset_ftype): New typedefs.
> > (struct regset): Use supply_regset_ftype. Add new
> > 'fill_regset' member.
> > (regset_xmalloc): New declaration.
> > * regset.c: New file.
> > * am64-tdep.c (amd64_regset_from_core_section): Use
> > regset_xmalloc to construct regset structures.
> > * amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
> > * i386-tdep.c (i386_regset_from_core_section): Same.
> > * i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
> > * i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
> > * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
> > * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
> > * sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
> > * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
> > * Makefile.in (COMMON_OBS): Add regset.o.
> > (regset.o): New rule.
> >
> > Could you use collect_regset instead of fill_regset. I deliberately
> > added regcache_raw_collect instead of regcache_raw_fill. Oh, and your
> > prototype for fill_regset_ftype is wrong. Should be:
> >
> > typedef void (collect_regset_ftype) (const struct regsecache *,
> > const struct regcache *,
> > int, void *, size_t);
> >
> > (watch the `const').
> >
> > Consider a patch with those changes pre-approved.
>
> Committed, thanks.
Oh, and here's the changed patch:
2004-05-17 Jim Blandy <jimb@redhat.com>
Use a constructor function to create regset structures.
* regset.h (supply_regset_ftype, collect_regset_ftype): New typedefs.
(struct regset): Use supply_regset_ftype. Add new
'collect_regset' member.
(regset_xmalloc): New declaration.
* regset.c: New file.
* am64-tdep.c (amd64_regset_from_core_section): Use
regset_xmalloc to construct regset structures.
* amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
* i386-tdep.c (i386_regset_from_core_section): Same.
* i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
* i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
* sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
* sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
* sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
* sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
* Makefile.in (COMMON_OBS): Add regset.o.
(regset.o): New rule.
Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.572
diff -c -p -r1.572 Makefile.in
*** gdb/Makefile.in 17 May 2004 15:16:39 -0000 1.572
--- gdb/Makefile.in 20 May 2004 00:46:57 -0000
*************** COMMON_OBS = $(DEPFILES) $(YYOBJ) \
*** 910,916 ****
frame-base.o \
gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \
cp-namespace.o \
! reggroups.o \
trad-frame.o \
tramp-frame.o
--- 910,916 ----
frame-base.o \
gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \
cp-namespace.o \
! reggroups.o regset.o \
trad-frame.o \
tramp-frame.o
*************** regcache.o: regcache.c $(defs_h) $(infer
*** 2197,2202 ****
--- 2197,2203 ----
$(gdb_string_h) $(gdbcmd_h) $(observer_h)
reggroups.o: reggroups.c $(defs_h) $(reggroups_h) $(gdbtypes_h) \
$(gdb_assert_h) $(regcache_h) $(command_h) $(gdbcmd_h)
+ regset.o: regset.c $(defs_h) $(regset_h) $(gdb_assert_h)
remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \
$(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) $(gdb_stabs_h) \
$(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) $(gdb_assert_h) \
Index: gdb/amd64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
retrieving revision 1.10
diff -c -p -r1.10 amd64-tdep.c
*** gdb/amd64-tdep.c 18 May 2004 21:20:25 -0000 1.10
--- gdb/amd64-tdep.c 20 May 2004 00:46:58 -0000
*************** amd64_regset_from_core_section (struct g
*** 1074,1084 ****
if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
{
if (tdep->fpregset == NULL)
! {
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->descr = tdep;
! tdep->fpregset->supply_regset = amd64_supply_fpregset;
! }
return tdep->fpregset;
}
--- 1074,1080 ----
if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
{
if (tdep->fpregset == NULL)
! tdep->fpregset = regset_xmalloc (tdep, amd64_supply_fpregset, NULL);
return tdep->fpregset;
}
Index: gdb/amd64obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64obsd-tdep.c,v
retrieving revision 1.10
diff -c -p -r1.10 amd64obsd-tdep.c
*** gdb/amd64obsd-tdep.c 15 May 2004 21:06:50 -0000 1.10
--- gdb/amd64obsd-tdep.c 20 May 2004 00:46:58 -0000
*************** amd64obsd_regset_from_core_section (stru
*** 63,73 ****
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE)
{
if (tdep->gregset == NULL)
! {
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = tdep;
! tdep->gregset->supply_regset = amd64obsd_supply_regset;
! }
return tdep->gregset;
}
--- 63,69 ----
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE)
{
if (tdep->gregset == NULL)
! tdep->gregset = regset_xmalloc (tdep, amd64obsd_supply_regset, NULL);
return tdep->gregset;
}
Index: gdb/i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.191
diff -c -p -r1.191 i386-tdep.c
*** gdb/i386-tdep.c 8 May 2004 23:02:10 -0000 1.191
--- gdb/i386-tdep.c 20 May 2004 00:46:59 -0000
*************** i386_regset_from_core_section (struct gd
*** 1662,1672 ****
if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
{
if (tdep->gregset == NULL)
! {
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = tdep;
! tdep->gregset->supply_regset = i386_supply_gregset;
! }
return tdep->gregset;
}
--- 1662,1668 ----
if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
{
if (tdep->gregset == NULL)
! tdep->gregset = regset_xmalloc (tdep, i386_supply_gregset, NULL);
return tdep->gregset;
}
*************** i386_regset_from_core_section (struct gd
*** 1675,1685 ****
&& sect_size == I387_SIZEOF_FXSAVE))
{
if (tdep->fpregset == NULL)
! {
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->descr = tdep;
! tdep->fpregset->supply_regset = i386_supply_fpregset;
! }
return tdep->fpregset;
}
--- 1671,1677 ----
&& sect_size == I387_SIZEOF_FXSAVE))
{
if (tdep->fpregset == NULL)
! tdep->fpregset = regset_xmalloc (tdep, i386_supply_fpregset, NULL);
return tdep->fpregset;
}
Index: gdb/i386nbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386nbsd-tdep.c,v
retrieving revision 1.24
diff -c -p -r1.24 i386nbsd-tdep.c
*** gdb/i386nbsd-tdep.c 9 Apr 2004 23:26:19 -0000 1.24
--- gdb/i386nbsd-tdep.c 20 May 2004 00:46:59 -0000
*************** i386nbsd_aout_regset_from_core_section (
*** 86,96 ****
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
{
if (tdep->gregset == NULL)
! {
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = tdep;
! tdep->gregset->supply_regset = i386nbsd_aout_supply_regset;
! }
return tdep->gregset;
}
--- 86,93 ----
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
{
if (tdep->gregset == NULL)
! tdep->gregset
! = regset_xmalloc (tdep, i386nbsd_aout_supply_regset, NULL);
return tdep->gregset;
}
Index: gdb/i386obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386obsd-tdep.c,v
retrieving revision 1.15
diff -c -p -r1.15 i386obsd-tdep.c
*** gdb/i386obsd-tdep.c 9 Apr 2004 23:26:19 -0000 1.15
--- gdb/i386obsd-tdep.c 20 May 2004 00:46:59 -0000
*************** i386obsd_aout_regset_from_core_section (
*** 141,151 ****
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
{
if (tdep->gregset == NULL)
! {
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = tdep;
! tdep->gregset->supply_regset = i386obsd_aout_supply_regset;
! }
return tdep->gregset;
}
--- 141,148 ----
&& sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
{
if (tdep->gregset == NULL)
! tdep->gregset
! = regset_xmalloc (tdep, i386obsd_aout_supply_regset, NULL);
return tdep->gregset;
}
Index: gdb/regset.c
===================================================================
RCS file: gdb/regset.c
diff -N gdb/regset.c
*** gdb/regset.c 1 Jan 1970 00:00:00 -0000
--- gdb/regset.c 20 May 2004 00:46:59 -0000
***************
*** 0 ****
--- 1,39 ----
+ /* Regset support functions, for GDB.
+
+ Copyright 2004 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+ #include "defs.h"
+ #include "regset.h"
+ #include "gdb_assert.h"
+
+
+ struct regset *
+ regset_xmalloc (void *descr,
+ supply_regset_ftype *supply_regset,
+ collect_regset_ftype *collect_regset)
+ {
+ struct regset *r = (struct regset *) xmalloc (sizeof (*r));
+
+ r->descr = descr;
+ r->supply_regset = supply_regset;
+ r->collect_regset = collect_regset;
+
+ return r;
+ }
Index: gdb/regset.h
===================================================================
RCS file: /cvs/src/src/gdb/regset.h,v
retrieving revision 1.1
diff -c -p -r1.1 regset.h
*** gdb/regset.h 26 Sep 2003 14:36:56 -0000 1.1
--- gdb/regset.h 20 May 2004 00:46:59 -0000
*************** struct gdbarch;
*** 26,31 ****
--- 26,36 ----
struct regcache;
/* Data structure describing a register set. */
+ typedef void (supply_regset_ftype) (const struct regset *, struct regcache *,
+ int, const void *, size_t);
+ typedef void (collect_regset_ftype) (const struct regset *,
+ const struct regcache *,
+ int, const void *, size_t);
struct regset
{
*************** struct regset
*** 33,41 ****
providing some sort of description of the register set. */
const void *descr;
! /* Function supplying a register set to a register cache. */
! void (*supply_regset) (const struct regset *, struct regcache *,
! int, const void *, size_t);
};
#endif /* regset.h */
--- 38,60 ----
providing some sort of description of the register set. */
const void *descr;
! /* Function supplying values in a register set to a register cache. */
! supply_regset_ftype *supply_regset;
!
! /* Function collecting values in a register set from a register cache. */
! collect_regset_ftype *collect_regset;
};
+
+
+ /* Allocate a fresh 'struct regset' whose descr is DESCR, whose
+ supply_regset function is SUPPLY_REGSET, and whose collect_regset
+ function is COLLECT_REGSET. If the regset has no collect function,
+ pass NULL for COLLECT_REGSET.
+
+ The object returned is allocated using xmalloc. */
+ extern struct regset *regset_xmalloc (void *descr,
+ supply_regset_ftype *supply_regset,
+ collect_regset_ftype *collect_regset);
+
#endif /* regset.h */
Index: gdb/sparc64fbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64fbsd-tdep.c,v
retrieving revision 1.6
diff -c -p -r1.6 sparc64fbsd-tdep.c
*** gdb/sparc64fbsd-tdep.c 10 Apr 2004 09:40:02 -0000 1.6
--- gdb/sparc64fbsd-tdep.c 20 May 2004 00:47:00 -0000
*************** sparc64fbsd_init_abi (struct gdbarch_inf
*** 199,211 ****
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = &sparc64fbsd_gregset;
! tdep->gregset->supply_regset = sparc64fbsd_supply_gregset;
tdep->sizeof_gregset = 256;
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->supply_regset = sparc64fbsd_supply_fpregset;
tdep->sizeof_fpregset = 272;
frame_unwind_append_sniffer (gdbarch, sparc64fbsd_sigtramp_frame_sniffer);
--- 199,209 ----
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset
! = regset_xmalloc (&sparc64fbsd_gregset, sparc64fbsd_supply_gregset, NULL);
tdep->sizeof_gregset = 256;
! tdep->fpregset = regset_xmalloc (NULL, sparc64fbsd_supply_fpregset, NULL);
tdep->sizeof_fpregset = 272;
frame_unwind_append_sniffer (gdbarch, sparc64fbsd_sigtramp_frame_sniffer);
Index: gdb/sparc64nbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64nbsd-tdep.c,v
retrieving revision 1.7
diff -c -p -r1.7 sparc64nbsd-tdep.c
*** gdb/sparc64nbsd-tdep.c 10 Apr 2004 09:40:02 -0000 1.7
--- gdb/sparc64nbsd-tdep.c 20 May 2004 00:47:00 -0000
*************** sparc64nbsd_init_abi (struct gdbarch_inf
*** 226,238 ****
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = &sparc64nbsd_gregset;
! tdep->gregset->supply_regset = sparc64nbsd_supply_gregset;
tdep->sizeof_gregset = 160;
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->supply_regset = sparc64nbsd_supply_fpregset;
tdep->sizeof_fpregset = 272;
frame_unwind_append_sniffer (gdbarch, sparc64nbsd_sigtramp_frame_sniffer);
--- 226,236 ----
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset
! = regset_xmalloc (&sparc64nbsd_gregset, sparc64nbsd_supply_gregset, NULL);
tdep->sizeof_gregset = 160;
! tdep->fpregset = regset_xmalloc (NULL, sparc64nbsd_supply_fpregset, NULL);
tdep->sizeof_fpregset = 272;
frame_unwind_append_sniffer (gdbarch, sparc64nbsd_sigtramp_frame_sniffer);
Index: gdb/sparc64obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64obsd-tdep.c,v
retrieving revision 1.3
diff -c -p -r1.3 sparc64obsd-tdep.c
*** gdb/sparc64obsd-tdep.c 10 Apr 2004 09:40:02 -0000 1.3
--- gdb/sparc64obsd-tdep.c 20 May 2004 00:47:00 -0000
*************** sparc64obsd_init_abi (struct gdbarch_inf
*** 184,192 ****
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = &sparc64obsd_core_gregset;
! tdep->gregset->supply_regset = sparc64obsd_supply_gregset;
tdep->sizeof_gregset = 832;
frame_unwind_append_sniffer (gdbarch, sparc64obsd_sigtramp_frame_sniffer);
--- 184,192 ----
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
! tdep->gregset = regset_xmalloc (&sparc64obsd_core_gregset,
! sparc64obsd_supply_gregset,
! NULL);
tdep->sizeof_gregset = 832;
frame_unwind_append_sniffer (gdbarch, sparc64obsd_sigtramp_frame_sniffer);
Index: gdb/sparcnbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparcnbsd-tdep.c,v
retrieving revision 1.18
diff -c -p -r1.18 sparcnbsd-tdep.c
*** gdb/sparcnbsd-tdep.c 18 Apr 2004 22:58:06 -0000 1.18
--- gdb/sparcnbsd-tdep.c 20 May 2004 00:47:00 -0000
*************** sparc32nbsd_init_abi (struct gdbarch_inf
*** 274,286 ****
set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
! tdep->gregset = XMALLOC (struct regset);
! tdep->gregset->descr = &sparc32nbsd_gregset;
! tdep->gregset->supply_regset = sparc32nbsd_supply_gregset;
tdep->sizeof_gregset = 20 * 4;
! tdep->fpregset = XMALLOC (struct regset);
! tdep->fpregset->supply_regset = sparc32nbsd_supply_fpregset;
tdep->sizeof_fpregset = 33 * 4;
frame_unwind_append_sniffer (gdbarch, sparc32nbsd_sigtramp_frame_sniffer);
--- 274,284 ----
set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
! tdep->gregset
! = regset_xmalloc (&sparc32nbsd_gregset, sparc32nbsd_supply_gregset, NULL);
tdep->sizeof_gregset = 20 * 4;
! tdep->fpregset = regset_xmalloc (NULL, sparc32nbsd_supply_fpregset, NULL);
tdep->sizeof_fpregset = 33 * 4;
frame_unwind_append_sniffer (gdbarch, sparc32nbsd_sigtramp_frame_sniffer);
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-05-20 6:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <vt2smdy93u9.fsf@zenia.home>
2004-05-17 21:32 ` RFA: use constructor to build 'struct regset' objects Jim Blandy
2004-05-17 21:48 ` Mark Kettenis
2004-05-19 4:15 ` Jim Blandy
2004-05-19 8:36 ` kettenis
2004-05-20 3:11 ` Jim Blandy
2004-05-20 6:51 ` Jim Blandy
2004-05-19 14:56 ` Andrew Cagney
2004-05-20 3:11 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox