This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Arm: change #defines to enums
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: Michael Snyder <msnyder at redhat dot com>
- Cc: Richard dot Earnshaw at arm dot com, Michael Snyder <msnyder at cygnus dot com>, gdb-patches at sources dot redhat dot com, cagney at redhat dot com, rearnsha at arm dot com
- Date: Fri, 19 Apr 2002 16:35:19 -0400
- Subject: Re: [RFA] Arm: change #defines to enums
- References: <200204191022.LAA17555@cam-mail2.cambridge.arm.com><3CC061EA.7118C72B@redhat.com>
Michael Snyder writes:
> Richard Earnshaw wrote:
> >
> > > Is this OK with folks?
> > >
> > > 2002-04-18 Michael Snyder <msnyder@redhat.com>
> > >
> > > * arm-tdep.h: Change defines to enums for ease of debugging.
> >
> > I'm happy with the change to the regnums, but not with the other bits.
Actually, would it be better to put the regnums inside the tdep
structure, like sh and powerpc do? That has really helped a lot when
adding a variant that has different registers.
Elena
> > The other fields are really parts of a bitmask, not separate enums.
> >
> > For example, it doesn't make sense to me to have enums that should be
> > orred together, as in FLAG_N | FLAG_Z.
> >
> > I suspect that
> >
> > ! enum gdb_condition_flag {
> > ! FLAG_N = 0x80000000,
> > ! FLAG_Z = 0x40000000,
> > ! FLAG_C = 0x20000000,
> > ! FLAG_V = 0x10000000
> > ! };
> >
> > will trip the problem with displaying enums with the top bit set on 32-bit
> > platforms, so instead of making debugging easier, it will make it
> > impossible. (There's a PR about it).
>
> Hmmm, all right, I'll omit those...
>
> >
> > I also can't really see how
> >
> > ! enum gdb_arm_const {
> > ! INT_REGISTER_RAW_SIZE = 4,
> > ! INT_REGISTER_VIRTUAL_SIZE = 4,
> > !
> > ...
> >
> > will make debugging easier, in fact I would say it would be more
> > confusing, since gdb won't know which one to use when displaying a value.
>
> The idea is just that, if I'm debugging and I see
> INT_REGISTER_RAW_SIZE in an expression, I can find out
> what its value is.
>
> Michael