From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EX1SMIwqgGCmOAAAWB0awg (envelope-from ) for ; Wed, 21 Apr 2021 09:37:16 -0400 Received: by simark.ca (Postfix, from userid 112) id B6BEE1F104; Wed, 21 Apr 2021 09:37:16 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 22F3F1E783 for ; Wed, 21 Apr 2021 09:37:16 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B4CD73892449; Wed, 21 Apr 2021 13:37:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4CD73892449 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619012235; bh=Ms+NzCv4RzFuhtDMhErSOuC9G5j6jJleNEh/+oWRMq8=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Rz/1usU7gwbXeT3C/O3NsSwd5nJr5Cq93zWO36Rw4NQYuco6AdQKAhP7N9WBzkaaP e3D5JyZ7G3yTtY0+m4LBk8N9NWsY8lbJNvjhvBWWEgkuT8I4TGzcU/09BqQPCdtEPM JH2rm6IdUN8O/46/wydwj1PofxDWFy/uZJgmQL7Q= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 1EDDA3857C7B for ; Wed, 21 Apr 2021 13:37:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1EDDA3857C7B Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 13LDb3HN016581 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Apr 2021 09:37:07 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 13LDb3HN016581 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CC37A1E783; Wed, 21 Apr 2021 09:37:02 -0400 (EDT) Subject: Re: [PATCH v3 4/4] gdb/mi: add a '--force-condition' flag to the '-break-insert' cmd To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: Message-ID: Date: Wed, 21 Apr 2021 09:37:02 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 21 Apr 2021 13:37:03 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" > diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp > index e46a6cc0ec6..5f1c6810389 100644 > --- a/gdb/testsuite/gdb.mi/mi-break.exp > +++ b/gdb/testsuite/gdb.mi/mi-break.exp > @@ -408,6 +408,30 @@ proc_with_prefix test_explicit_breakpoints {} { > ".*Source filename requires function, label, or line offset.*" > } > > +# Test forcing an invalid condition. > + > +proc_with_prefix test_forced_conditions {} { > + set warning ".*warning: failed to validate condition .* disabling.*" > + > + # Define a plain breakpoint first, and a condition later. > + mi_create_breakpoint "callme" "define a bp" "" > + mi_gdb_test "-break-condition --force \$bpnum bad" \ > + "${warning}\\^done" \ > + "invalid condition is forced" This literally sends -break-condition --force $bpnum bad But I don't understand what $bpnum refers to, can you explain? I'm a bit lost. > + > + set loc [mi_make_breakpoint_loc -enabled "N"] > + set args [list -cond "bad" -locations "\\\[$loc\\\]"] > + set bp [eval mi_make_breakpoint_multi $args] > + > + mi_gdb_test "-break-insert -c bad --force-condition callme" \ > + "${warning}\\^done,$bp" \ > + "breakpoint with forced condition" 👍 (are we allowed emojis here?) > + > + mi_gdb_test "-dprintf-insert -c bad --force-condition callme 123" \ > + "${warning}\\^done,$bp" \ > + "dprintf with forced condition" It's really just a nit because it doesn't affect the test, but a dprintf would normally take a format string, so I guess you meant: -dprintf-insert -c bad --force-condition callme "%d" 123 Or something like that. So the patch pretty much LGTM, except the --force vs -force issue mentioned in my other message. Simon