This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Why does "target remote" to a non-stop target stop one thread
- From: Jeremy Bennett <jeremy dot bennett at embecosm dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 28 Jun 2013 15:06:26 +0200
- Subject: Re: Why does "target remote" to a non-stop target stop one thread
- References: <51CCA2AB dot 1000008 at embecosm dot com> <51CD45EE dot 6030501 at codesourcery dot com>
- Reply-to: jeremy dot bennett at embecosm dot com
On 28/06/13 10:14, Yao Qi wrote:
> On 06/28/2013 04:38 AM, Jeremy Bennett wrote:
>> hen I connect to the target, even in non-stop mode, it insists on
>> stopping one thread. The comment in notice_new_inferior () is:
>>
>>> > /* We're going to install breakpoints, and poke at memory,
>>> > ensure that the inferior is stopped for a moment while we do
>>> > that. */
>> My question is, why we need to stop any thread. Surely the whole point
>> of non-stop mode is that we don't generally want to stop any threads if
>> it can be avoided.
>
> Hi Jeremy,
> AFAIK, "non-stop" means when GDB is examining one stopped thread while
> other threads are _not stopped_.
>
> See
> http://sourceware.org/gdb/onlinedocs/gdb/Non_002dStop-Mode.html#Non_002dStop-Mode
>
>
> GDB needs the thread stopped because ptrace can't be performed on the
> running thread.
>
Hi Yao,
Thanks for the explanation. Since I am working on a RTOS that does not
use ptrace, and can perform actions on running threads, I don't need to
stop. So it looks like something like the patch suggested by Raphael
Zulliger that makes this configurable depending on the target would be a
useful.
I'll work on this.
Jeremy
--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeId: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com
Twitter: @embecosm