This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Report the main thread.
Nick Roberts wrote:
> > > 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);
> >
> > This patch, IIUC, will cause the new_thread observer to be notified only
> > in MI mode. Then, no observer except for MI one will ever be called?
> > Then, why those non-MI observers exist?
> >
> > Or to put in other way, I think this patch will make you annotation
> > observers to be never called. Is this what you want?
>
> Yes, you're right. I didn't notice that the observer in add_thread_with_info
> was removed at the same time this one was added.
>
> I just want threads other than the main thread to be reported, as used to
> be the case.
Assuming that makes sense for annotations, I think your observer is in position
to decide which threads to report, and which not?
> That way I can create a threads buffer and display the thread
> number when there is more than one thread.
Cannot you just suppress display of thread list if there's just one
thread reported, on UI side?
- Volodya