[PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli GDB uses a variant of the trap instruction that is different from the one used by uprobes. Currently, running gdb on a program being traced by uprobes causes an endless loop since uprobes doesn't understand that the trap is inserted by some other entity and hence

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Oleg Nesterov
Hi Ananth, First of all, let me remind that I know nothing about powerpc ;) But iirc we already discussed this a bit, I forgot the details but still I have some concerns... On 03/20, Ananth N Mavinakayanahalli wrote: > > GDB uses a variant of the trap instruction that is different from the > one

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Oleg Nesterov
On 03/20, Oleg Nesterov wrote: > > But we did not install UPROBE_SWBP_INSN. Is it fine? I hope yes, just to > verify. If not, we need 2 definitions. is_uprobe_insn() should still check > insns == UPROBE_SWBP_INSN, and is_swbp_insn() should check is_trap(). > > And I am just curious, could you expla

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Ananth N Mavinakayanahalli
On Wed, Mar 20, 2013 at 01:26:39PM +0100, Oleg Nesterov wrote: > Hi Ananth, > > First of all, let me remind that I know nothing about powerpc ;) > > But iirc we already discussed this a bit, I forgot the details but > still I have some concerns... > > On 03/20, Ananth N Mavinakayanahalli wrote:

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Ananth N Mavinakayanahalli
On Wed, Mar 20, 2013 at 01:43:01PM +0100, Oleg Nesterov wrote: > On 03/20, Oleg Nesterov wrote: > > > > But we did not install UPROBE_SWBP_INSN. Is it fine? I hope yes, just to > > verify. If not, we need 2 definitions. is_uprobe_insn() should still check > > insns == UPROBE_SWBP_INSN, and is_swbp_

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Oleg Nesterov
On 03/20, Ananth N Mavinakayanahalli wrote: > > On Wed, Mar 20, 2013 at 01:26:39PM +0100, Oleg Nesterov wrote: > > But, at the same time, is the new definition fine for verify_opcode()? > > > > IOW, powerpc has another is_trap() insn(s) used by gdb, lets denote it X. > > X != UPROBE_SWBP_INSN. > >

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Oleg Nesterov
On 03/20, Ananth N Mavinakayanahalli wrote: > > On Wed, Mar 20, 2013 at 01:43:01PM +0100, Oleg Nesterov wrote: > > On 03/20, Oleg Nesterov wrote: > > > > > > But we did not install UPROBE_SWBP_INSN. Is it fine? I hope yes, just to > > > verify. If not, we need 2 definitions. is_uprobe_insn() should

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Ananth N Mavinakayanahalli
On Wed, Mar 20, 2013 at 05:06:44PM +0100, Oleg Nesterov wrote: > On 03/20, Ananth N Mavinakayanahalli wrote: > > > > On Wed, Mar 20, 2013 at 01:26:39PM +0100, Oleg Nesterov wrote: > > > > > But, at the same time, is the new definition fine for verify_opcode()? > > > > > > IOW, powerpc has another i

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Ananth N Mavinakayanahalli
On Wed, Mar 20, 2013 at 05:07:28PM +0100, Oleg Nesterov wrote: > On 03/20, Ananth N Mavinakayanahalli wrote: > > > > On Wed, Mar 20, 2013 at 01:43:01PM +0100, Oleg Nesterov wrote: > > > On 03/20, Oleg Nesterov wrote: > > > > > > > > But we did not install UPROBE_SWBP_INSN. Is it fine? I hope yes, j

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Oleg Nesterov
On 03/21, Ananth N Mavinakayanahalli wrote: > > On Wed, Mar 20, 2013 at 05:06:44PM +0100, Oleg Nesterov wrote: > > > > > But we did not install UPROBE_SWBP_INSN. Is it fine? I hope yes, just to > > > > verify. If not, we need 2 definitions. is_uprobe_insn() should still > > > > check > > > > insns

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Oleg Nesterov
On 03/21, Ananth N Mavinakayanahalli wrote: ? > On Wed, Mar 20, 2013 at 05:07:28PM +0100, Oleg Nesterov wrote: > > On 03/20, Ananth N Mavinakayanahalli wrote: > > > > > > On Wed, Mar 20, 2013 at 01:43:01PM +0100, Oleg Nesterov wrote: > > > > On 03/20, Oleg Nesterov wrote: > > > > > > > > > IOW, if

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Ananth N Mavinakayanahalli
On Thu, Mar 21, 2013 at 05:00:02PM +0100, Oleg Nesterov wrote: > On 03/21, Ananth N Mavinakayanahalli wrote: > ? > > On Wed, Mar 20, 2013 at 05:07:28PM +0100, Oleg Nesterov wrote: > > > On 03/20, Ananth N Mavinakayanahalli wrote: > > > > > > > > On Wed, Mar 20, 2013 at 01:43:01PM +0100, Oleg Nester

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Ananth N Mavinakayanahalli
On Thu, Mar 21, 2013 at 04:58:09PM +0100, Oleg Nesterov wrote: > On 03/21, Ananth N Mavinakayanahalli wrote: > > > > On Wed, Mar 20, 2013 at 05:06:44PM +0100, Oleg Nesterov wrote: > > > > > > > But we did not install UPROBE_SWBP_INSN. Is it fine? I hope yes, just > > > > > to > > > > > verify. If

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-22 Thread Oleg Nesterov
On 03/22, Ananth N Mavinakayanahalli wrote: > > On Thu, Mar 21, 2013 at 04:58:09PM +0100, Oleg Nesterov wrote: > > > > - verify_opcode()->is_swbp_insn() means: > > > > is this insn fine for uprobe? (we do not care about > > gdb, we simply ignore this problem) > > I will