From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5084 invoked by alias); 1 May 2008 18:18:27 -0000 Received: (qmail 5067 invoked by uid 22791); 1 May 2008 18:18:21 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 01 May 2008 18:18:03 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3FDCF2A9A75; Thu, 1 May 2008 14:18:01 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SyOtiTOjSkSR; Thu, 1 May 2008 14:18:01 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 017F42A9A73; Thu, 1 May 2008 14:18:01 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id D7172E7ACD; Thu, 1 May 2008 11:17:58 -0700 (PDT) Date: Thu, 01 May 2008 18:18:00 -0000 From: Joel Brobecker To: Nick Roberts Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] New annotation for threads Message-ID: <20080501181758.GD3801@adacore.com> References: <18440.29531.916381.569346@kahikatea.snap.net.nz> <20080429023735.GD841@adacore.com> <18454.43094.168458.742737@kahikatea.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18454.43094.168458.742737@kahikatea.snap.net.nz> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00016.txt.bz2 > > I'd really like to have others' opinions on this one. I thought that > > we weren't going to change our annotations anymore. And even though > > we were not going to remove annotations for a while longer, we were > > going to focuse on MI instead. > > It doesn't impede MI development, so you could think of it as orthogonal. > Clearly it can eventually be removed with the rest of annotations. OK, here is what I can propose: Send a patch for approval that implements this new annotation using observers. I will review it, and then we will let it sit for an extra week to give everyone time to object if they disagree. > > > 2008-04-18 Nick Roberts > > > > > > * annotate.h: (annotate_new_thread): New extern. > > > > > > * annotate.c (annotate_new_thread): New function. > > > > > > * thread.c (add_thread_with_info): Use it. > > > > How about creating a new observer for new_threads events instead of > > specifically calling an annotation function from "add_thread"? Seems > > much cleaner that way. > > I'm not sure what you mean, or how I would register such an observer. > All other annotations are done this way and, unlike MI, annotations don't > have their own interpreter but just mark up CLI. The observers are documented in doc/observer.texi. Basically, you need to do the following: static void annotate_new_thread (struct thread_info *thread) { /* Your annotation here. */ } And then attach this observer to the new_thread event using: observer_attach_new_thread (annotate_new_thread); All this can be done inside annotate.c. -- Joel