From patchwork Wed Jul 19 13:40:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 72938 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E3AB6385AF93 for ; Wed, 19 Jul 2023 13:40:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3AB6385AF93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689774045; bh=DRgXz2GsH22YrK+G0/fzKL8IyGyB9DXYsWQbVMHk1aI=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=uSNgpw/DDl1e+125IbG1S1pS+R0hbmw61MQDWjNF9qfkyRmmrZjp/PE5x2FPO5WBm 4UFFLq8UPdg9vuEmOFyvkKb+gTPDYJ647IKVx0Kqut6F3F0jhxbS68jk6EhowZyJPP E6LzSCm4/2KYL6LJzDMJtry2euswYshymq/koHvA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0C4FE3856DCA for ; Wed, 19 Jul 2023 13:40:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0C4FE3856DCA Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-639-Y29W7eEEPDKdnsQ6O8uy0Q-1; Wed, 19 Jul 2023 09:40:20 -0400 X-MC-Unique: Y29W7eEEPDKdnsQ6O8uy0Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 942B08F1846 for ; Wed, 19 Jul 2023 13:40:20 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.225.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A2D9F6CDD; Wed, 19 Jul 2023 13:40:19 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH] gdb/testsuite: dont test dprintf to stderr in gdb.mi/mi-dprintf.exp Date: Wed, 19 Jul 2023 15:40:15 +0200 Message-ID: <20230719134015.2331400-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" As mentioned in commit 3f5bbc3e2075ef5061a815c73fdc277218489f22, some compilers such as clang don't add debug information about stderr by default, leaving it to external debug packages. However, different to that commit, there seems to be no simple way to test if stderr is present without introducing a failure, so instead this commit just disables tests that rely on stderr when clang is detected --- gdb/testsuite/gdb.mi/mi-dprintf.exp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi-dprintf.exp b/gdb/testsuite/gdb.mi/mi-dprintf.exp index e40fa6121fa..735f7fc234e 100644 --- a/gdb/testsuite/gdb.mi/mi-dprintf.exp +++ b/gdb/testsuite/gdb.mi/mi-dprintf.exp @@ -127,7 +127,6 @@ proc mi_continue_dprintf {args} { mi_continue_dprintf "gdb" # The "call" style depends on having I/O functions available, so test. - if ![target_info exists gdb,noinferiorio] { # Now switch styles and rerun; in the absence of redirection the @@ -136,9 +135,12 @@ if ![target_info exists gdb,noinferiorio] { mi_gdb_test "set dprintf-style call" ".*" "mi set dprintf style to call" mi_continue_dprintf "call" - mi_gdb_test "set dprintf-function fprintf" ".*" "mi set dprintf-channel stderr" - mi_gdb_test "set dprintf-channel stderr" ".*" "mi set dprintf channel" - mi_continue_dprintf "fprintf" + # Clang does not add information about stderr, so skip these tests if needed. + if ![test_compiler_info clang*] { + mi_gdb_test "set dprintf-function fprintf" ".*" "mi set dprintf-channel stderr" + mi_gdb_test "set dprintf-channel stderr" ".*" "mi set dprintf channel" + mi_continue_dprintf "fprintf" + } } set target_can_dprintf 0