From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29983 invoked by alias); 29 Jul 2013 14:18:51 -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 29973 invoked by uid 89); 29 Jul 2013 14:18:51 -0000 X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 29 Jul 2013 14:18:50 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1V3oHa-00026r-8U from Yao_Qi@mentor.com ; Mon, 29 Jul 2013 07:18:42 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 29 Jul 2013 07:18:42 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Mon, 29 Jul 2013 07:18:41 -0700 Message-ID: <51F67992.30704@codesourcery.com> Date: Mon, 29 Jul 2013 14:18:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Muhammad Waqas CC: , , 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> In-Reply-To: <51F65519.2080806@codesourcery.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2013-07/txt/msg00703.txt.bz2 On 07/29/2013 07:42 PM, Muhammad Waqas wrote: Please have a look at http://sourceware.org/gdb/wiki/ContributionChecklist , it is very helpful for you to avoid some issues in your patch. > 2013-07-24 Muhammad Waqas ^^^ Two spaces. > > PR gdb/11568 > * breakpoint.c (breakpoint_auto_delete): add new condition > Remove thread related breakpoints if threads are exited. ^^^^^^^ Tab instead of spaces. The changelog entry is like this: PR gdb/11568 * breakpoint.c (breakpoint_auto_delete): Remove thread related breakpoints if threads are exited. > > > > Index: ./gdb/breakpoint.c > =================================================================== > RCS file: /cvs/src/src/gdb/breakpoint.c,v > retrieving revision 1.772 > diff -u -p -r1.772 breakpoint.c > --- ./gdb/breakpoint.c 6 Jul 2013 07:14:54 -0000 1.772 > +++ ./gdb/breakpoint.c 29 Jul 2013 11:22:05 -0000 > @@ -11910,6 +11910,15 @@ breakpoint_auto_delete (bpstat bs) > { > if (b->disposition == disp_del_at_next_stop) > delete_breakpoint (b); > + else if (b->thread > 0) /* If breakpoint relates to user created > + thread Check if it's not alive then > + delete it*/ Please move the comments into the brackets below. Period is missing in your comment, and we need two spaces after period at the end of comment. > + { > + struct thread_info * tp = find_thread_id (b->thread) ; A blank line is needed here. Indentation looks wrong here. > + if (tp != NULL && (tp->state == THREAD_EXITED > + || !target_thread_alive (tp->ptid))) > + delete_breakpoint (b); and here. > + } > } > } > I run thread-specific-bp.exp in async/non-stop mode, and I get a fail. I am afraid your patch only works in all-stop mode. > > testsuite/Changlog > > 2013-07-29 Muhammad Waqas > Jan Kratochvil ^^^^^^^^^^ Need a tab instead of spaces. Please reference existing entries in ChangeLog to see how to list two authors. > > * gdb.threads/thread-specific-bp.c: New file. > * gdb.threads/thread-specific-bp.exp: New file. Please include these new added files into your patch, so that people can review them. Here is an example (http://sourceware.org/ml/gdb-patches/2013-07/msg00671.html) I include new added file in the patch. I use git, but you can get the similar patch in cvs. > # Copyright (C) 1996-2013 Free Software Foundation, Inc. It should be 2013 only. > gdb_test_multiple "info breakpoint" "get info" { > -re "(\[0-9\]+)(\[^\n\r\]*breakpoint\[^\n\r\]*main.*thread $thre)" { I don't really understand this pattern. Probably, we only want to match "thread $thre" ".*$gdb_prompt $" is missing at the end of the pattern. Please add it. > fail "threaded breakpoint not deleted" > } > -re "(\[0-9\]+)(\[^\n\r\]*breakpoint\[^\n\r\]*main.*\n)" { > pass "threaded breakpoint deleted" fail/pass should be the same. > } > } Something like this: set test "thread-specific breakpoint is deleted" gdb_test_multiple "info breakpoint" $test { -re "thread $thre.*$gdb_prompt $" { fail $test } -re "$gdb_prompt $" { pass $test } } There are some trailing spaces in the test. Please remove them. -- Yao (齐尧)