From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17320 invoked by alias); 5 Aug 2013 13:57:26 -0000 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 Received: (qmail 17311 invoked by uid 89); 5 Aug 2013 13:57:26 -0000 X-Spam-SWARE-Status: No, score=-5.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 05 Aug 2013 13:57:25 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r75DvFgv020133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Aug 2013 09:57:15 -0400 Received: from barimba (ovpn-113-128.phx2.redhat.com [10.3.113.128]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r75DvE8e031845 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 5 Aug 2013 09:57:14 -0400 From: Tom Tromey To: Muhammad Waqas Cc: Pedro Alves , Yao Qi , , Subject: Re: [PATCH with testcase] Bug 11568 - delete thread-specific breakpoint on the thread exit References: <51F619CE.5040407@codesourcery.com> <51F633E5.7000302@codesourcery.com> <51F65519.2080806@codesourcery.com> <51F67992.30704@codesourcery.com> <51F7967E.3060900@codesourcery.com> <51FA4D21.4000309@redhat.com> <51FA5806.7050505@codesourcery.com> <51FB7F9E.30701@redhat.com> <51FF941E.7060705@codesourcery.com> Date: Mon, 05 Aug 2013 13:57:00 -0000 In-Reply-To: <51FF941E.7060705@codesourcery.com> (Muhammad Waqas's message of "Mon, 5 Aug 2013 17:01:34 +0500") Message-ID: <878v0gb5qe.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-08/txt/msg00138.txt.bz2 >>>>> "Muhammad" == Muhammad Waqas writes: Muhammad> insertion_state_t; Muhammad> +static void remove_threaded_breakpoints (struct thread_info *tp, int Muhammad> silent); Muhammad> + Your patch got mangled by your mailer. This makes it hard to check the formatting, so please fix that. Muhammad> +static void Muhammad> +remove_threaded_breakpoints(struct thread_info *tp, int silent) Muhammad> +{ Needs an intro comment. Muhammad> + Muhammad> + if (b->thread > 0) Muhammad> + { Muhammad> + observer_attach_thread_exit (remove_threaded_breakpoints); Muhammad> + } It seems odd to re-register the observer each time. Why not just do it once, at initialization time? Muhammad> 2013-07-24 Muhammad Waqas Muhammad> Jan Kratochvil Muhammad> PR gdb/11568 Muhammad> *gdb.thread/thread-specific-bp.c: Newfile. Muhammad> *gdb.thread/thread-specific-bp.exp: Newfile. Space after "*" and in "New file". Muhammad> +set mode "All stop" Muhammad> + Muhammad> +if {[gdb_compile_pthreads \ Muhammad> + "${srcdir}/${subdir}/${srcfile}" \ Muhammad> + "${binfile}" executable {debug} ] != "" } { Muhammad> + return -1 Muhammad> +} Muhammad> + Muhammad> +clean_restart ${binfile} Muhammad> + Muhammad> +proc check_threaded_breakpoint {} { Muhammad> + global gdb_prompt mode Make "mode" a parameter. Use with_test_prefix, since otherwise the new .exp will have repeated test names, an gdb anti-pattern. Muhammad> +# Testing in non-stop+async mode. Muhammad> +set mode "non-stop\\async" It's better to simply not use an unusual character. Tom