This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH] sim: add --map-info option


On Tuesday, December 14, 2010 10:16:21 Mike Frysinger wrote:
> On Tuesday, December 14, 2010 02:35:58 Joel Brobecker wrote:
> > How about:
> >     
> >     char *
> >     io_map_to_str (unsigned nr_map)
> >     {
> 
> but this idea is good, so i'll implement it

ah, someone already beat us to it.  there's a map_to_str() func.

> > > +		sim_io_printf (sd, " map ");
> > > +		if (mapping->space != 0)
> > > +		  sim_io_printf (sd, "0x%lx:", (long) mapping->space);
> > > +		sim_io_printf (sd, "0x%08lx", (long) mapping->base);
> > > +		if (mapping->level != 0)
> > > +		  sim_io_printf (sd, "@0x%lx", (long) mapping->level);
> > > +		sim_io_printf (sd, ",0x%lx", (long) mapping->nr_bytes);
> > > +		modulo = mapping->mask + 1;
> > > +		if (modulo != 0)
> > > +		  sim_io_printf (sd, "%%0x%lx", (long) modulo);
> > 
> > I don't understand the necessity to cast everything to long. Can you
> > explain?
> 
> it's taken largely unchanged from the OPTION_MEMORY_INFO case block just
> above my new block.  i guess my new code could review the types and do it
> right.

ok, some of the (long) casts are necessary.  specifically, the ones who have a 
type of "unsigned_word" as those depend on the target bitness (which could be 
16, 32, or 64).
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


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