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 D5E81385843B for ; Fri, 4 Nov 2022 15:52:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D5E81385843B 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=1667577128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zFvTs3S4xkn9PtIaOlA6Sb/rEbubMp7VtYlzqUG28Xs=; b=E2PS1ZqPrjAk/rus0S/A1XJJG4RzUskLOlYKGFa/ueyufryEr69xGJrHV8xJuB0b728rd1 ktEcnWsrEW0x/+l0UXYLrBCJpdGCUdMaTHeE2l76Am0BpsFJ2i9D6wO9ArQhxzdq60RMaU rLFtO63uj0xsmnRpi6GS9szxbJRx1sM= 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) From: Bruno Larsen To: gdb-patches@sourceware.org Cc: Bruno Larsen 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 List-Id: 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 -- 2.37.3