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.129.124]) by sourceware.org (Postfix) with ESMTPS id A732E382DE0B for ; Wed, 26 Oct 2022 15:37:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A732E382DE0B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666798662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m4dNsfyfvU9H7z9fQsfoaZWUqI0OJI8UuMt3nCY3iIs=; b=c7oRLKjvsIrSLaRHpGsptaTKPpmdTuSgFWPDVSL1vBaqtywcv8Lms17FE9g3YoAXxWVo6C YvFbl3vfdkMd/AU8bxjoAHwNQXHl900Fz5om9AF4oBfGyUWpveK+CveCMU3aN+9ifJiHKH K4fffZcrgE5WGXwuAWsE6AzTEzirioM= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-467-U2mTalulMtygKxnd_Ss8fA-1; Wed, 26 Oct 2022 11:37:40 -0400 X-MC-Unique: U2mTalulMtygKxnd_Ss8fA-1 Received: by mail-wm1-f71.google.com with SMTP id r81-20020a1c4454000000b003c41e9ae97dso1243973wma.6 for ; Wed, 26 Oct 2022 08:37:40 -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:message-id:reply-to; bh=m4dNsfyfvU9H7z9fQsfoaZWUqI0OJI8UuMt3nCY3iIs=; b=tSdKudEuF1L5JpxQSkbyc12J4U59H6L9ktL+bGkTm7Y7/660hDGN5mN5T75nDgeB0B SGPTipB3A7xlkRiwY6yqO6oDmEKs9rj22CBDhP5ZRyUIwcHx4tyV1FwVoaimVSSbAFJA HzDMc44k8zK6RSQkJ7oaC6LcDi1KyY3mYRIp0zbJa9zPvzlIh/MKSv3zHoIrDvYLAfjO Zir1R3hGQInWN1dOJYO1qg4lXJZeWTw9/9ZAD69RW5gU8CJZCQb/WrPfWZdviQXkKFsp sU0+tyA/O11zNLy6rWxgxP/aVMseBcDZhSwKkNJiymraVEI6+hlxIcB2DNGQfrbnzd92 OEYQ== X-Gm-Message-State: ACrzQf3Xaq4A2S8lZhvuVr5ZnH+J7kTedqHIg8erU790IWWCe/5SwOud EVS6Qmupy7TJ6n2hwrVbmQAooFxdJAPLxmPWd0yCvGrqJRXxCMc3yVLMTajKqHBuG9HoBeh/gvo GBul+XgOnDnZwbacChdsyUA== X-Received: by 2002:a5d:6481:0:b0:236:792e:790c with SMTP id o1-20020a5d6481000000b00236792e790cmr9242703wri.697.1666798659458; Wed, 26 Oct 2022 08:37:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mlKDozKDlPUcyrxYs+jm/7OMKkgBE4Rt8hNc5IvMmFTBe0h+nelpXpwvOdBtXyIw0juQW3Q== X-Received: by 2002:a5d:6481:0:b0:236:792e:790c with SMTP id o1-20020a5d6481000000b00236792e790cmr9242690wri.697.1666798659246; Wed, 26 Oct 2022 08:37:39 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id bt5-20020a056000080500b0023655e51c14sm5901377wrb.32.2022.10.26.08.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 08:37:38 -0700 (PDT) From: Andrew Burgess To: Bruno Larsen , gdb-patches@sourceware.org Subject: Re: [PATCH 08/11] gdb/testsuite: disable gdb.cp/typeid.exp when using clang In-Reply-To: <20221004170747.154307-10-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> <20221004170747.154307-10-blarsen@redhat.com> Date: Wed, 26 Oct 2022 16:37:37 +0100 Message-ID: <87pmee61fi.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=-11.8 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_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Bruno Larsen via Gdb-patches writes: > Since clang chooses to not add any debug information from standard > libraries, gdb.cp/typeid.exp will always fail, so this test is skipped > when it clang used. OK, so I see what you're saying. But I don't think it follows that we should skip the whole test. Also, without digging into the test further, and looking at the generated symbols, I think the above explanation makes things sound worse than they are. So, here's some of the output for 'nm -C' for the test binary (built with Clang): 0000000000003b70 V typeinfo for VB2 0000000000003b38 V typeinfo for Base 0000000000003b98 V typeinfo for Derived 0000000000003b28 V typeinfo for char [5] U typeinfo for int@@CXXABI_1.3 0000000000003bd0 V typeinfo for Base* U typeinfo for char*@@CXXABI_1.3 U typeinfo for char const*@@CXXABI_1.3 0000000000002012 V typeinfo name for VB1 000000000000201d V typeinfo name for VB2 0000000000002017 V typeinfo name for Base 0000000000002009 V typeinfo name for Derived 0000000000002004 V typeinfo name for char [5] 0000000000002022 V typeinfo name for Base* So, you're correct, Clang hasn't included the typeinfo for the base types. Except, it sort of has included it, it's just not compiled into the binary. So, I think, where the test does this: foreach simple_var {i cp ccp ca b} { We should actually do something like: set var {ca b} if {$started || ![test_compiler_info clang-*-* c++]} { # Clang doesn't place type information for the base types in # the executable, and relies on this being linked in from the # standard library. As a result, type information for these # variables is only available once the inferior is started. lappend var i cp ccp } foreach simple_var $var { What do you think? Thanks, Andrew > --- > gdb/testsuite/gdb.cp/typeid.exp | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/gdb/testsuite/gdb.cp/typeid.exp b/gdb/testsuite/gdb.cp/typeid.exp > index 6411217191a..d110b3e7695 100644 > --- a/gdb/testsuite/gdb.cp/typeid.exp > +++ b/gdb/testsuite/gdb.cp/typeid.exp > @@ -23,6 +23,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { > return -1 > } > > +if {[test_compiler_info clang-*-*]} { > + untested "clang does not add debuginfo for standard libraries" > + return > +} > + > proc do_typeid_tests {started} { > global hex > > -- > 2.37.3