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 561C53858C55 for ; Thu, 13 Oct 2022 16:05:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 561C53858C55 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-651-krq3qfNcOmSni6-TJeaKew-1; Thu, 13 Oct 2022 12:05:11 -0400 X-MC-Unique: krq3qfNcOmSni6-TJeaKew-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 54185882830 for ; Thu, 13 Oct 2022 16:05:11 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.194.150]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 921CA40C2088; Thu, 13 Oct 2022 16:05:10 +0000 (UTC) From: Bruno Larsen To: gdb-patches@sourceware.org Subject: [PATCH 0/2] Improve error messages with incomplete variables Date: Thu, 13 Oct 2022 18:01:13 +0200 Message-Id: <20221013160114.4143323-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, 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-List-Received-Date: Thu, 13 Oct 2022 16:05:14 -0000 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. 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 | 12 ++ gdb/valops.c | 49 ++++- 4 files changed, 285 insertions(+), 4 deletions(-) create mode 100644 gdb/testsuite/gdb.cp/incomplete-type-overload.cc create mode 100644 gdb/testsuite/gdb.cp/incomplete-type-overload.exp -- 2.37.3