This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Report the main thread.


 > > 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.  That way I can create a threads buffer and display the thread
number when there is more than one thread.  Putting observer_notify_new_thread
back in add_thread_with_info like this would work:

  if (!ui_out_is_mi_like_p (uiout))
    observer_notify_new_thread (tp);

but it might be cleaner if I applied my original patch.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]