From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Wf+tFSkkH2NvZTgAWB0awg (envelope-from ) for ; Mon, 12 Sep 2022 08:20:57 -0400 Received: by simark.ca (Postfix, from userid 112) id 4F2921E110; Mon, 12 Sep 2022 08:20:57 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=d+l7JlNT; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.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 019231E0D3 for ; Mon, 12 Sep 2022 08:20:57 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A41BC3851A96 for ; Mon, 12 Sep 2022 12:20:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A41BC3851A96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662985256; bh=nbX280Ed674YkLbtazeg+rkiG9eDefvL3FABz/Sg3XE=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=d+l7JlNTgSVoSYmkas9S6WrP4iJLQO4agzhd2UJtyIRdVE7BFJhE+Wd6g7jxxgPdC ZG4Q51UKLkNGkTHv4t4eIFB/ysoWl7mfg51aAWDFgsSjySWSsC56llhFhXE7yx6LwT MNqlv2SfICmIFEAVW1toYW/GGl1MTa5lk92Ikf9U= 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) 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-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: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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