From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Snyder To: Daniel Jacobowitz Cc: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] gdb extension for Harvard architectures Date: Wed, 03 Oct 2001 11:12:00 -0000 Message-id: <3BBB54C6.5392258C@cygnus.com> References: <3BB4D843.A92818B9@cygnus.com> <3BB4E273.5020308@cygnus.com> <3BBB4D90.AE2B5AEE@cygnus.com> <20011003140639.A661@nevyn.them.org> X-SW-Source: 2001-10/msg00053.html 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.