Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@specifix.com>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Don't ignore consecutive breakpoints.
Date: Mon, 26 Nov 2007 18:51:00 -0000	[thread overview]
Message-ID: <1196102361.2501.22.camel@localhost.localdomain> (raw)
In-Reply-To: <200711232310.17854.vladimir@codesourcery.com>

On Fri, 2007-11-23 at 23:10 +0300, Vladimir Prus wrote:
> Suppose we have two breakpoints at two consecutive
> addresses, and we do "step" while stopped on the
> first breakpoint. GDB testsuite has a test (consecutive.exp)
> that the second breakpoint will be hit a reported, and the

Yeah, I was the author of that test, back in 2001.
Several years and several employers ago, but I think 
I am able to remember a little about the context.

> test passes, but the code directly contradicts, saying:
> 
>       /* Don't even think about breakpoints if just proceeded over a
>          breakpoint.  */
>       if (stop_signal == TARGET_SIGNAL_TRAP && trap_expected)
> 	{
>           if (debug_infrun)
> 	    fprintf_unfiltered (gdb_stdlog, "infrun: trap expected\n");
> 	  bpstat_clear (&stop_bpstat);
> 	}
> 
> what's happening is that we indeed ignore the breakpoint, and try
> to step further. However ecs->another_trap is not set, so we step
> with breakpoints inserted, and immediately hit the now-inserted
> breakpoint. Therefore, I propose to remove that code.
> 
> On x86, the below patch causes a single test outcome change:
> 
> -KFAIL: gdb.base/watchpoint.exp: next after watch x (PRMS: gdb/38)
> +PASS: gdb.base/watchpoint.exp: next after watch x

Yeah, the problem is that you have only tested x86 architecture, 
and what I think I recall is that this test was for software
single-step.

You have to be aware that you have just single-stepped, so that
you interpret the trap instruction under the PC as related to 
stepping.  If you have two consecutive BP-related traps, and you
try to single step over one of them, you may miss the second one
because you believe it to be only a single-stepping trap.

Can you test your patch on an architecture that uses software SS?

Thanks,
Michael



  reply	other threads:[~2007-11-26 18:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-23 20:10 Vladimir Prus
2007-11-26 18:51 ` Michael Snyder [this message]
2007-11-26 19:00   ` Vladimir Prus
2007-11-29 11:27   ` Vladimir Prus
2007-11-30  1:27     ` Michael Snyder
2007-11-30 10:04       ` Vladimir Prus

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=1196102361.2501.22.camel@localhost.localdomain \
    --to=msnyder@specifix.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=vladimir@codesourcery.com \
    /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