From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by sourceware.org (Postfix) with ESMTPS id B81163857C7E for ; Fri, 10 Dec 2021 21:55:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B81163857C7E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f44.google.com with SMTP id y196so7865750wmc.3 for ; Fri, 10 Dec 2021 13:55:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=N6wy86GdRwkBEyFsZY5dEo3bp8en91mEfwyLcARwMNk=; b=iPOdhWuB2tqnBrle4e7vhmkIIVcIzM74Zz994ndzOwggHqzh6gvyz8J3CGeLPjNFmR 6yIp95zp5PKPC7ihTEZBhxaFw48k9U+8biZfotVTmxmfxoHIjNP5Upz36W8wlpr+LIJf qJyA0t7l0fft3YrgIDXJgW7dl7WaMtX4juGpovW6yFRjHUCPUfav8EvJ+Ju0Kw3zRJ2d 5dMJ8dEHsM9JrNHbXGmLOFMG7vlxDgtbXN3t4CpmLxj2ZsdLpCWfHcu0eemNGOfeGbE2 mjzP8aH8QCRiHjMRr7kCwXHWCPb41FFMK69Zf5LvVkNt54JJmcSg9jAcjpxgPR6rMofi QwHg== X-Gm-Message-State: AOAM530u7H8GNIxEEtgk/we+gBpW/PyVf23ZxG6ClpNJPC/l1Tk4XhoB Ma9EAK5KPBq9vRHj8Cy3dn1/7Sk6UsY= X-Google-Smtp-Source: ABdhPJyAGY9c/kSitk83C91LxdE6I81VAj/scR7pC9M46ErTFYs8norq+YYwb30pUobKFY+VDmnK9g== X-Received: by 2002:a05:600c:3584:: with SMTP id p4mr20118119wmq.65.1639173334552; Fri, 10 Dec 2021 13:55:34 -0800 (PST) Received: from ?IPV6:2001:8a0:f912:1a00:d3db:ac91:4b9e:1449? ([2001:8a0:f912:1a00:d3db:ac91:4b9e:1449]) by smtp.gmail.com with ESMTPSA id j17sm5021724wmq.41.2021.12.10.13.55.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Dec 2021 13:55:33 -0800 (PST) Message-ID: <882b90a8-a819-4bd5-1e51-fa1cd408ed4d@palves.net> Date: Fri, 10 Dec 2021 21:55:32 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH 04/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-catch-load.exp Content-Language: en-US To: Lancelot SIX , gdb-patches@sourceware.org References: <20211126230038.103225-1-lsix@lancelotsix.com> <20211126230038.103225-5-lsix@lancelotsix.com> From: Pedro Alves In-Reply-To: <20211126230038.103225-5-lsix@lancelotsix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 10 Dec 2021 21:55:38 -0000 On 2021-11-26 23:00, Lancelot SIX via Gdb-patches wrote: > When I run the testsuite, I have: > > Running .../gdb/testsuite/gdb.mi/mi-catch-load.exp ... > DUPLICATE: gdb.mi/mi-catch-load.exp: breakpoint at main > DUPLICATE: gdb.mi/mi-catch-load.exp: mi runto main > > Fix by grouping the various phases in with_test_prefix blocks. > > Tested on x86_64-linux > --- > gdb/testsuite/gdb.mi/mi-catch-load.exp | 77 ++++++++++++++------------ > 1 file changed, 41 insertions(+), 36 deletions(-) > > diff --git a/gdb/testsuite/gdb.mi/mi-catch-load.exp b/gdb/testsuite/gdb.mi/mi-catch-load.exp > index cbd3967f47a..431db68c5c6 100644 > --- a/gdb/testsuite/gdb.mi/mi-catch-load.exp > +++ b/gdb/testsuite/gdb.mi/mi-catch-load.exp > @@ -40,48 +40,53 @@ if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfile2}" ${binfile2} {debug}] ! > return -1 > } > > -mi_clean_restart $binfile > -mi_runto_main > - > # test -catch-load > -mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-load: auto-solib-add on" > -mi_gdb_test "222-catch-load -t mi-catch-load-so.so*" \ > - "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",catch-type=\"load\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \ > - "catch-load: catch load" > -mi_send_resuming_command "exec-continue" "catch-load: continue" > +with_test_prefix "test -catch-load" { Can you drop the "test" from this? These are all tests, so word like "test" and "check" are redundant. > + mi_clean_restart $binfile > + mi_runto_main > > -gdb_expect { > - -re "\\*stopped.*reason=\"solib-event\".*added=.*\r\n.*\r\n$mi_gdb_prompt$" { > - pass "catch-load: solib-event stop" > - } > - -re ".*$mi_gdb_prompt$" { > - setup_kfail mi/15945 *-*-*mingw* > - fail "catch-load: solib-event stop" > - } > - timeout { > - fail "(timeout) catch-load: solib-event stop" > + mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" \ > + "catch-load: auto-solib-add on" Given the prefix, this manual "catch-load:" prefix is now redundant. > + mi_gdb_test "222-catch-load -t mi-catch-load-so.so*" \ > + "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",catch-type=\"load\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \ > + "catch-load: catch load" > + mi_send_resuming_command "exec-continue" "catch-load: continue" > + > + gdb_expect { > + -re "\\*stopped.*reason=\"solib-event\".*added=.*\r\n.*\r\n$mi_gdb_prompt$" { > + pass "catch-load: solib-event stop" > + } > + -re ".*$mi_gdb_prompt$" { > + setup_kfail mi/15945 *-*-*mingw* > + fail "catch-load: solib-event stop" > + } > + timeout { > + fail "(timeout) catch-load: solib-event stop" > + } > } > } > > -mi_clean_restart $binfile > -mi_runto_main > - > # test -catch-unload > -mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-unload: auto-solib-add on" > -mi_gdb_test "222-catch-unload -t mi-catch-load-so.so*" \ > - "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",catch-type=\"unload\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \ > - "catch-unload: catch unload" > -mi_send_resuming_command "exec-continue" "catch-unload: continue" > +with_test_prefix "test -catch-unload" { > + mi_clean_restart $binfile > + mi_runto_main > > -gdb_expect { > - -re "\\*stopped.*reason=\"solib-event\".*removed=.*\r\n.*\r\n$mi_gdb_prompt$" { > - pass "catch-unload: solib-event stop" > - } > - -re ".*$mi_gdb_prompt$" { > - setup_kfail mi/15945 *-*-*mingw* > - fail "catch-unload: solib-event stop" > - } > - timeout { > - fail "(timeout) catch-unload: solib-event stop" > + mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-unload: auto-solib-add on" > + mi_gdb_test "222-catch-unload -t mi-catch-load-so.so*" \ > + "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",catch-type=\"unload\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \ > + "catch-unload: catch unload" > + mi_send_resuming_command "exec-continue" "catch-unload: continue" > + > + gdb_expect { > + -re "\\*stopped.*reason=\"solib-event\".*removed=.*\r\n.*\r\n$mi_gdb_prompt$" { > + pass "catch-unload: solib-event stop" > + } > + -re ".*$mi_gdb_prompt$" { > + setup_kfail mi/15945 *-*-*mingw* > + fail "catch-unload: solib-event stop" > + } > + timeout { > + fail "(timeout) catch-unload: solib-event stop" While at it, could you move the "(timeout)" to the end? Like: fail "catch-unload: solib-event stop (timeout)"