Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: gdb@sourceware.org
Subject: Re: i386 int3 handling, running vs stepping
Date: Mon, 02 Feb 2009 00:52:00 -0000	[thread overview]
Message-ID: <e394668d0902011652k5c1e4b7gccdc47b71fa83e07@mail.gmail.com> (raw)
In-Reply-To: <20090201233251.GA27142@caradoc.them.org>

On Sun, Feb 1, 2009 at 3:32 PM, Daniel Jacobowitz <drow@false.org> wrote:
> 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.
>

btw, i386-tdep.c:i386_displaced_step_fixup has this:

          /* If we have stepped over a breakpoint, set the %eip to
             point at the breakpoint instruction itself.

             (gdbarch_decr_pc_after_break was never something the core
             of GDB should have been concerned with; arch-specific
             code should be making PC values consistent before
             presenting them to GDB.)  */
          if (i386_breakpoint_p (insn))
            {
              if (debug_displaced)
                fprintf_unfiltered (gdb_stdlog,
                                    "displaced: stepped breakpoint\n");
              eip--;
            }

Given that the pc should be left AFTER the int3 when stepping over it,
do we want to delete this code?


  parent reply	other threads:[~2009-02-02  0:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-01 23:18 Doug Evans
2009-02-01 23:33 ` Daniel Jacobowitz
2009-02-01 23:38   ` Doug Evans
2009-02-02  4:25     ` Daniel Jacobowitz
2009-02-02 20:03       ` Doug Evans
2009-02-02 21:49         ` Daniel Jacobowitz
2009-02-03  1:26           ` Doug Evans
2009-02-03  4:08             ` Daniel Jacobowitz
2009-02-03  9:22           ` Mark Kettenis
2009-02-02  0:52   ` Doug Evans [this message]
2009-02-02  6:08   ` Robert Dewar
2009-02-02  6:19 ` teawater
2009-02-03  9:21 ` Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e394668d0902011652k5c1e4b7gccdc47b71fa83e07@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox