* [RFA] alpha_register_reggroup_p
@ 2003-06-02 3:28 Richard Henderson
2003-06-02 3:54 ` Andrew Cagney
0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2003-06-02 3:28 UTC (permalink / raw)
To: gdb-patches
The main object here is to get the FPCR to be considered
part of the FP state. It's not immediately clear what to
do with the PALcode UNIQ value, but "system" seems a good
choice.
Ok?
r~
* alpha-tdep.c (alpha_register_reggroup_p): New.
(alpha_gdbarch_init): Register it.
--- alpha-tdep.c.11 2003-06-01 20:11:56.000000000 -0700
+++ alpha-tdep.c 2003-06-01 20:15:28.000000000 -0700
@@ -20,6 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "doublest.h"
#include "frame.h"
#include "frame-unwind.h"
#include "frame-base.h"
@@ -34,7 +35,7 @@
#include "gdb_string.h"
#include "linespec.h"
#include "regcache.h"
-#include "doublest.h"
+#include "reggroups.h"
#include "arch-utils.h"
#include "osabi.h"
#include "block.h"
@@ -102,6 +103,39 @@ alpha_register_virtual_type (int regno)
return builtin_type_int64;
}
+/* Is REGNUM a member of REGGROUP? */
+
+static int
+alpha_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
+ struct reggroup *group)
+{
+ /* Filter out any registers eliminated, but whose regnum is
+ reserved for backward compatibility, e.g. the vfp. */
+ if (REGISTER_NAME (regnum) == NULL || *REGISTER_NAME (regnum) == '\0')
+ return 0;
+
+ /* Since we implement no pseudo registers, save/restore is equal to all. */
+ if (group == all_reggroup
+ || group == save_reggroup
+ || group == restore_reggroup)
+ return 1;
+
+ /* All other groups are non-overlapping. */
+
+ /* Since this is really a PALcode memory slot... */
+ if (regnum == ALPHA_UNIQUE_REGNUM)
+ return group == system_reggroup;
+
+ /* Force the FPCR to be considered part of the floating point state. */
+ if (regnum == ALPHA_FPCR_REGNUM)
+ return group == float_reggroup;
+
+ if (regnum >= ALPHA_FP0_REGNUM && regnum < ALPHA_FP0_REGNUM + 31)
+ return group == float_reggroup;
+ else
+ return group == general_reggroup;
+}
+
static int
alpha_register_byte (int regno)
{
@@ -1418,6 +1452,8 @@ alpha_gdbarch_init (struct gdbarch_info
alpha_register_convert_to_virtual);
set_gdbarch_register_convert_to_raw (gdbarch, alpha_register_convert_to_raw);
+ set_gdbarch_register_reggroup_p (gdbarch, alpha_register_reggroup_p);
+
/* Prologue heuristics. */
set_gdbarch_skip_prologue (gdbarch, alpha_skip_prologue);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] alpha_register_reggroup_p
2003-06-02 3:28 [RFA] alpha_register_reggroup_p Richard Henderson
@ 2003-06-02 3:54 ` Andrew Cagney
2003-06-02 3:58 ` Richard Henderson
2003-06-02 4:00 ` Richard Henderson
0 siblings, 2 replies; 6+ messages in thread
From: Andrew Cagney @ 2003-06-02 3:54 UTC (permalink / raw)
To: Richard Henderson; +Cc: gdb-patches
> The main object here is to get the FPCR to be considered
> part of the FP state. It's not immediately clear what to
> do with the PALcode UNIQ value, but "system" seems a good
> choice.
> * alpha-tdep.c (alpha_register_reggroup_p): New.
> (alpha_gdbarch_init): Register it.
>
> --- alpha-tdep.c.11 2003-06-01 20:11:56.000000000 -0700
> +++ alpha-tdep.c 2003-06-01 20:15:28.000000000 -0700
> @@ -20,6 +20,7 @@
> Boston, MA 02111-1307, USA. */
>
> #include "defs.h"
> +#include "doublest.h"
> #include "frame.h"
> #include "frame-unwind.h"
> #include "frame-base.h"
> @@ -34,7 +35,7 @@
> #include "gdb_string.h"
> #include "linespec.h"
> #include "regcache.h"
> -#include "doublest.h"
> +#include "reggroups.h"
> #include "arch-utils.h"
> #include "osabi.h"
> #include "block.h"
> @@ -102,6 +103,39 @@ alpha_register_virtual_type (int regno)
> return builtin_type_int64;
> }
>
> +/* Is REGNUM a member of REGGROUP? */
> +
> +static int
> +alpha_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
> + struct reggroup *group)
> +{
> + /* Filter out any registers eliminated, but whose regnum is
> + reserved for backward compatibility, e.g. the vfp. */
> + if (REGISTER_NAME (regnum) == NULL || *REGISTER_NAME (regnum) == '\0')
> + return 0;
> +
> + /* Since we implement no pseudo registers, save/restore is equal to all. */
> + if (group == all_reggroup
> + || group == save_reggroup
> + || group == restore_reggroup)
> + return 1;
Should UNIQ be in save/restore (I don't know, I'm just asking)?
> + /* All other groups are non-overlapping. */
> +
> + /* Since this is really a PALcode memory slot... */
> + if (regnum == ALPHA_UNIQUE_REGNUM)
> + return group == system_reggroup;
> +
> + /* Force the FPCR to be considered part of the floating point state. */
> + if (regnum == ALPHA_FPCR_REGNUM)
> + return group == float_reggroup;
Good. Finally a useful "info float".
> + if (regnum >= ALPHA_FP0_REGNUM && regnum < ALPHA_FP0_REGNUM + 31)
> + return group == float_reggroup;
> + else
> + return group == general_reggroup;
> +}
yes, ok.
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] alpha_register_reggroup_p
2003-06-02 3:54 ` Andrew Cagney
@ 2003-06-02 3:58 ` Richard Henderson
2003-06-02 4:00 ` Richard Henderson
1 sibling, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2003-06-02 3:58 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Sun, Jun 01, 2003 at 11:54:31PM -0400, Andrew Cagney wrote:
> Should UNIQ be in save/restore (I don't know, I'm just asking)?
I really have no idea. As far as I can tell, the default
version just saved/restored all "real" registers, as opposed
to those "pseudos" constructed by gdb.
Is there some more specific meaning they should be interpreted with?
If this is "the set of registers not to be clobbered when gdb
does an inferior function call" I'd say, "probably".
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] alpha_register_reggroup_p
2003-06-02 3:54 ` Andrew Cagney
2003-06-02 3:58 ` Richard Henderson
@ 2003-06-02 4:00 ` Richard Henderson
2003-06-02 4:21 ` Daniel Jacobowitz
1 sibling, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2003-06-02 4:00 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Sun, Jun 01, 2003 at 11:54:31PM -0400, Andrew Cagney wrote:
> >+ /* Force the FPCR to be considered part of the floating point state. */
> >+ if (regnum == ALPHA_FPCR_REGNUM)
> >+ return group == float_reggroup;
>
> Good. Finally a useful "info float".
Incidentally, is there a good way to get "info r fpcr" to
decode the bits in this register?
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] alpha_register_reggroup_p
2003-06-02 4:00 ` Richard Henderson
@ 2003-06-02 4:21 ` Daniel Jacobowitz
2003-06-02 19:11 ` Michael Snyder
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2003-06-02 4:21 UTC (permalink / raw)
To: Richard Henderson; +Cc: Andrew Cagney, gdb-patches
On Sun, Jun 01, 2003 at 09:00:03PM -0700, Richard Henderson wrote:
> On Sun, Jun 01, 2003 at 11:54:31PM -0400, Andrew Cagney wrote:
> > >+ /* Force the FPCR to be considered part of the floating point state. */
> > >+ if (regnum == ALPHA_FPCR_REGNUM)
> > >+ return group == float_reggroup;
> >
> > Good. Finally a useful "info float".
>
> Incidentally, is there a good way to get "info r fpcr" to
> decode the bits in this register?
Not really. Michal Ludvig proposed a set type for this some time ago
but I don't remember what happened to it. You could probably use the
Pascal-style power set type which GDB supports to acheive the same
thing.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] alpha_register_reggroup_p
2003-06-02 4:21 ` Daniel Jacobowitz
@ 2003-06-02 19:11 ` Michael Snyder
0 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2003-06-02 19:11 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Richard Henderson, Andrew Cagney, gdb-patches
Daniel Jacobowitz wrote:
>
> On Sun, Jun 01, 2003 at 09:00:03PM -0700, Richard Henderson wrote:
> > On Sun, Jun 01, 2003 at 11:54:31PM -0400, Andrew Cagney wrote:
> > > >+ /* Force the FPCR to be considered part of the floating point state. */
> > > >+ if (regnum == ALPHA_FPCR_REGNUM)
> > > >+ return group == float_reggroup;
> > >
> > > Good. Finally a useful "info float".
> >
> > Incidentally, is there a good way to get "info r fpcr" to
> > decode the bits in this register?
>
> Not really. Michal Ludvig proposed a set type for this some time ago
> but I don't remember what happened to it. You could probably use the
> Pascal-style power set type which GDB supports to acheive the same
> thing.
I think the standard thing is to intercept the "info reg" command
(there is a standard vector for doing so), and make it print
anything you want.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-06-02 19:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-02 3:28 [RFA] alpha_register_reggroup_p Richard Henderson
2003-06-02 3:54 ` Andrew Cagney
2003-06-02 3:58 ` Richard Henderson
2003-06-02 4:00 ` Richard Henderson
2003-06-02 4:21 ` Daniel Jacobowitz
2003-06-02 19:11 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox