Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Orjan Friberg <orjan.friberg@axis.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: schedlock.exp questions
Date: Fri, 27 Aug 2004 13:59:00 -0000	[thread overview]
Message-ID: <412F3E18.8030408@axis.com> (raw)
In-Reply-To: <20040825160315.GA31412@nevyn.them.org>

Daniel Jacobowitz wrote:
> 
> This is a twisty and nasty part of infrun.  It is full of bugs and
> things that need to be rearchitected.  So it's quite likely it doesn't
> work right.

Ok, I think I got the hang of it now.  (Apologies if my ramblings below 
are a tad long-winded.)

The actual problem for CRISv32 is that the SIGTRAPs resulting from the 
"break 41 if arg!=5" breakpoint for the other threads aren't ignored, 
and that seems to be due to that it's using hardware single-step.

This what happens: in schedlock.exp, after the first "break 41 if arg != 
5" breakpoint is hit, all breakpoints are removed.  When we step the 
current thread afterwards, the other threads all have a pending SIGTRAP 
(since they also hit that same (now removed) breakpoint).  At this point 
we reach the following code (infrun.c:handle_inferior_event):

/* See if a thread hit a thread-specific breakpoint that was meant for
    another thread.  If so, then step that thread past the breakpoint,
    and continue it.  */

The variable thread_hop_needed determines if we should ignore the 
breakpoint hit and just move on (which I guess is what we want to do 
here).  thread_hop_needed is set if:

* there's a breakpoint at the current location, and it's set for another 
thread (not applicable in this case; the SIGTRAP comes from a now 
removed breakpoint)

or

* we're software single-stepping, and the stopped ptid doesn't match the 
single-step ptid (which is what saves CRIS, having software single-step).

Obviously there is some logic missing to handle this case (using 
hardware single-step).  I tried to add a third condition for setting 
thread_hop_needed, using currently_stepping (ecs) and 
!breakpoints_inserted, but that was too inclusive.  Question is whether 
that is the right approach at all - after all, an i686-pc-linux-gnu host 
doesn't need it.

> Is this native or remote (gdbserver based)?  I have some patches which
> make it substantially more reliable on slow native targets but I
> haven't had enough time to test them properly.  They shouldn't affect
> remote though.

This is a gdbserver based remote target.

-- 
Orjan Friberg
Axis Communications


  reply	other threads:[~2004-08-27 13:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-24 14:51 Orjan Friberg
2004-08-24 14:55 ` Daniel Jacobowitz
2004-08-25 15:11   ` Orjan Friberg
2004-08-25 16:03     ` Daniel Jacobowitz
2004-08-27 13:59       ` Orjan Friberg [this message]
2004-08-31 14:41         ` Orjan Friberg
2004-09-07 12:48       ` Orjan Friberg

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=412F3E18.8030408@axis.com \
    --to=orjan.friberg@axis.com \
    --cc=drow@false.org \
    --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