Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Pedro Alves <pedro@codesourcery.com>,
	gdb-patches@sourceware.org, 	ghost@cs.msu.su
Subject: [PATCH]:annotations [was Re: [patch:MI] Observer for thread-changed]
Date: Sat, 17 Jan 2009 00:10:00 -0000	[thread overview]
Message-ID: <18801.8634.385465.267957@kahikatea.snap.net.nz> (raw)
In-Reply-To: <18509.61742.680365.176465@kahikatea.snap.net.nz>

On 10 Jun 2008 15:12:46 +1200 Nick Roberts writes:

 >  > > 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.

Ping.

 > -- 
 > 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));
 > 

Vladimir has created his own notifications for thread changes now, so that
part is no longer relevant but moving the call to annotate_thread_changed
still is.

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


2009-01-17  Nick Roberts  <nickrob@snap.net.nz>

	* thread.c (thread_command): Don't print an annotation if the
          thread change generate an exception.



Index: thread.c
===================================================================
RCS file: /cvs/src/src/gdb/thread.c,v
retrieving revision 1.99
diff -p -u -p -r1.99 thread.c
--- thread.c	3 Jan 2009 05:57:53 -0000	1.99
+++ thread.c	16 Jan 2009 23:58:47 -0000
@@ -1045,7 +1045,6 @@ thread_command (char *tidstr, int from_t
       return;
     }
 
-  annotate_thread_changed ();
   gdb_thread_select (uiout, tidstr, NULL);
 }
 
@@ -1078,6 +1077,8 @@ do_captured_thread_select (struct ui_out
 
   switch_to_thread (tp->ptid);
 
+  annotate_thread_changed ();
+
   ui_out_text (uiout, "[Switching to thread ");
   ui_out_field_int (uiout, "new-thread-id", pid_to_thread_id (inferior_ptid));
   ui_out_text (uiout, " (");


  reply	other threads:[~2009-01-17  0:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-09 12:16 [patch:MI] Observer for thread-changed Nick Roberts
2008-06-09 13:36 ` Pedro Alves
2008-06-09 13:28   ` Pedro Alves
2008-06-09 15:06   ` Pedro Alves
2008-06-09 14:15     ` Pedro Alves
2008-06-09 23:35   ` Nick Roberts
2008-06-10  1:40     ` Pedro Alves
2008-06-10  2:30       ` Nick Roberts
2008-06-10  3:13         ` Pedro Alves
2008-06-10  6:39           ` Nick Roberts
2009-01-17  0:10             ` Nick Roberts [this message]
2009-01-17 17:54               ` [PATCH]:annotations Tom Tromey
2008-06-10  8:26         ` [patch:MI] Observer for thread-changed Vladimir Prus
2008-06-10  9:24           ` Nick Roberts
2008-06-10 10:26             ` Vladimir Prus
2008-06-10 17:23           ` Daniel Jacobowitz
2008-06-14 18:52             ` Vladimir Prus
2008-06-14 19:13               ` Tom Tromey
2008-06-14 19:22                 ` Bob Rossi
2008-06-15  3:20                   ` Nick Roberts
2008-06-14 20:04                 ` Vladimir Prus
2008-06-15 21:51                   ` Tom Tromey
2008-06-14 19:43               ` Daniel Jacobowitz
2008-06-15  0:44                 ` Nick Roberts
2008-06-15 21:03                   ` Vladimir Prus
2008-06-15 22:31                     ` Nick Roberts
2008-06-16 22:28                     ` Daniel Jacobowitz
2008-06-15 17:58                 ` Vladimir Prus
2008-06-10  8:40 ` Vladimir Prus
2008-06-10  9:19   ` Nick Roberts
2008-06-10  9:36     ` Vladimir Prus
2008-06-11  0:08       ` Nick Roberts
2008-06-11  7:46         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18801.8634.385465.267957@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb-patches@sourceware.org \
    --cc=ghost@cs.msu.su \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox