From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zkg5L40xbmATewAAWB0awg (envelope-from ) for ; Wed, 07 Apr 2021 18:26:21 -0400 Received: by simark.ca (Postfix, from userid 112) id B45761E965; Wed, 7 Apr 2021 18:26:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 1A9291E01F for ; Wed, 7 Apr 2021 18:26:21 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5B6DC393A403; Wed, 7 Apr 2021 22:26:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B6DC393A403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1617834380; bh=y2rw6302HgaGmqy8U9rXA6wEpVbL2JPl0bhF1qxooFE=; 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=duayP6TFA25mcP/de1y7WbCsC3GUIPRCMDW+STW0APmsCYx5MfxUkzWvuyaaffF/0 7RA/q5aCkxqPMG0QagY4jGeMpuokItZGrPrQwkQsRAWbBksy7ZlONcHF1pPkWq4kHY bSjRCVtmouzbifCBlFhfmSJBzUC41zOtMQ5GvoAs= 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> 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-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" 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