[RFC/RFA] gdb extension for Harvard architectures

Michael Snyder msnyder@cygnus.com
Wed Oct 3 11:12:00 GMT 2001


Daniel Jacobowitz wrote:
> 
> On Wed, Oct 03, 2001 at 10:40:32AM -0700, Michael Snyder wrote:
> > Andrew Cagney wrote:
> > >
> > > > + extern char *
> > > > + address_space_int_to_name (int space_flag)
> > > > + {
> > > > +   if (space_flag & TYPE_FLAG_CODE_SPACE)
> > > > +     return "code";
> > > > +   else if (space_flag & TYPE_FLAG_DATA_SPACE)
> > > > +     return "data";
> > > > +   else
> > > > +     return NULL;
> > > > + }
> > > > +
> > >
> > > Some thoughts on the internals.
> > >
> > > Should these spaces be flags or an enumeration?  I don't think being
> > > able to specify space = (CODE | DATA) is meanginful.  Haveing bit masks
> > > also puts a limitation on the number of spaces.
> >
> > Yes, but it's a generous limitation (there are 20 more bits available).
> > I'll go either way -- the trade-off is that if we don't use the "flags"
> > field, we have to add a new field to the (struct type) data structure.
> 
> May I suggest:
>         if ((space_flag & TYPE_FLAG_SPACE_MASK) == TYPE_FLAG_CODE_SPACE)
> 
> I'd prefer to preserve the knowledge that an object is in only one
> space.

Sure, good suggestion.



More information about the Gdb-patches mailing list