From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0E9F03857011 for ; Mon, 12 Sep 2022 12:20:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0E9F03857011 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-508-vmPIXrhnMJ2MaVvMSPPSdg-1; Mon, 12 Sep 2022 08:20:35 -0400 X-MC-Unique: vmPIXrhnMJ2MaVvMSPPSdg-1 Received: by mail-wm1-f70.google.com with SMTP id j19-20020a05600c1c1300b003ab73e4c45dso7400597wms.0 for ; Mon, 12 Sep 2022 05:20:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date; bh=nbX280Ed674YkLbtazeg+rkiG9eDefvL3FABz/Sg3XE=; b=HgbvmCVmGe5xxeK1EwDQnQRPbHf+4vm8STNQiHuTqXaJt+kAvVHGlEhCXgnnMagSP1 d6rTGMY0BzvNd8qRQUsERTRp8K9KboNVY/W48R2Aw760grOV71tPy9+xpBzp4Tub0BMT g5ty9qChZ5yoHp1PJuv6quGUscYBuOxuydLSeUEzH7wzH+lMXa1QPC+CLajBWbb3OLIH MLTeZWDvMd340bCYVPunDlukxECyB7vt3f/LVXs0DpoUisaqtwfiWhoscvC987NNlPB5 nohmPyVa/QGYj3amCMwMDWierFAbOBP/0wJOhj8O0dBrajHQAFWO0PE6d5XIkbXvWsJy 5M9A== X-Gm-Message-State: ACgBeo1cOrjaw1j2XKn2TdbHoAPRMALD60G+M0W/hGIAl5PQJXmmh3ZS DakHKjMk9n+uI6hGykh1bjKt0Lkt61Pv9FAe19J3TQILOIvrgHXr+USE98ovp3vEVeX9PvOIPS5 6vbFD4KpdE6XVFieXJpHAAg== X-Received: by 2002:a5d:58eb:0:b0:228:62cb:a615 with SMTP id f11-20020a5d58eb000000b0022862cba615mr15477433wrd.71.1662985234373; Mon, 12 Sep 2022 05:20:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR7+OiWjXXDC29/LLzgm9fQya31lHmngvbKJ9btF3DKe6lFMUbJwPy10gAK5eFB3AQpJdTxiNQ== X-Received: by 2002:a5d:58eb:0:b0:228:62cb:a615 with SMTP id f11-20020a5d58eb000000b0022862cba615mr15477421wrd.71.1662985234087; Mon, 12 Sep 2022 05:20:34 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id y8-20020a05600015c800b0022a2e858b3dsm5418370wry.78.2022.09.12.05.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 05:20:33 -0700 (PDT) From: Andrew Burgess To: Bruno Larsen , gdb-patches@sourceware.org Subject: Re: [PATCH v4 10/15] explicitly test for stderr in gdb.base/dprintf.exp In-Reply-To: <20220720194441.168906-12-blarsen@redhat.com> References: <20220720194441.168906-1-blarsen@redhat.com> <20220720194441.168906-12-blarsen@redhat.com> Date: Mon, 12 Sep 2022 13:20:32 +0100 Message-ID: <87edwglr73.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, 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-List-Received-Date: Mon, 12 Sep 2022 12:20:38 -0000 Bruno Larsen via Gdb-patches writes: > Not all compilers add stderr debug information when compiling a > program. Clang, for instance, prefers to add nothing from standard > libraries and let an external debug package have this information. > Because of this, gdb.base/dprintf.exp was failing when GDB attempted to > use dprintf as a call to fprintf(stderrr, ...), like this: > > (gdb) PASS: gdb.base/dprintf.exp: call: fprintf: set dprintf style to call > continue > Continuing. > kickoff 1234 > also to stderr 1234 > 'stderr' has unknown type; cast it to its declared type > (gdb) FAIL: gdb.base/dprintf.exp: call: fprintf: 1st dprintf (timeout) > > To avoid this false positive, we explicitly test to see if > the compiler has added information about stderr at all, and abort > testing dprintf as an fprintf call if it is unavailable. > --- > gdb/testsuite/gdb.base/dprintf.exp | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/gdb/testsuite/gdb.base/dprintf.exp b/gdb/testsuite/gdb.base/dprintf.exp > index 0b209c02a62..e214531f6dc 100644 > --- a/gdb/testsuite/gdb.base/dprintf.exp > +++ b/gdb/testsuite/gdb.base/dprintf.exp > @@ -111,6 +111,16 @@ proc test_call {} { > test_dprintf "At foo entry.*arg=1235, g=2222\r\n" "2nd dprintf" > } > > + gdb_test_multiple "print stderr" "stderr symbol check" { > + -re "\\'stderr\\' has unknown type.*" { > + untested "No information available for stderr, exiting early" > + return > + } > + -re "\\\$1.*" { > + pass "stderr is available" I think this should be `pass $gdb_test_name`, but OK to commit with that change. Thanks, Andrew > + } > + } > + > with_test_prefix "fprintf" { > restart > > -- > 2.31.1