Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755966Ab1DRQsN (ORCPT ); Mon, 18 Apr 2011 12:48:13 -0400 Received: from casper.infradead.org ([85.118.1.10]:55732 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755903Ab1DRQsF convert rfc822-to-8bit (ORCPT ); Mon, 18 Apr 2011 12:48:05 -0400 Subject: Re: [PATCH v3 2.6.39-rc1-tip 13/26] 13: uprobes: get the breakpoint address. From: Peter Zijlstra To: Srikar Dronamraju Cc: Ingo Molnar , Steven Rostedt , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Andi Kleen , Christoph Hellwig , Jonathan Corbet , Thomas Gleixner , Masami Hiramatsu , Oleg Nesterov , LKML , SystemTap , Jim Keniston , Roland McGrath , Ananth N Mavinakayanahalli , Andrew Morton In-Reply-To: <20110401143507.15455.87968.sendpatchset@localhost6.localdomain6> References: <20110401143223.15455.19844.sendpatchset@localhost6.localdomain6> <20110401143507.15455.87968.sendpatchset@localhost6.localdomain6> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Mon, 18 Apr 2011 18:47:22 +0200 Message-ID: <1303145242.32491.887.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 797 Lines: 19 On Fri, 2011-04-01 at 20:05 +0530, Srikar Dronamraju wrote: > +/** > + * uprobes_get_bkpt_addr - compute address of bkpt given post-bkpt regs > + * @regs: Reflects the saved state of the task after it has hit a breakpoint > + * instruction. > + * Return the address of the breakpoint instruction. > + */ > +unsigned long uprobes_get_bkpt_addr(struct pt_regs *regs) > +{ > + return instruction_pointer(regs) - UPROBES_BKPT_INSN_SIZE; > +} This assumes the breakpoint instruction is trap like, not fault like, is that true for all architectures? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/