Re: [patch] [i386] Put hlt at the ON_STACK breakpoint [Re: GDB 7.4.91 available for testing]

Jan Kratochvil
2012-07-23T20:16:57Z

On Mon, 23 Jul 2012 22:07:27 +0200, Philippe Waroquiers wrote:
> Note that the trap instruction should only be written by the
> push_dummy_code function : for Normal breakpoints, only a Z0 packet
> should be done, as Valgrind will not allow to modify the guest
> executable code (it is not mapped writable).

I do not understand now what is and what is not allowed for valgrind to write.

For the inferior call to work at all you have to create the stack frame for
it, otherwise it cannot work, at least for parameters passed by stack.

So the GDB patch is no longer needed when you have fixed valgrind to put 0xcc
during Z0? Why valgrind cannot write 0xcc into stack memory when it already
has to write there to create the stack frame / parameters passed by stack?

(Yes, I should read valgrind source code instead.)

IIUC the 'hlt' cleanup patch can go only for 7.6 as 7.5 should not regress
with new/fixed valgrind.

Thanks,
Jan