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: Michael Snyder <msnyder at redhat dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: 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 15:33:25 -0700
- Subject: Re: [RFA] Arm: change #defines to enums
- Organization: Red Hat, Inc.
- References: <200204221035.LAA03470@cam-mail2.cambridge.arm.com>
Richard Earnshaw wrote:
>
> > >
> > > 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.
OK then -- I've committed only the regnums.
Michael