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 1ACF83858D1E for ; Thu, 10 Nov 2022 15:29:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1ACF83858D1E 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=1668094187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f8S7CTmZW52UYCeJYqeI8sXVynDZzCmNXV2vfC+2KqQ=; b=KXiR5KGl73hIZdxn1sDQjERX3h3mv6ym+oXY//+qq9IVTwV7wEdHB7XCrajTyETaI4cxfy OtQ/bASj13Zph/VQEX/MOQANUXPLn8PVX9aisRKOwPioIHsP4v9UX/2SU8WUWNMxB5xEL8 e6H0c1IEYNHgxkUQbq9KfehU2/j0ovU= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-627-15xIUab1MNqv2ys58irPtA-1; Thu, 10 Nov 2022 10:29:46 -0500 X-MC-Unique: 15xIUab1MNqv2ys58irPtA-1 Received: by mail-qt1-f199.google.com with SMTP id n12-20020ac85a0c000000b003a5849497f9so1587488qta.20 for ; Thu, 10 Nov 2022 07:29:46 -0800 (PST) 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:message-id:reply-to; bh=f8S7CTmZW52UYCeJYqeI8sXVynDZzCmNXV2vfC+2KqQ=; b=qmWkjr34HJyLmkHIqvrXg09nH2P/3lxx8ztdEWOkPV27qIIDFjoAZ8XwGqAbcZu7FR pm5/mTh02JxC7yynWmrjc07rcPWXd3U1zKkYrgpQm4wjMcgJa9dY/mrOYQDBYuulKnAU kUTijUfXF2BXj7XR2iuqpfZ/b5oFsbdYT3tUOohwHuTR1LxYtsxiMGfR22T2rBDNoWOK pnkEG4vMW1BFkeqhYXI009g5j90odk2i8ZgaBivVqyosRQICLbYvQlfw3MXHAdpVIfdJ 3y9AspJi5wmsppSAuogJaVukDgUUl1YXXL2cgqOtrmtarfiktq85XeA8oofMK8wZxGG4 hJPg== X-Gm-Message-State: ANoB5plCiodchlWMOM6GVdM60hJmLq0oz206Ny0MNhJS0IG89acV7DUi tc+vfmgZ36Z4beNSrN06onOlFdym8/O/0fyB7uKaDg/hYE/BZ7r7o8G3KzSuOiMq/3ptoewy4N/ 8L+goIFfgfEuLCMAGnqynTg== X-Received: by 2002:a05:622a:60d:b0:3a5:82d4:e145 with SMTP id z13-20020a05622a060d00b003a582d4e145mr18946482qta.368.1668094185618; Thu, 10 Nov 2022 07:29:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7WEJZSb+eTRnshP/x8swQ2aWCaOuWh6pq+Z7S0CQbDO9CDOwAblRAUjaL+Uv71NJIn/tjFWw== X-Received: by 2002:a05:622a:60d:b0:3a5:82d4:e145 with SMTP id z13-20020a05622a060d00b003a582d4e145mr18946471qta.368.1668094185372; Thu, 10 Nov 2022 07:29:45 -0800 (PST) Received: from [10.202.9.92] (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id bn5-20020a05620a2ac500b006eee3a09ff3sm12735273qkb.69.2022.11.10.07.29.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Nov 2022 07:29:44 -0800 (PST) Message-ID: <5eb453d2-5583-eec2-3aa2-ea0880894a71@redhat.com> Date: Thu, 10 Nov 2022 16:29:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v2 2/2] gdb/c++: Improve error messages in overload resolution To: Simon Marchi , gdb-patches@sourceware.org References: <20221104154744.418906-1-blarsen@redhat.com> <20221104154744.418906-3-blarsen@redhat.com> <860e668a-75b0-3a6a-26e1-5fe11f87ce53@simark.ca> From: Bruno Larsen In-Reply-To: <860e668a-75b0-3a6a-26e1-5fe11f87ce53@simark.ca> 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=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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: On 10/11/2022 16:19, Simon Marchi wrote: > > On 11/4/22 11:47, Bruno Larsen via Gdb-patches wrote: >> When resolving overloaded functions, GDB relies on knowing relationships >> between types, i.e. if a type inherits from another. However, some >> compilers may not add complete information for given types as a way to >> reduce unnecessary debug information. In these cases, GDB would just say >> that it couldn't resolve the method or function, with no extra >> information. >> >> The problem is that sometimes the user may not know that the type >> information is incomplete, and may just assume that there is a bug in >> GDB. To improve the user experience, we attempt to detect if the >> overload match failed because of an incomplete type, and warn the user >> of this. >> >> This commit also adds a testcase confirming that the message is only >> triggered in the correct scenario. This test was not developed as an >> expansion of gdb.cp/overload.cc because it needed the dwarf assembler, >> and porting all of overload.cc seemed unnecessary. > I get some new failures starting from this patch (tested both on Ubuntu > 22.04 and a fairly recent Arch Linux): > > FAIL: gdb.cp/converts.exp: p foo3_1 (0, 1) > FAIL: gdb.cp/converts.exp: p foo1_7(ta) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo1_type_check (123) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo2_type_check (0, 1) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo2_type_check (1, 0) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo2_type_check (1, 1) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (0, 0, 1) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (0, 1, 0) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (1, 0, 0) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (0, 1, 1) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (1, 1, 0) > FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (1, 1, 1) /me facepalms I'm very sorry, got tunnel visioned in fixing the issue, forgot to run the rest of the tests. Will fix all of these. > FAIL: gdb.cp/enum-class.exp: print overload2(77) > FAIL: gdb.cp/enum-class.exp: print overload3(E1::THERE) > FAIL: gdb.cp/koenig.exp: p foo(ix) > FAIL: gdb.cp/koenig.exp: p foo (p_union) > FAIL: gdb.cp/local-static.exp: c++: print S::method() > FAIL: gdb.cp/local-static.exp: c++: print S::inline_method() > FAIL: gdb.cp/local-static.exp: c++: print S2::method() > FAIL: gdb.cp/local-static.exp: c++: print S2::inline_method() > FAIL: gdb.cp/operator.exp: namespace alias > FAIL: gdb.cp/operator.exp: imported declaration > FAIL: gdb.cp/pr12028.exp: p D::foo(b) > FAIL: gdb.cp/rvalue-ref-overload.exp: passing lvalue arg to rvalue parameter However, I'm not getting these fails... is gcc only emitting delaration DIEs for these tests, or is it something else? -- Cheers, Bruno > Simon