Register group proposal
Nick Duffek
nsd@redhat.com
Thu Feb 22 04:29:00 GMT 2001
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
More information about the Gdb
mailing list