From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17277 invoked by alias); 1 Feb 2009 23:33:05 -0000 Received: (qmail 17268 invoked by uid 22791); 1 Feb 2009 23:33:05 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,FB_WORD1_END_DOLLAR,J_CHICKENPOX_53 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 01 Feb 2009 23:32:54 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id E7D42109AE; Sun, 1 Feb 2009 23:32:51 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id C3034108C4; Sun, 1 Feb 2009 23:32:51 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LTlo3-00074T-Be; Sun, 01 Feb 2009 18:32:51 -0500 Date: Sun, 01 Feb 2009 23:33:00 -0000 From: Daniel Jacobowitz To: Doug Evans Cc: gdb@sourceware.org Subject: Re: i386 int3 handling, running vs stepping Message-ID: <20090201233251.GA27142@caradoc.them.org> Mail-Followup-To: Doug Evans , gdb@sourceware.org References: <20090201231819.A9FB61C7A19@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090201231819.A9FB61C7A19@localhost> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-02/txt/msg00002.txt.bz2 On Sun, Feb 01, 2009 at 03:18:19PM -0800, Doug Evans wrote: > Program received signal SIGTRAP, Trace/breakpoint trap. > main () at int3.S:6 > 6 nop > > Note that $pc is the insn AFTER the int3. > Question: Is this a bug? Should $pc point to the int3 instead? > [whether that's achieved with decr_pc_after_break or whatever > is a separate question] > I can argue either case, I don't have a preference per se. I think it's right the way it is, and I know people take advantage of this for hardwired breakpoints. > Trying things again, this time stepi'ing over the insn: > > bash$ gdb int3 > (gdb) start > [...] > Temporary breakpoint 1, main () at int3.S:4 > 4 nop > Current language: auto; currently asm > (gdb) si > 5 int3 > (gdb) si > 6 nop > (gdb) > > Note that int3 was stepping over without a SIGTRAP being generated. I can't see a plausible way around this, can you? The SIGTRAP is identical to the one for PTRACE_SINGLESTEP - unless the kernel annotates the siginfo differently? -- Daniel Jacobowitz CodeSourcery