This is the mail archive of the gdb@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]

Re: Register group proposal


On 22-Feb-2001, Eli Zaretskii wrote:

>If we are to use an iterator, shouldn't the test in this loop be
>abstracted as well, like this, for instance?

Not necessarily: something like REGGROUP_FIRST_REGNUM and
REGGROUP_NEXT_REGNUM are required for implementing multiple groups, but
REGGROUP_NOT_LAST_REGNUM isn't.

REGGROUP_NOT_LAST_REGNUM is consistent with the notion of changing integer
register numbers into opaque identifiers (aka handles or cookies).

But declaring that -1 is a reserved register identifier doesn't tie our
hands much interface-wise.  It works pretty well for various UNIX file and
memory interfaces.

Maybe we need to establish some GDB coding policies about handles defined
and passed around by abstract interfaces: should they be ints, struct
pointers, typedefs, etc., and should there be a known-invalid value such
as -1 or NULL?

At any rate, for now I'd like to avoid the question for register numbers
and stick with existing convention, namely that register handles are ints
and -1 is invalid.

Nick


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