Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] remote doesn't add the main thread if we didn't do so already
@ 2013-02-25 11:01 Hui Zhu
  2013-02-26 12:08 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Hui Zhu @ 2013-02-25 11:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: Gustavo, Luis

Hi,

This is the patch to change function add_current_inferior_and_thread that doesn't add the main thread if we didn't do so already.

Thanks,
Hui

2013-02-25  Luis Machado  <lgustavo@codesourcery.com>

	* remote.c (add_current_inferior_and_thread): Only add the main
	thread if we didn't do so already.

--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -3316,10 +3316,16 @@ add_current_inferior_and_thread (char *w
        fake_pid_p = 1;
      }
  
-  remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
+  /* Only add the main thread if we didn't do so already.  Some
+     targets don't support listing threads, so we need to handle
+     inclusion of the main thread here.  */
+  if (!in_thread_list (inferior_ptid))
+    {
+      remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
  
-  /* Add the main thread.  */
-  add_thread_silent (inferior_ptid);
+      /* Add the main thread.  */
+      add_thread_silent (inferior_ptid);
+    }
  }
  
  static void


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] remote doesn't add the main thread if we didn't do so already
  2013-02-25 11:01 [PATCH] remote doesn't add the main thread if we didn't do so already Hui Zhu
@ 2013-02-26 12:08 ` Pedro Alves
  2013-02-26 14:40   ` Hui Zhu
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2013-02-26 12:08 UTC (permalink / raw)
  To: Hui Zhu; +Cc: gdb-patches, Gustavo, Luis

Hi Hui, Luis,

Thanks for the patch.

On 02/25/2013 11:01 AM, Hui Zhu wrote:
> Hi,
> 
> This is the patch to change function add_current_inferior_and_thread that doesn't add the main thread if we didn't do so already.
> 

I have the mild impression I've seen this change before, but heck
if I recall any details, and I may be wrong.  Can you or Luis
expand on the background/rationale for this change?

Thanks.

> Thanks,
> Hui
> 
> 2013-02-25  Luis Machado  <lgustavo@codesourcery.com>
> 
>     * remote.c (add_current_inferior_and_thread): Only add the main
>     thread if we didn't do so already.
> 
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -3316,10 +3316,16 @@ add_current_inferior_and_thread (char *w
>        fake_pid_p = 1;
>      }
>  
> -  remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
> +  /* Only add the main thread if we didn't do so already.  Some
> +     targets don't support listing threads, so we need to handle
> +     inclusion of the main thread here.  */
> +  if (!in_thread_list (inferior_ptid))
> +    {
> +      remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
>  
> -  /* Add the main thread.  */
> -  add_thread_silent (inferior_ptid);
> +      /* Add the main thread.  */
> +      add_thread_silent (inferior_ptid);
> +    }
>  }
>  
>  static void


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] remote doesn't add the main thread if we didn't do so already
  2013-02-26 12:08 ` Pedro Alves
@ 2013-02-26 14:40   ` Hui Zhu
  2013-02-26 14:49     ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Hui Zhu @ 2013-02-26 14:40 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Hui Zhu, gdb-patches, Gustavo, Luis

Hi Pedro,

On Tue, Feb 26, 2013 at 8:08 PM, Pedro Alves <palves@redhat.com> wrote:
> Hi Hui, Luis,
>
> Thanks for the patch.
>
> On 02/25/2013 11:01 AM, Hui Zhu wrote:
>> Hi,
>>
>> This is the patch to change function add_current_inferior_and_thread that doesn't add the main thread if we didn't do so already.
>>
>
> I have the mild impression I've seen this change before, but heck
> if I recall any details, and I may be wrong.  Can you or Luis
> expand on the background/rationale for this change?

This patch is part of OSE support that includes some small changes and
some bigger one.  So my thought is  post the small one first.

Thanks,
Hui



