From: Antony KING <antony.king@st.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: Pedro Alves <pedro@codesourcery.com>, gdb@sourceware.org
Subject: Re: Spurious SIGTRAP reported by GDB 6.8 when debugging embedded RTOS application
Date: Wed, 27 Aug 2008 21:38:00 -0000 [thread overview]
Message-ID: <48B45556.2030406@st.com> (raw)
In-Reply-To: <200808221441.m7MEflLR027889@d12av02.megacenter.de.ibm.com>
Thanks for the additional information on the execution logic of GDB and
the patch reference. This extra information will ensure I do not do the
"wrong thing" in my implementation of target_resume when I add the
checks that are currently missing :-).
Cheers,
Antony.
Ulrich Weigand wrote:
> 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
prev parent reply other threads:[~2008-08-26 19:17 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
2008-08-27 21:38 ` Antony KING [this message]
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=48B45556.2030406@st.com \
--to=antony.king@st.com \
--cc=gdb@sourceware.org \
--cc=pedro@codesourcery.com \
--cc=uweigand@de.ibm.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