Hacking gdbserver to capture instruction-level code coverage
Daniel Jacobowitz
drow@false.org
Wed Jun 21 16:51:00 GMT 2006
On Wed, Jun 21, 2006 at 08:28:10AM -0700, Ron McCall wrote:
> I have attempted to hack gdbserver 6.5 to log
> instruction-level code coverage on a powerpc-linux
> system and it seems to work except that examining
> variables is broken as a result. Turning on remote
> debugging in gdb and comparing a run using an
> unmodified gdbserver and the modified gdbserver seems
> to show a difference with the DBAT0 register mapping
> in the 'g' packet responses. It would seem that my
> changes have somehow violated something and perhaps
> has confused the Linux kernel?
At this point you've lost me.
The PPC 'g' packet contains r0-r31, f0-f31, pc, ps, cr, lr, ctr, xer,
and fpscr. The BAT registers aren't involved at all; I don't even
think they're usable from userspace.
> Does any of this sound particularly evil? I can
> provide the small patch against the 6.5 source if
> anyone needs to see the changes in more detail.
Evil but functional, as long as you're being careful to not lose track
of signals.
--
Daniel Jacobowitz
CodeSourcery
More information about the Gdb
mailing list