From patchwork Fri Nov 4 15:47:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 55264 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C7EE38582A3 for ; Fri, 4 Nov 2022 15:52:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C7EE38582A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667577157; bh=zFvTs3S4xkn9PtIaOlA6Sb/rEbubMp7VtYlzqUG28Xs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=wSkc/4jYdcYbC5K6qoQJuY2AlrDbCXL0vfxDblB3mP+0vjaRMoHlATPY3YdNeE3WT ED2XYvfxf2abs+UraXYIW6awv+rZekaKNrYfNJnOYmfvFyhnt0HkrPfhVMCM5F+aLP zdRRZey+XU7Iap9UZ0aUhKtWxD8pBZWAOvVG4mD0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 D5E81385843B for ; Fri, 4 Nov 2022 15:52:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D5E81385843B Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-dNia7_KLOIS8HIkvGpGKtw-1; Fri, 04 Nov 2022 11:52:07 -0400 X-MC-Unique: dNia7_KLOIS8HIkvGpGKtw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E25285A5A6 for ; Fri, 4 Nov 2022 15:52:07 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-145.brq.redhat.com [10.40.193.145]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88D64140EBF5; Fri, 4 Nov 2022 15:52:06 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH v2 0/2] Improve error messages with incomplete variables Date: Fri, 4 Nov 2022 16:47:43 +0100 Message-Id: <20221104154744.418906-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 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-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Currently, if a user attempts to call a C++ fuction by hand using an incomplete variable, GDB might be unable to find the correct overload, but the error message in this situation is not intuitive at all. This series attempts improve those messages with a hint. To create a reasonably reproducible test, I decided to use the DWARF assembler, but it needed some fixing to deal with C++ mangled names, so the first patch happened. Changes for v2: * Used Andrew's suggestion for patch 1 * Styling changes to code * Factored new code into a static function Bruno Larsen (2): gdb/testsuite: allowed for function_range to deal with mangled functions gdb/c++: Improve error messages in overload resolution .../gdb.cp/incomplete-type-overload.cc | 45 +++++ .../gdb.cp/incomplete-type-overload.exp | 183 ++++++++++++++++++ gdb/testsuite/lib/dwarf.exp | 2 +- gdb/valops.c | 53 ++++- 4 files changed, 278 insertions(+), 5 deletions(-) create mode 100644 gdb/testsuite/gdb.cp/incomplete-type-overload.cc create mode 100644 gdb/testsuite/gdb.cp/incomplete-type-overload.exp