>
> Thanks.
>
>> Thanks,
>> Hui
>>
>> 2013-02-25  Luis Machado  <lgustavo@codesourcery.com>
>>
>>     * remote.c (add_current_inferior_and_thread): Only add the main
>>     thread if we didn't do so already.
>>
>> --- a/gdb/remote.c
>> +++ b/gdb/remote.c
>> @@ -3316,10 +3316,16 @@ add_current_inferior_and_thread (char *w
>>        fake_pid_p = 1;
>>      }
>>
>> -  remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
>> +  /* Only add the main thread if we didn't do so already.  Some
>> +     targets don't support listing threads, so we need to handle
>> +     inclusion of the main thread here.  */
>> +  if (!in_thread_list (inferior_ptid))
>> +    {
>> +      remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
>>
>> -  /* Add the main thread.  */
>> -  add_thread_silent (inferior_ptid);
>> +      /* Add the main thread.  */
>> +      add_thread_silent (inferior_ptid);
>> +    }
>>  }
>>
>>  static void
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] remote doesn't add the main thread if we didn't do so already
  2013-02-26 14:40   ` Hui Zhu
@ 2013-02-26 14:49     ` Pedro Alves
  2013-02-27  2:00       ` Hui Zhu
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2013-02-26 14:49 UTC (permalink / raw)
  To: Hui Zhu; +Cc: Hui Zhu, gdb-patches, Gustavo, Luis

On 02/26/2013 02:39 PM, Hui Zhu wrote:
> Hi Pedro,
> 
> On Tue, Feb 26, 2013 at 8:08 PM, Pedro Alves <palves@redhat.com> wrote:
>> Hi Hui, Luis,
>>
>> Thanks for the patch.
>>
>> On 02/25/2013 11:01 AM, Hui Zhu wrote:
>>> Hi,
>>>
>>> This is the patch to change function add_current_inferior_and_thread that doesn't add the main thread if we didn't do so already.
>>>
>>
>> I have the mild impression I've seen this change before, but heck
>> if I recall any details, and I may be wrong.  Can you or Luis
>> expand on the background/rationale for this change?
> 
> This patch is part of OSE support that includes some small changes and
> some bigger one.  

Okay, that probably explains why I thought I'd seen it before.

> So my thought is  post the small one first.

That's fine, but being small doesn't mean it shouldn't be explained.
Please share the rationale for the change so we have it recorded in
the public archives.  You should be able to find it in Mentor's
internal archives.  What problem does this solve?  When can this
happen (initial connection, vRun, other?).  Etc.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] remote doesn't add the main thread if we didn't do so already
  2013-02-26 14:49     ` Pedro Alves
@ 2013-02-27  2:00       ` Hui Zhu
  0 siblings, 0 replies; 5+ messages in thread
From: Hui Zhu @ 2013-02-27  2:00 UTC (permalink / raw)
  To: Pedro Alves, Hui Zhu; +Cc: gdb-patches, Gustavo, Luis

Hi Pedro,

This patch should post with all of OSE patches.  Please ignore this thread.
Sorry for waste your time.

Thanks,
Hui

On 02/26/13 22:48, Pedro Alves wrote:
> On 02/26/2013 02:39 PM, Hui Zhu wrote:
>> Hi Pedro,
>>
>> On Tue, Feb 26, 2013 at 8:08 PM, Pedro Alves <palves@redhat.com> wrote:
>>> Hi Hui, Luis,
>>>
>>> Thanks for the patch.
>>>
>>> On 02/25/2013 11:01 AM, Hui Zhu wrote:
>>>> Hi,
>>>>
>>>> This is the patch to change function add_current_inferior_and_thread that doesn't add the main thread if we didn't do so already.
>>>>
>>>
>>> I have the mild impression I've seen this change before, but heck
>>> if I recall any details, and I may be wrong.  Can you or Luis
>>> expand on the background/rationale for this change?
>>
>> This patch is part of OSE support that includes some small changes and
>> some bigger one.
>
> Okay, that probably explains why I thought I'd seen it before.
>
>> So my thought is  post the small one first.
>
> That's fine, but being small doesn't mean it shouldn't be explained.
> Please share the rationale for the change so we have it recorded in
> the public archives.  You should be able to find it in Mentor's
> internal archives.  What problem does this solve?  When can this
> happen (initial connection, vRun, other?).  Etc.
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-27  2:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-25 11:01 [PATCH] remote doesn't add the main thread if we didn't do so already Hui Zhu
2013-02-26 12:08 ` Pedro Alves
2013-02-26 14:40   ` Hui Zhu
2013-02-26 14:49     ` Pedro Alves
2013-02-27  2:00       ` Hui Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox