From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6429 invoked by alias); 2 May 2008 00:07:30 -0000 Received: (qmail 6346 invoked by uid 22791); 2 May 2008 00:07:28 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 02 May 2008 00:07:01 +0000 Received: from kahikatea.snap.net.nz (103.31.255.123.static.snap.net.nz [123.255.31.103]) by viper.snap.net.nz (Postfix) with ESMTP id 04B9E3D9D74; Fri, 2 May 2008 12:06:58 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 303598FC6D; Fri, 2 May 2008 12:06:54 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18458.23326.25887.70597@kahikatea.snap.net.nz> Date: Fri, 02 May 2008 00:07:00 -0000 To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] New annotation for threads In-Reply-To: <20080501233703.GF3801@adacore.com> References: <18440.29531.916381.569346@kahikatea.snap.net.nz> <20080429023735.GD841@adacore.com> <18454.43094.168458.742737@kahikatea.snap.net.nz> <20080501181758.GD3801@adacore.com> <18458.21177.959458.278174@kahikatea.snap.net.nz> <20080501233703.GF3801@adacore.com> X-Mailer: VM 7.19 under Emacs 22.2.50.2 X-IsSubscribed: yes 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/msg00054.txt.bz2 > 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 * 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" /* 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); }