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: [RFA/RFC] mips tracepoint: fix Bug 12013


On Wednesday 22 December 2010 06:04:28, Kevin Buettner wrote:
> You might consider implementing a new gdbarch method which provides a
> mapping from pseudo register numbers to raw register numbers.  The
> trace machinery could use such a mapping to find the corresponding raw
> register(s) when presented with a pseudo register.  I can think of
> several potential pitfalls with this approach, but I think the idea is
> worth exploring.

Such mapping will necessarily be a temporary kludge -- if such a mapping
were always possible, then we wouldn't have
gdbarch_pseudo_register_read/gdbarch_pseudo_register_read callbacks, but
we'd instead have a gdbarch_pseudo_register_to_raw_register callback,
or some such.

If you're going to add support for collecting pseudo registers, I'd
much rather you added a "gdbarch_pseudo_register_collect" callback,
that emitted the agent expression bits required to collect whatever 
gdbarch_pseudo_register_read needs to "read" the pseudo register
in question at trace buffer inspection time (tfind mode).  In the
mips case, you'd end up with only calls to ax_reg in that new
callback, it looks to me.
(Take a look at dwarf2loc.c:compile_dwarf_to_reg and it's ax_reg call,
for example.)

-- 
Pedro Alves


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