Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] New annotation for threads
Date: Fri, 02 May 2008 00:07:00 -0000	[thread overview]
Message-ID: <18458.23326.25887.70597@kahikatea.snap.net.nz> (raw)
In-Reply-To: <20080501233703.GF3801@adacore.com>

 > The printing of the annotation was already guarded by the annotation
 > level. So you can in fact attach the observer from your _initialize
 > procedure, no?

Yes.  You're probably right this looks a better change as
observer_attach_new_thread already exists and changes are confined to
annotate.c.  The patch now looks like below.  I'll write a test and fully check
the testsuite.

Thanks.

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


2008-05-02  Nick Roberts  <nickrob@snap.net.nz>

	* annotate.c: Include observer.h.
	(annotate_new_thread): New function
	(_initialize_annotate): Register it in the new_thread observer.


*** annotate.c	10 Jan 2008 11:34:21 +1300	1.15
--- annotate.c	02 May 2008 11:54:05 +1200	
***************
*** 23,28 ****
--- 23,29 ----
  #include "target.h"
  #include "gdbtypes.h"
  #include "breakpoint.h"
+ #include "observer.h"
  \f
  
  /* Prototypes for local functions. */
*************** annotate_frames_invalid (void)
*** 234,239 ****
--- 235,249 ----
  }
  
  void
+ annotate_new_thread (struct thread_info *thread)
+ {
+   if (annotation_level > 1)
+     {
+       printf_unfiltered (("\n\032\032new-thread\n"));
+     }
+ }
+ 
+ void
  annotate_field_begin (struct type *type)
  {
    if (annotation_level == 2)
*************** _initialize_annotate (void)
*** 580,583 ****
--- 590,595 ----
        deprecated_delete_breakpoint_hook = breakpoint_changed;
        deprecated_modify_breakpoint_hook = breakpoint_changed;
      }
+ 
+     observer_attach_new_thread (annotate_new_thread);
  }


  reply	other threads:[~2008-05-02  0:07 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-18 16:06 Nick Roberts
2008-04-29  4:47 ` Joel Brobecker
2008-04-29 14:19   ` Nick Roberts
2008-05-01 18:18     ` Joel Brobecker
2008-05-01 18:44       ` Daniel Jacobowitz
2008-05-01 23:31       ` Nick Roberts
2008-05-01 23:37         ` Joel Brobecker
2008-05-02  0:07           ` Nick Roberts [this message]
2008-05-02  5:50             ` Joel Brobecker
2008-05-02 10:41             ` Eli Zaretskii
2008-05-17 15:51               ` Nick Roberts
2008-05-17 19:15                 ` Stan Shebs
2008-05-17 21:18                 ` Eli Zaretskii
2008-05-18  3:20                   ` Bob Rossi
2008-05-18  9:11                     ` Bob Rossi
2008-05-18 17:44                     ` Eli Zaretskii
2008-05-19  8:48                       ` Joel Brobecker
2008-05-19  9:09                   ` Nick Roberts
2008-05-19  9:44                     ` Eli Zaretskii
2008-05-19 12:39                 ` Nick Roberts
2008-05-19 13:23                   ` Eli Zaretskii
2008-05-20 15:27                   ` Joel Brobecker
2008-05-20 16:10                     ` Nick Roberts
2008-05-20 16:43                       ` Nick Roberts
2008-05-20 18:09                         ` Joel Brobecker
2008-05-21  3:55                           ` Nick Roberts
2008-05-21  7:22                             ` Joel Brobecker
2008-05-20 22:21                     ` Eli Zaretskii
2008-05-20 22:54                       ` Joel Brobecker
2008-05-21  3:26                         ` Eli Zaretskii
2008-05-21  9:33                           ` Joel Brobecker
2008-05-21 15:11                             ` Nick Roberts
2008-05-21 15:14                               ` Joel Brobecker

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=18458.23326.25887.70597@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sources.redhat.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