Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: antony.king@st.com (Antony KING)
Cc: pedro@codesourcery.com (Pedro Alves), gdb@sourceware.org
Subject: Re: Spurious SIGTRAP reported by GDB 6.8 when debugging embedded    RTOS  application
Date: Fri, 22 Aug 2008 14:58:00 -0000	[thread overview]
Message-ID: <200808221441.m7MEflLR027889@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <48AC6415.3000604@st.com> from "Antony KING" at Aug 20, 2008 07:36:05 PM

Anthony King wrote:

> Also, while I was trying to absorb the mechanics of GDB in this area,
> there seemed (to my untutored eye) an inconsistency between my target
> definition setting "to_has_thread_control" to "tc_none" and the
> execution model of infrun.c (esp. when it comes to stepping), or have I
> missed something :-) ?

Hmmm.  The meaning of to_has_thread_control doesn't seem to be completely
well defined.  I had thought it refered to whether the target allows to
selectively resume just one thread versus resuming all threads.

Under this interpretation, if to_has_thread_control is tc_none, the
target's resume method should always be called with ptid == minus_one_ptid.

However, in actual fact infrun.c attempts to resume a single thread
unconditionally in the following situations:

- when single-stepping past a software single-step breakpoint

- when single-stepping past a breakpoint

- when stepping past a syscall-return event

- when stepping over a steppable/nonsteppable watchpoint

- when in non-stop mode

Some of these can be avoided by choices the target can make (e.g.
to support hardware single-stepping, and to not support non-stop
mode).  For others, there doesn't seem to be a way to avoid them.
This looks like long-standing behaviour, however ...

In addition, even when calling the target's resume function with
ptid == minus_one_ptid, GDB will still expect to be able to choose
which of the resumed threads goes into single-step mode.

> FYI I have attached the output of my test case when I use GDB 6.7.1
> (with "set debug infrun 1"). As you can see there is no indication that
> a context switch has occurred by the step; it seems that in GDB 6.7.1
> changing threads did not alter the thread to be stepped (i.e. the last
> stopped thread).

The change in behaviour is caused by my patch:
http://sourceware.org/ml/gdb-patches/2007-07/msg00278.html
This fixed the previous behaviour where "step" would always implicitly
switch back to the last thread that stopped.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2008-08-22 14:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-16 15:12 Antony KING
2008-08-16 15:33 ` Ulrich Weigand
2008-08-18 18:16   ` Antony KING
2008-08-18 18:30     ` Daniel Jacobowitz
2008-08-18 18:36       ` Pedro Alves
2008-08-20  1:31         ` Antony KING
2008-08-18 18:47       ` Antony KING
2008-08-19  0:33         ` Ulrich Weigand
2008-08-20 14:30           ` Antony KING
2008-08-20 14:37             ` Pedro Alves
2008-08-21  3:24               ` Antony KING
2008-08-22 14:58                 ` Ulrich Weigand [this message]
2008-08-27 21:38                   ` Antony KING

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=200808221441.m7MEflLR027889@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=antony.king@st.com \
    --cc=gdb@sourceware.org \
    --cc=pedro@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