This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Arm: change #defines to enums


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]