From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 9F7F83858D1E for ; Sun, 6 Mar 2022 10:43:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F7F83858D1E Received: by mail-wr1-x432.google.com with SMTP id n15so4924672wra.6 for ; Sun, 06 Mar 2022 02:43:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+KmYoTNYlzCgmqHcrae9vwg1H4ZywATCh+tgfgbjGVA=; b=1UATj43q6TRRQhKjvLauaww0mGuQCv0UT72eJBE1g1Mcy1ZyQhUnuLjndQZWgdr65P huw8M8F1WCDc/auHxB0a078ksIMJYt2T/XdYawPh0r2OTX/ufNv6RgVGOw8XdkfpHSSm NUQrPpubV4zBp8iA/e7y5TSzsd1b+0SvHjsgpt/2TKOLEHnlJbUkkUwD/JsWl7PVMJHd BN+W276Xp3bTdkuLNMLqI3LF9yXv5NSjUar2DHcSGCveAn2dNglFhuc/a8PGpaJM2UAG DMyQRj4WyVXTiX4uqvkVZ3bUyBFdr5jNuq7t0VFAnmhPjqscKUucRzePULUck2W5P5mb ZLDw== X-Gm-Message-State: AOAM531um4tDflEbCuQIPY9YjHg2jQSQDacYsH6IJefc6MyBlEDYClHj PF0GidahuL6J046VdU/RsTCDNZteGSpA X-Google-Smtp-Source: ABdhPJyGfdbXER+tBH6lguze/Yy0qHwJKfnqSOlAIOwEOxrKnErmUJMPpOZdlg2ygMEtSePDd/PfuA== X-Received: by 2002:a5d:4a05:0:b0:1f1:eb2f:4ec7 with SMTP id m5-20020a5d4a05000000b001f1eb2f4ec7mr1764346wrq.198.1646563416348; Sun, 06 Mar 2022 02:43:36 -0800 (PST) Received: from takamaka.home ([2a01:cb22:1d5:1100:5f23:af3f:1d36:51f6]) by smtp.gmail.com with ESMTPSA id w10-20020a5d680a000000b001f1dabec837sm3717262wru.113.2022.03.06.02.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Mar 2022 02:43:35 -0800 (PST) Received: by takamaka.home (Postfix, from userid 1000) id 501A7A4A87; Sun, 6 Mar 2022 14:43:33 +0400 (+04) Date: Sun, 6 Mar 2022 14:43:33 +0400 From: Joel Brobecker To: Bruno Larsen Cc: Joel Brobecker , Bruno Larsen via Gdb-patches Subject: Re: [PATCH] [gdb/testsuite] test a function call by hand fron pretty printer Message-ID: References: <20220223185729.25609-1-blarsen@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Sun, 06 Mar 2022 10:43:39 -0000 > > > +# This file is part of the GDB testsuite. It tests Python-based > > > +# pretty-printing for the CLI. > > > + > > > +load_lib gdb-python.exp > > > + > > > +standard_testfile > > > + > > > +# Start with a fresh gdb. > > > +gdb_exit > > > +gdb_start > > > > I think you can drop the gdb_exit/gdb_start part (it is taken care > > of by prepare_for_testing). > > If I remove this, skip_python_tests throws a TCL error, complaining > about not having a use_gdb_stub variable. If I change the order of the > 2 if statements, the error isn't there anymore but we compile the code > and don't use it. Do I keep the exit+start here and document why I > need it, or do I change the order of the if statements? Grumpf. This is a bug in skip_python_tests_prompt, in my opinion, which seems to make an unwarranted assumption about a GDB being available. It looks like a simple call to "gdb_start" at the start of that function should be sufficient to fix the issue, as gdb_start only starts GDB if one hasn't already been started. But I don't want this fix to be a precondition to your patch. In the meantime, I think a comment explaining why is good enough. I keep flip-flopping between the two options and can't decide, so I went with the simplest and less wasteful (avoiding to do build a test program if the testcase is not going to run). > > There is an oddity here; the name of the function seems to indicate > > that this should be "off" rather than "on", here. Can you confirm > > whether this is correct or not? > > It is, the name of the function is wrong. More details below > > > > > > + set remote_python_file [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py] > > > + gdb_test_no_output "source ${remote_python_file}" "load python file" > > > + > > > + return 0 > > > +} > > > + > > > +proc start_test_pretty {} { > > > > This function seems to be identical to the start_test_no_pretty. > > Can you perhaps factorize this into a single function, possibly > > with one argument being the "on/off" value to be used for > > the "print pretty" setting? > > > > If, for some reason I missed, it is better not to factorize in > > this case, the same comments I made above should apply here. > > The difference is when the pretty printer is turned on, actually. The > "no_pretty" option doesn't enter the frame that creates our problems, > just turns the pretty printer on and waits by the door - setup for > step and continue, whereas the "pretty" option enters the frame and > then turns the pretty printer on - setup for backtrace, finish, up and > down. > > I'll change the function to receive the breaking location instead. > Sorry about the confusion. Alright! Thanks for the explanation. -- Joel