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 A66AB384D15E for ; Tue, 13 Sep 2022 12:08:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A66AB384D15E Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-588-fhBgZKV8Pcuh5MV2RPd5Zw-1; Tue, 13 Sep 2022 08:08:11 -0400 X-MC-Unique: fhBgZKV8Pcuh5MV2RPd5Zw-1 Received: by mail-ej1-f69.google.com with SMTP id qw34-20020a1709066a2200b0077e0e8a55b4so2237494ejc.21 for ; Tue, 13 Sep 2022 05:08:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=Qb+Xp6VzC9AJYejQCLV7RUW4xRVPH9CaAEM2J5RaY4E=; b=FcmvHDc3hgsK/S53d3gda3eAeh7dUSnpYNiZf85UQcvze7F2dUMJ2JoGcSuMpEEVHz /gtTFGZT/fTHyoA4bKkkaqJJZCf+pXDTPJJYO1C0KafK181FjJmibUjW/cojzJDUbarq 9s5zkOINuvBQD8KI781Y8VmwzFJ3SXj4xbyljs4zIRS37iCvQrEI2lFPmN3r9ICQkhmR ntMRDlx8cNsU1gSdqtbTqhMIjXkARP31cJAhTHaOcUMzG0l90zrpEygrQ3xqOmFOFnv9 uJY4YgpYaE7IFglqer2l5rl/Kc4rCS1RwF7Cmid7+gUJ5GZuB5CffNmlyX/B+rQFw4Si rs5Q== X-Gm-Message-State: ACgBeo0cBmpZnTGvI31lu+z+uxFYTbbQhgMPKn5jj9UniOFDjHefUGYz 0yccdAfGQImFJWm2rCOMaZxCSDvvVYK41g+FCD0YUcNcMmVcuTKs8V64KEgOT0qV2M2+szEpOfq sMrNo3gfkk4JSug8a9zPeVg== X-Received: by 2002:a05:6402:428a:b0:42e:8f7e:1638 with SMTP id g10-20020a056402428a00b0042e8f7e1638mr25993603edc.228.1663070889805; Tue, 13 Sep 2022 05:08:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR4dmEKr/klYS/vy1JVDmG5S2Mbew2ow6YTLwRPShCQfNBGKzKG2aZa1jSGCNOLUtJzja5Tpyw== X-Received: by 2002:a05:6402:428a:b0:42e:8f7e:1638 with SMTP id g10-20020a056402428a00b0042e8f7e1638mr25993588edc.228.1663070889592; Tue, 13 Sep 2022 05:08:09 -0700 (PDT) Received: from [192.168.0.45] (ip-213-220-232-121.bb.vodafone.cz. [213.220.232.121]) by smtp.gmail.com with ESMTPSA id e7-20020a170906314700b007708130c287sm6026200eje.40.2022.09.13.05.08.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Sep 2022 05:08:09 -0700 (PDT) Message-ID: Date: Tue, 13 Sep 2022 14:08:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH v4 10/15] explicitly test for stderr in gdb.base/dprintf.exp To: Andrew Burgess , gdb-patches@sourceware.org References: <20220720194441.168906-1-blarsen@redhat.com> <20220720194441.168906-12-blarsen@redhat.com> <87edwglr73.fsf@redhat.com> From: Bruno Larsen In-Reply-To: <87edwglr73.fsf@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, 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: Tue, 13 Sep 2022 12:08:14 -0000 Thanks, pushed! Cheers, Bruno On 12/09/2022 14:20, Andrew Burgess wrote: > 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