This is the mail archive of the
mailing list for the GDB project.
Re: Register group proposal
- To: eliz at is dot elta dot co dot il
- Subject: Re: Register group proposal
- From: Nick Duffek <nsd at redhat dot com>
- Date: Thu, 22 Feb 2001 07:37:55 -0500
- CC: gdb at sources dot redhat dot com, insight at sources dot redhat dot com
- References: <Pine.SUN.3.91.1010222105511.1660T-100000@is>
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 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
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.