On 12/11, K.Prasad wrote: > > On Thu, Dec 10, 2009 at 08:24:36PM +0100, Oleg Nesterov wrote: > > > > Oh well. I spent this day grepping arch/powerpc to understand how > > PTRACE_SET_DEBUGREG works and what is the problem. But I am afraid > > this time I need a help from someone who understands the hardware > > magic on powerpc. > > > > There's relatively less magic with PPC64 (with just one DABR) compared > to x86 :-) > > I hope to offer a little help here (given that I work to tweak > ptrace_set_debugreg() in PPC64 to use the hw-breakpoint interfaces)....
Thanks, please see another email, I cc'ed you. > Watchpoints (using DABR) through GDB can fail for many reasons....they > must ideally be set after the program has started execution - to enable > GDB know the size of the variable...else they would resort to > single-stepping to trap access to the target variable. Yes. I straced gdb to be sure it really does PTRACE_SET_DEBUGREF to use the hardware watchpoint. There is something strange though. gdb does PTRACE_SINGLESTEP and only then PTRACE_CONT after "watch xxx". > Where can one find the relevant piece of testcase? http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/tests/ptrace-tests/tests/watchpoint.c?cvsroot=systemtap Oleg.