Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
Cc: Andrew Cagney <ac131313@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: PATCH: resume + threads + software stepping == boom
Date: Wed, 13 Jun 2001 15:21:00 -0000	[thread overview]
Message-ID: <3B27E779.9DFBE3BD@cygnus.com> (raw)
In-Reply-To: <20010609160611.A26105@nevyn.them.org>

Daniel Jacobowitz wrote:
> 
> On Sat, Jun 09, 2001 at 01:15:00PM -0400, Andrew Cagney wrote:
> > Could I suggest:
> >
> > > On Fri, Jun 08, 2001 at 04:20:30PM -0700, Michael Snyder wrote:
> > >
> > >> Michael Snyder wrote:
> > >
> > >> > I like the problem analysis, but not the implementation of the solution.
> > >> > If we are going to always set step to zero for SOFTWARE_SINGLE_STEP_P,
> > >> > then it does not make sense to set it to one again, even if the code
> > >> > will never be reached (in theory).  I would rather see it made explicit
> > >> > that this code should never be reached if SOFTWARE_SINGLE_STEP_P is true.
> > >> > Something like this:
> > >> >
> > >> > < if (!step)
> > >> > ---
> > >
> > >> > > if (!(step && SOFTWARE_SINGLE_STEP_P()))
> > >
> > >>
> > >> Err, my logic is wrong, but you get the idea...  maybe I meant
> > >> if (!step && !SOFTWARE_SINGLE_STEP_P())
> >
> >
> > Dumping the warning("internal error: ...") and replacing the entire
> > block of code with something like:
> >
> >       gdb_assert (step || SOFTWARE_SINGLE_STEP_P ())
> >
> > (I know my logic is wrong).  That way the problem of ``never reached (in
> > theory)'' is eliminated.
> 
> My concern is that this is a weaker assertion than was intended.  How
> about this - it changes the meaning of the assertion slightly since
> it's not conditional on should_resume, but I think it'll be correct
> none the less:

Daniel, just to let you know, I'm still thinking about this.
As you may or may not have noticed, I'm in the process of submitting
a bunch of bug fixes in infrun.c thread handling code.  I won't 
forget about this one.   ;-)

Michael

> 
> Index: infrun.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/infrun.c,v
> retrieving revision 1.35
> diff -u -r1.35 infrun.c
> --- infrun.c    2001/06/02 00:36:20     1.35
> +++ infrun.c    2001/06/09 23:05:32
> @@ -850,6 +850,11 @@
>    if (breakpoint_here_p (read_pc ()) == permanent_breakpoint_here)
>      SKIP_PERMANENT_BREAKPOINT ();
> 
> +  /* If we stopped on a breakpoint and it was not deleted, we want to continue
> +     only this thread, so we should be stepping. */
> +  gdb_assert (step || !use_thread_step || !thread_step_needed ||
> +             !breakpoint_here_p (read_pc ()));
> +
>    if (SOFTWARE_SINGLE_STEP_P () && step)
>      {
>        /* Do it the hard way, w/temp breakpoints */
> @@ -927,14 +932,7 @@
>             }
>           else
>             {
> -             if (!step)
> -               {
> -                 warning ("Internal error, changing continue to step.");
> -                 remove_breakpoints ();
> -                 breakpoints_inserted = 0;
> -                 trap_expected = 1;
> -                 step = 1;
> -               }
> +             /* Breakpoint not deleted, so step only this thread. */
>               resume_ptid = inferior_ptid;
>             }
>         }
> 
> --
> Daniel Jacobowitz                           Debian GNU/Linux Developer
> Monta Vista Software                              Debian Security Team


  parent reply	other threads:[~2001-06-13 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-08 12:34 Daniel Jacobowitz
2001-06-08 14:10 ` Daniel Jacobowitz
2001-06-08 16:19 ` Michael Snyder
2001-06-08 16:20   ` Michael Snyder
2001-06-08 16:43     ` Daniel Jacobowitz
     [not found]       ` <3B225994.9060502@cygnus.com>
2001-06-09 16:05         ` Daniel Jacobowitz
2001-06-10 21:40           ` Michael Snyder
2001-06-13 15:21           ` Michael Snyder [this message]
2001-06-09 13:34 ` Andrew Cagney
2001-06-09 15:44   ` Daniel Jacobowitz
2001-06-11 17:53     ` Jim Blandy

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=3B27E779.9DFBE3BD@cygnus.com \
    --to=msnyder@cygnus.com \
    --cc=ac131313@cygnus.com \
    --cc=dmj+@andrew.cmu.edu \
    --cc=gdb-patches@sources.redhat.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