Re: [patchv2] Write bpt at the ON_STACK bpt address

Philippe Waroquiers
2012-07-26T21:50:02Z

On Thu, 2012-07-26 at 23:23 +0200, Jan Kratochvil wrote:
> On Thu, 26 Jul 2012 00:39:33 +0200, Joel Brobecker wrote:
> > > A valid instruction is not enough. We need a valid instruction
> > > that will cause Valgrind to terminate block translation.
> > > The breakpoint trap instruction is ok for that.
> > > (0xcc for x86 and amd64, 0x0005000d for mips32).
> >
> > I think it is fine to update GDB to insert the breakpoint instruction
> > instead of leaving random bytes at the breakpoint location.
>
> Attached. I no longer find it useful as arch-dependent code, it would do the
> same in each arch.
>
> No regressions on {x86_64,x86_64-m32,i686}-fedorarawhide-linux-gnu.
>
> Philippe, do you have an easy enough way to regression test it on mips when
> you was asking for the mips fix? mips has many execution modes as I see.
Thanks for the patch.
For mips, I have an access to gcc compile farm (gcc49).
So, I can check it works on at least the execution mode of this machine.

>
> I still have to write a testcase for it using valgrind.
IIUC, this implies to write a new 'gdbserver board file' (or something
like that) which will allow to access the Valgrind gdbsrv.

Note that this is covered by the Valgrind regression tests
(that is how the change of behaviour with 7.4.91 was detected).

Philippe