From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 4B3A9385801D for ; Wed, 7 Apr 2021 22:26:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4B3A9385801D 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 137MQA8F008556 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Apr 2021 18:26:15 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 137MQA8F008556 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 5CA2C1E01F; Wed, 7 Apr 2021 18:26:10 -0400 (EDT) Subject: Re: [PATCH 4/4] gdb/mi: add a '-b' flag to the '-break-insert' cmd to force the condition To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: <30001cddf6183155c7355df3c74848881f2d80c4.1617806599.git.tankut.baris.aktemur@intel.com> From: Simon Marchi Message-ID: <51b68d2c-70b9-af55-f125-b657d3e0b858@polymtl.ca> Date: Wed, 7 Apr 2021 18:26:10 -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: <30001cddf6183155c7355df3c74848881f2d80c4.1617806599.git.tankut.baris.aktemur@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 7 Apr 2021 22:26:10 +0000 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 07 Apr 2021 22:26:19 -0000 On 2021-04-07 10:55 a.m., Tankut Baris Aktemur via Gdb-patches wrote: > @@ -203,6 +205,7 @@ mi_cmd_break_insert_1 (int dprintf, const char *command, char **argv, int argc) > {"f", PENDING_OPT, 0}, > {"d", DISABLE_OPT, 0}, > {"a", TRACEPOINT_OPT, 0}, > + {"b", FORCE_CONDITION_OPT, 0}, > {"-qualified", QUALIFIED_OPT, 0}, > {"-source" , EXPLICIT_SOURCE_OPT, 1}, > {"-function", EXPLICIT_FUNC_OPT, 1}, Hi, it's me nitpicking names again: instead of choosing a meaningless single letter, could we use --force-condition? It would just be more obvious to any human reading MI logs, and machines don't really care about the extra typing. > +proc test_forced_conditions {} { > + # Test forcing an invalid condition. > + mi_gdb_test "info break" > + mi_gdb_test "-break-condition -force 15 bad" \ > + ".*warning: failed to validate condition at location 15.1, disabling:.*" \ > + "invalid condition is forced" > + > + mi_gdb_test "-break-insert -c bad -b callme" \ > + ".*warning: failed to validate condition at location 1, disabling:.*" \ > + "breakpoint with bad condition is forced" > + > + mi_gdb_test "-dprintf-insert -c bad -b callme 123" \ > + ".*warning: failed to validate condition at location 1, disabling:.*" \ > + "dprintf with bad condition is forced" It would be good to validate at least that the commands succeed (output ^done). At least for the -break-insert case, it might be a good idea to improve (to be able to pass the -b/--force-condition flag) and use mi_create_breakpoint_multi. You could then validate what the command outputs (one location with enabled="N"). Simon