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: [patch:MI] Observer for thread-changed


 > > If it goes at the end of do_captured_thread_select then I guess that will
 > > be after any exceptions but, to me, putting the logic in gdb_thread_select
 > > makes it clearer that the thread only gets reported when there is no
 > > exception.
 > 
 > I think it's clearer to put the observer close to where to switch
 > is performed.  Plus, if/when we remove libgdb and the wrapper, we
 > have again to move the observer call... Not the end of the world, but
 > might as well put it in the right place now, IMHO.  Oh well, opinions :-)  

Seems reasonable.  I'll do that.

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


--- thread.c	09 Jun 2008 21:06:46 +1200	1.71
+++ thread.c	10 Jun 2008 15:11:13 +1200	
@@ -738,7 +738,6 @@ thread_command (char *tidstr, int from_t
       return;
     }
 
-  annotate_thread_changed ();
   gdb_thread_select (uiout, tidstr, NULL);
 }
 
@@ -770,6 +769,8 @@ do_captured_thread_select (struct ui_out
     error (_("Thread ID %d has terminated."), num);
 
   switch_to_thread (tp->ptid);
+  observer_notify_thread_changed ();
+  annotate_thread_changed ();
 
   ui_out_text (uiout, "[Switching to thread ");
   ui_out_field_int (uiout, "new-thread-id", pid_to_thread_id (inferior_ptid));


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