Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Report the main thread.
@ 2008-04-26 16:44 Vladimir Prus
  2008-04-26 17:16 ` Mark Kettenis
  0 siblings, 1 reply; 38+ messages in thread
From: Vladimir Prus @ 2008-04-26 16:44 UTC (permalink / raw)
  To: gdb-patches


Presently, on Linux, we do add the main thread to the thread list, but we
fail to report this new thread to outside world.  I think we should not
do any such special-casing -- if we want the =thread-created notification
to be usable as replacement for getting the thread, we better emit that
for all new thread.

This patch changes the behaviour. OK?

- Volodya

	* linux-nat.c (linux_nat_wait): Use add_thread, not
	add_thread_silent, when adding main thread.
---
 gdb/linux-nat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index cac4bb7..9471cd8 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -2453,7 +2453,7 @@ linux_nat_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
       lp = add_lwp (inferior_ptid);
       lp->resumed = 1;
       /* Add the main thread to GDB's thread list.  */
-      add_thread_silent (lp->ptid);
+      add_thread (lp->ptid);
       set_running (lp->ptid, 1);
     }
 
-- 
1.5.3.5


^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: [RFA] Report the main thread.
@ 2008-05-10 18:00 Nick Roberts
  2008-05-10 19:26 ` Vladimir Prus
                   ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Nick Roberts @ 2008-05-10 18:00 UTC (permalink / raw)
  To: gdb-patches


> Vladimir Prus wrote:

>> Daniel Jacobowitz wrote:
>> 
>>> On Sat, Apr 26, 2008 at 08:44:23PM +0400, Vladimir Prus wrote:
>>>> Will some approach that only produce MI output be fine with you?
>>> 
>>> Perhaps that means any observer for a new MI thread should go in
>>> add_thread_silent?
>> 
>> Yes, moving the observer call to add_thread_silent is the most
>> direct approach to make MI work the way I want without disturbing CLI.

> Here's a patch to that effect. OK?

>        * thread.c (add_thread): Move observer call to ...
>        (add_thread_silent): ... here.
> ---
> gdb/thread.c |    5 +++--
> > 1 files changed, 3 insertions(+), 2 deletions(-)

> diff --git a/gdb/thread.c b/gdb/thread.c
> index 46e6ba7..d3cfb32 100644
> --- a/gdb/thread.c
> +++ b/gdb/thread.c
> @@ -124,6 +124,9 @@ add_thread_silent (ptid_t ptid)
>    tp->num = ++highest_thread_num;
>    tp->next = thread_list;
>    thread_list = tp;
> +
> +  observer_notify_new_thread (tp);
> +
>    return tp;
>  }


Now that Joel has requested that I use observer_attach_new_thread for
annotations this approach doesn't only produce MI output so it needs to
be conditioned on MI:

@@ -124,6 +124,10 @@ add_thread_silent (ptid_t ptid)
   tp->num = ++highest_thread_num;
   tp->next = thread_list;
   thread_list = tp;
+
+  if (ui_out_is_mi_like_p (uiout))
+    observer_notify_new_thread (tp);
+
   return tp;
 }

-- 
Nick                                           http://www.inet.net.nz/~nickrob


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

end of thread, other threads:[~2008-05-12 18:19 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-26 16:44 [RFA] Report the main thread Vladimir Prus
2008-04-26 17:16 ` Mark Kettenis
2008-04-26 17:22   ` Daniel Jacobowitz
2008-04-26 17:31   ` Vladimir Prus
2008-04-26 21:05     ` Daniel Jacobowitz
2008-04-26 22:36       ` Vladimir Prus
2008-04-27  4:27         ` Nick Roberts
2008-04-27  9:03           ` Vladimir Prus
2008-04-27 11:14           ` Daniel Jacobowitz
2008-04-27 14:24             ` Nick Roberts
2008-04-27 13:53               ` Nick Roberts
2008-04-27 15:50               ` Daniel Jacobowitz
2008-04-27 16:07                 ` Mark Kettenis
2008-04-27 16:07                   ` Pedro Alves
2008-04-27 21:46                     ` Mark Kettenis
2008-04-28  3:31                       ` Pedro Alves
2008-04-27 18:25                   ` Daniel Jacobowitz
2008-04-30 10:11         ` Vladimir Prus
2008-04-30 13:28           ` Daniel Jacobowitz
2008-05-10 18:00 Nick Roberts
2008-05-10 19:26 ` Vladimir Prus
2008-05-11 14:10   ` Nick Roberts
2008-05-11 14:45     ` Vladimir Prus
2008-05-11 15:52       ` Nick Roberts
2008-05-11 16:00         ` Vladimir Prus
2008-05-11 16:13           ` Nick Roberts
2008-05-11 16:41             ` Vladimir Prus
2008-05-11 22:19               ` Nick Roberts
2008-05-12 22:22         ` Michael Snyder
2008-05-11 20:19       ` Joel Brobecker
2008-05-11 21:10         ` Vladimir Prus
2008-05-11 22:33         ` Nick Roberts
2008-05-12  3:18           ` Daniel Jacobowitz
2008-05-12 16:11             ` Nick Roberts
2008-05-12 18:19               ` Daniel Jacobowitz
2008-05-10 19:42 ` Vladimir Prus
2008-05-10 22:12 ` Joel Brobecker
2008-05-11 14:29   ` Nick Roberts

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