This is the mail archive of the gdb-patches@sources.redhat.com 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: [RFA] better alpha_register_virtual_type


On Mon, Jun 02, 2003 at 09:43:05AM -0700, Richard Henderson wrote:
> On Mon, Jun 02, 2003 at 12:30:36PM -0400, Daniel Jacobowitz wrote:
> > Yes.  I was a little surprised by the void_data_ptr/void_func_ptr bit,
> > but I see that d10v does the same thing, so it must be right :)
> >
> > Hmm, I'm not sure.  Any particular reason for this patch?
> 
> Well, the void_func_ptr bit is nice because "info r" yields
> 
> 	pc             0x12000053c      0x12000053c <main+16>
> 
> The void_data_ptr bits I think just document which registers
> are ABI mandated to contain pointer values all of the time.

Hmm, that's pretty nice.  Sure.

> Actually, I have a related question here.  Something that I
> didn't notice earlier is that d10v is using register_type,
> not register_virtual_type.  Looking at the guts of regcache.c,
> it would appear that the later is deprecated, since not 
> having a register_type hook (among other things) results in
> legacy_p being set.
> 
> I thought it obvious to rename my existing hook, but that changes
> the behaviour of "info r" -- I no longer get the pc decoded, and
> indeed "ptype $pc" once again yields int64_t.
> 
> Is this a bug elsewhere in gdb, or what?

Hum.  That seems strange if you look at init_regcache_descr, since
gdbarch_register_type and REGISTER_VIRTUAL_TYPE are used similarly.  I
can't see how legacy_p would affect this.

What does ptype $pc say - does it show up as an int64_t or a code
pointer?

> Oh, and wrt regcache's legacy_p, it seems to want you to implement
> the pseudo_register_{read,write} hooks, even if the target doesn't
> have any.  But nevertheless d10v doesn't implement the hooks.
> Perhaps the predicates should be modified to notice that there are
> no pseudos defined?

I don't see what you mean; it's:
  if (!gdbarch_pseudo_register_read_p (gdbarch)
      && !gdbarch_pseudo_register_write_p (gdbarch)
      && !gdbarch_register_type_p (gdbarch))

but gdbarch_register_type_p should be true.

"maint print registers" might be handy here.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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