Message ID | 3150ecd9-9221-4360-6a16-563b3c5ef1ab@suse.de |
---|---|
State | New, archived |
Headers |
Received: (qmail 25496 invoked by alias); 3 Sep 2019 17:43:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25488 invoked by uid 89); 3 Sep 2019 17:43:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=2323, breakpoints X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Sep 2019 17:43:47 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A8CE7AFCE; Tue, 3 Sep 2019 17:43:45 +0000 (UTC) To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>, Jan Kratochvil <jan.kratochvil@redhat.com> From: Tom de Vries <tdevries@suse.de> Subject: [RFC][gdb/testsuite] Remove breakpoint command in gdb.base/ui-redirect.exp Openpgp: preference=signencrypt Message-ID: <3150ecd9-9221-4360-6a16-563b3c5ef1ab@suse.de> Date: Tue, 3 Sep 2019 19:43:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------57AB55571C26F8A8DE58B69A" X-IsSubscribed: yes |
Commit Message
Tom de Vries
Sept. 3, 2019, 5:43 p.m. UTC
Hi, I noticed a bit in gdb.base/ui-redirect.exp that sets a breakpoint command on main, but then due to runto_main, the break point is deleted: ... (gdb) break main^M Breakpoint 1 at 0x4004d7: file /data/gdb_versions/devel/src/gdb/testsuite/gdb.base/start.c, line 34.^M (gdb) commands^M Type commands for breakpoint(s) 1, one per line.^M End with a line saying just "end".^M >PASS: gdb.base/ui-redirect.exp: commands print 1^M >PASS: gdb.base/ui-redirect.exp: print 1 end^M (gdb) PASS: gdb.base/ui-redirect.exp: end delete breakpoints^M Delete all breakpoints? (y or n) y^M ... In the original commit ( submission here https://sourceware.org/ml/gdb-patches/2010-09/msg00120.html ) there was no runto_main, and the breakpoint command was not triggered either. Is this some artefact, and can it be removed, or is it actually testing something related to redirection? Thanks, - Tom
Comments
* Tom de Vries <tdevries@suse.de> [2019-09-03 19:43:44 +0200]: > Hi, > > I noticed a bit in gdb.base/ui-redirect.exp that sets a breakpoint > command on main, but then due to runto_main, the break point is deleted: > ... > (gdb) break main^M > Breakpoint 1 at 0x4004d7: file > /data/gdb_versions/devel/src/gdb/testsuite/gdb.base/start.c, line 34.^M > (gdb) commands^M > Type commands for breakpoint(s) 1, one per line.^M > End with a line saying just "end".^M > >PASS: gdb.base/ui-redirect.exp: commands > print 1^M > >PASS: gdb.base/ui-redirect.exp: print 1 > end^M > (gdb) PASS: gdb.base/ui-redirect.exp: end > delete breakpoints^M > Delete all breakpoints? (y or n) y^M > ... > > In the original commit ( submission here > https://sourceware.org/ml/gdb-patches/2010-09/msg00120.html ) there was > no runto_main, and the breakpoint command was not triggered either. > > Is this some artefact, and can it be removed, or is it actually testing > something related to redirection? I can't comment on the original patch intention, but given this part of the tests never really did anything useful, and the "commands" mechanism is tested in gdb.base/commands.exp, I'd be OK with what you propose below. I'd suggest give it a few days for anyone else to chip in, then just commit this as an obvious cleanup. Thanks, Andrew > > Thanks, > - Tom > diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp b/gdb/testsuite/gdb.base/ui-redirect.exp > index 4507ac51a2..e48ca72e91 100644 > --- a/gdb/testsuite/gdb.base/ui-redirect.exp > +++ b/gdb/testsuite/gdb.base/ui-redirect.exp > @@ -23,23 +23,6 @@ if { [prepare_for_testing "failed to prepare" ui-redirect start.c] } { > return -1 > } > > -gdb_breakpoint main > - > -set test "commands" > -gdb_test_multiple $test $test { > - -re "End with a line saying just \"end\"\\.\r\n>$" { > - pass $test > - } > -} > - > -set test "print 1" > -gdb_test_multiple $test $test { > - -re "\r\n>$" { > - pass $test > - } > -} > -gdb_test_no_output "end" > - > if ![runto_main] { > fail "can't run to main" > return -1
On Tue, 03 Sep 2019 19:43:44 +0200, Tom de Vries wrote: > I noticed a bit in gdb.base/ui-redirect.exp that sets a breakpoint > command on main, but then due to runto_main, the break point is deleted: ... > In the original commit ( submission here > https://sourceware.org/ml/gdb-patches/2010-09/msg00120.html ) there was > no runto_main, and the breakpoint command was not triggered either. > > Is this some artefact, and can it be removed, or is it actually testing > something related to redirection? It looks to me the patch which added the "runto_main" part: commit ca1285d17534cff3041c07ac7841288e1b3ba19c Author: Alan Hayward <alan.hayward@arm.com> Date: Fri May 17 14:15:01 2019 +0100 Add debug redirect option disabled the regression testing. "runto_main" should be removed otherwise the testcase does not test anything (or it just tests less). Jan
On Wed, 04 Sep 2019 12:59:52 +0200, Andrew Burgess wrote: > I can't comment on the original patch intention, but given this part > of the tests never really did anything useful, and the "commands" > mechanism is tested in gdb.base/commands.exp, I'd be OK with what you > propose below. The "commands" mechanism is not tested there for "save breakpoints" with various types of output redirection. Jan
diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp b/gdb/testsuite/gdb.base/ui-redirect.exp index 4507ac51a2..e48ca72e91 100644 --- a/gdb/testsuite/gdb.base/ui-redirect.exp +++ b/gdb/testsuite/gdb.base/ui-redirect.exp @@ -23,23 +23,6 @@ if { [prepare_for_testing "failed to prepare" ui-redirect start.c] } { return -1 } -gdb_breakpoint main - -set test "commands" -gdb_test_multiple $test $test { - -re "End with a line saying just \"end\"\\.\r\n>$" { - pass $test - } -} - -set test "print 1" -gdb_test_multiple $test $test { - -re "\r\n>$" { - pass $test - } -} -gdb_test_no_output "end" - if ![runto_main] { fail "can't run to main" return -1