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: Richard Earnshaw <rearnsha at arm 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: Mon, 22 Apr 2002 11:35:38 +0100
- Subject: Re: [RFA] Arm: change #defines to enums
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> >
> > 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.
(Well, dwarf2 debug info should be able to tell you (if you've turned the
level up enough to add that detail :-)
However, The main problem I have with the above, is that ..._RAW_SIZE and
.._VIRTUAL_SIZE should be in different enums.
Just because C doesn't apply a strict typing model to enums (sadly), is no
reason to abuse these. A variable holding a RAW_SIZE value shouldn't also
be holding a VIRTUAL_SIZE, the two are different and hence the enums
describing them should be also.
R.