From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sJGODExXiGDADQAAWB0awg (envelope-from ) for ; Tue, 27 Apr 2021 14:26:20 -0400 Received: by simark.ca (Postfix, from userid 112) id 319401F11C; Tue, 27 Apr 2021 14:26:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 6D03B1E783 for ; Tue, 27 Apr 2021 14:26:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 77B8D3896C32; Tue, 27 Apr 2021 18:26:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77B8D3896C32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619547978; bh=16tE34QNVI9HHLVxL/zMQyrdYQGs378xnV9r1Gn8Mb8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PNDwMnIINNFdWC4u2Ivq7DiSFq5NtWzKeViE8qCdvGwRPy66OV7bpGB/+n1Navnnh ITUSgohyBPEjSGQLyzH+B49IJjTHMv+vsW7p/304zaqbS6nkwGHOTOk4S+yvvYACs+ 0zkNoIgPLm06PSyrXkRf4FuMDhA3jjdWCiDeQokg= Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by sourceware.org (Postfix) with ESMTPS id 33A05388A035 for ; Tue, 27 Apr 2021 18:26:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 33A05388A035 Received: by mail-qk1-x72c.google.com with SMTP id v23so8930604qkj.13 for ; Tue, 27 Apr 2021 11:26:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=16tE34QNVI9HHLVxL/zMQyrdYQGs378xnV9r1Gn8Mb8=; b=S8DMTsLI7G7h7aC+lXrX41BdXIlqNK3sb1pkqUx+xhoxXXNjthKR6O8HYbnhclO8fe g2zMqaz3XCjhG7C+NOEJr1PidNsRvkgK7g/ZreiZhO7ABzW/CnkiitmdLLnCIkeGOIN2 ZbFzwuPc9S/C9qFWvSTJaw+VgDH77Y0zrZkji89xlan5OAfkW4yb2WJPAaQaiFJ+ijxv jEmQB69d96LIoD2ZUhY1KCZRPVjFt9p4EiHBTFUsL+nhu0O92oNbcLBNxhwVDPak3m67 LbUqW+og6bRGfjpm8nFc/CTsoul4U4Th8rRoFDTquJ7zcBOGzGGrgcRDztfG34FKR1nU RKTQ== X-Gm-Message-State: AOAM532urFSOB3OHNTPVyYR8RVW9a/T5IGulP3lJKOvbgIqeQnxsfjgB MFLvrUt5/yTwqHiUGUQuSaTx0LW8q1oB4Q== X-Google-Smtp-Source: ABdhPJwn02a20Y1yrQYuKyvYmR6dXATfhUbxhJmeOA5kV3eZtHjiZBL11mSinAkitu7/M735icpLNw== X-Received: by 2002:a37:4042:: with SMTP id n63mr23746969qka.501.1619547975722; Tue, 27 Apr 2021 11:26:15 -0700 (PDT) Received: from localhost.localdomain ([2804:7f0:4841:2d9e:316d:692a:3493:8ea0]) by smtp.gmail.com with ESMTPSA id 67sm463812qtf.54.2021.04.27.11.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 11:26:15 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH,v2] [testsuite] Fix timeout with maint print objfiles Date: Tue, 27 Apr 2021 15:26:08 -0300 Message-Id: <20210427182608.2596880-1-luis.machado@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210427141044.2573352-1-luis.machado@linaro.org> References: <20210427141044.2573352-1-luis.machado@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Updates on v2: - Add missing exp_continue when looking for "readnow". - Removed wraps -- I'm seeing timeouts from gdb.rust/traits.exp when we attempt to print things with "maint print objfiles". This happens for two reasons: 1 - GDB does not explicitly split each entry into its own line, but rather relies on the terminal's width to insert line breaks. 2 - When running the GDB testsuite, such width may be unlimited, which will prevent GDB from inserting any line breaks. As a result, the output may be too lengthy and will come in big lines. Tweak the support library to match the patterns line-by-line, which gives us more time to match things. Also fix GDB's output to print one entry per line, regardless of the terminal width. A similar approach was used in another testcase using the same command (commit eaeaf44cfdc9a4096a0dd52fa0606f29d4bfd48e). With the new line breaks, we don't need a particular pattern, so clean up that test as well. gdb/ChangeLog: YYYY-MM-DD Luis Machado * psymtab.c (psymbol_functions::dump): Output newline. Remove wrap. * symmisc.c (dump_objfile): Likewise. gdb/testsuite/ChangeLog: YYYY-MM-DD Luis Machado * gdb.base/maint.exp: Drop a pattern that is not needed. * lib/gdb.exp (readnow): Match line-by-line. --- gdb/psymtab.c | 3 +-- gdb/symmisc.c | 7 ++----- gdb/testsuite/gdb.base/maint.exp | 3 --- gdb/testsuite/lib/gdb.exp | 17 ++++++++++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 75a307c89aa..fe32486e2fc 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -885,8 +885,7 @@ psymbol_functions::dump (struct objfile *objfile) printf_filtered ("%s at ", psymtab->filename); gdb_print_host_address (psymtab, gdb_stdout); - printf_filtered (", "); - wrap_here (" "); + printf_filtered ("\n"); } printf_filtered ("\n\n"); } diff --git a/gdb/symmisc.c b/gdb/symmisc.c index d992c671635..e38ceb6bda1 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -131,12 +131,9 @@ dump_objfile (struct objfile *objfile) printf_filtered ("%s at ", symtab_to_filename_for_display (symtab)); gdb_print_host_address (symtab, gdb_stdout); - printf_filtered (", "); if (SYMTAB_OBJFILE (symtab) != objfile) - { - printf_filtered ("NOT ON CHAIN! "); - } - wrap_here (" "); + printf_filtered (", NOT ON CHAIN!"); + printf_filtered ("\n"); } } printf_filtered ("\n\n"); diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index e72392220cc..6831d1ba720 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -230,9 +230,6 @@ gdb_test_multiple "maint print objfiles" "" -lbl { set symtabs 1 exp_continue } - -re " at $hex," { - exp_continue - } -re -wrap "" { pass $gdb_test_name } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 943112fcc80..36a5fd4feb7 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -7511,17 +7511,24 @@ proc readnow { args } { } else { set re "" } + + set readnow_p 0 + # Given the listing from the following command can be very verbose, match + # the patterns line-by-line. This prevents timeouts from waiting for + # too much data to come at once. set cmd "maint print objfiles $re" - gdb_test_multiple $cmd "" { - -re -wrap "\r\n.gdb_index: faked for \"readnow\"\r\n.*" { - return 1 + gdb_test_multiple $cmd "" -lbl { + -re "\r\n.gdb_index: faked for \"readnow\"" { + # Record the we've seen the above pattern. + set readnow_p 1 + exp_continue } -re -wrap "" { - return 0 + # We don't care about any other input. } } - return 0 + return $readnow_p } # Return 1 if partial symbols are available. Otherwise, return 0. -- 2.25.1