| Message ID | 20251229151518.475440-1-christina.schimpe@intel.com |
|---|---|
| Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id F24D94BA2E1D for <patchwork@sourceware.org>; Mon, 29 Dec 2025 15:16:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F24D94BA2E1D Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=aqom5mXd X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by sourceware.org (Postfix) with ESMTPS id 4F5204BA2E07 for <gdb-patches@sourceware.org>; Mon, 29 Dec 2025 15:16:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F5204BA2E07 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4F5204BA2E07 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767021363; cv=none; b=QBn5qnplUgTT/eUlsKmABEjjeXQdzRx2E8k1Y+gmGOnPq0B0lnM4Bw5H9gbrS/ETcdj3h8vcTm53678Gj3tSH8Eqeu1UtVWI8dHSMBi3sBnVKuRxZyOEmVf2U7CuTaBZJjenb2siqioYaSrwU0ChF4g9LiEtgG1JSt+9I7aZJew= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767021363; c=relaxed/simple; bh=U5aggwHqATjK7zG+GFKVBc44yYUXv1VFBjgP9AKYiLk=; h=DKIM-Signature:MIME-Version:From:To:Subject:Date:Message-Id: MIME-Version; b=jNdkzfJpLEhY/XXayps+ojJA6rj+XGZ2jlZfmzjq6IalqfSd4ec6X1m0neyf0+sXCvt9k6Q9Pvc807ThcLrHhb1ToAamaNi4TCEAqtg6LT4A4Mvhi+hnyAuNWKyMTNIQ87a4Sm7CzwrrRoLOfCp2By4V+z21myyvZSZxYqqJHrE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F5204BA2E07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1767021363; x=1798557363; h=from:to:subject:date:message-id; bh=U5aggwHqATjK7zG+GFKVBc44yYUXv1VFBjgP9AKYiLk=; b=aqom5mXd/cclz2GcJHk23/n34F2M/u4FDdfgJ2UPOt1nu+2A+DMR2L17 M0gbhlEtzyv03jZBN1me+pFg1hWkPo+ItYdkHaliOI7jAkQKcXjU37/mj cVkn8nka9llsggZ57Ns+gSr7Kdgfugvyyp3GHWR5HsbZkwSKK7292j/la gaUK6t6sUuZAJvuj+tSLrNUjQh7mmOrQ95Krl/0VV3bLs/xOWetD37xhp tL5YUqBsen/dhIu2J7s0eV7QBwIJJyela7VPdE3Rm2aLYK5/wMqafI+aV TlEBxLC5mLgS7inWHarvnNr95NNjY9C1e0vyzWxyn4TjJo40NshcjH7Wr w==; X-CSE-ConnectionGUID: k6u0mXjuRguGSwhFC1+KgQ== X-CSE-MsgGUID: fMMLYHLORoGMdJLoh6Fhtg== X-IronPort-AV: E=McAfee;i="6800,10657,11656"; a="86054013" X-IronPort-AV: E=Sophos;i="6.21,186,1763452800"; d="scan'208";a="86054013" Content-Type: multipart/mixed; boundary="===============3969067827235972733==" MIME-Version: 1.0 Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2025 07:16:02 -0800 X-CSE-ConnectionGUID: 22RI8NouQ3+Q6MNqsJb3FQ== X-CSE-MsgGUID: PLKHhbYwRDy6NiY0XnlO5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,186,1763452800"; d="scan'208";a="205976283" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2025 07:16:02 -0800 From: Christina Schimpe <christina.schimpe@intel.com> To: gdb-patches@sourceware.org Subject: [PATCH 0/5] Template type parameter resolution Date: Mon, 29 Dec 2025 15:15:13 +0000 Message-Id: <20251229151518.475440-1-christina.schimpe@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_NONE, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
Template type parameter resolution
|
|
Message
Schimpe, Christina
Dec. 29, 2025, 3:15 p.m. UTC
Hi all, The DWARF Version 5 Debugging Format Standard describes the following for a template type parameter: "A template type parameter is represented by a debugging information entry with the tag DW_TAG_template_type_parameter." This has already been described for GDB: https://sourceware.org/bugzilla/show_bug.cgi?id=20540 and for GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57006 This series teaches GDB to resolve template types correctly when the DWARF format described above is available. It also improves the printing of function templates and templated class/struct members. This new DWARF format was previously proposed for upstreaming to LLVM under a switch "-Xclang -fdebug-template-parameter-as-type", but upstream rejected the switch and asked for a consumer. As a result, we can expect upstream Clang to support the feature without the switch once this DWARF format is supported by debuggers such as GDB and LLDB. This is the PR that has since been closed, mainly due to missing debugger support: https://github.com/llvm/llvm-project/pull/127654 I am looking forward to your feedback! Christina Christina Schimpe (5): gdb: Update comment of c_type_print_template_args. gdb: Support new DWARF for template type parameters. gdb: Enable correct template type resolution. gdb: Print target type and name of template members. gdb: Print template arguments of function templates. gdb/c-lang.c | 8 + gdb/c-lang.h | 20 + gdb/c-typeprint.c | 96 +++- gdb/c-valprint.c | 7 + gdb/cp-valprint.c | 6 + gdb/dwarf2/read.c | 79 ++- gdb/gdbtypes.c | 11 +- gdb/gdbtypes.h | 8 + gdb/guile/lib/gdb.scm | 1 + gdb/testsuite/gdb.cp/cp-relocate.exp | 4 +- gdb/testsuite/gdb.cp/cpexprs.exp.tcl | 46 +- .../gdb.cp/template-type-parameters.cc | 103 ++++ .../gdb.cp/template-type-parameters.exp | 204 ++++++++ .../gdb.dwarf2/self-referential-templates.exp | 117 +++++ .../template-specification-full-name.exp | 3 +- .../gdb.dwarf2/template-type-resolution.cc | 42 ++ .../gdb.dwarf2/template-type-resolution.exp | 467 ++++++++++++++++++ gdb/type-codes.def | 3 + gdb/typeprint.c | 9 +- gdb/typeprint.h | 9 +- gdb/valprint.c | 11 + 21 files changed, 1202 insertions(+), 52 deletions(-) create mode 100644 gdb/testsuite/gdb.cp/template-type-parameters.cc create mode 100644 gdb/testsuite/gdb.cp/template-type-parameters.exp create mode 100644 gdb/testsuite/gdb.dwarf2/self-referential-templates.exp create mode 100644 gdb/testsuite/gdb.dwarf2/template-type-resolution.cc create mode 100644 gdb/testsuite/gdb.dwarf2/template-type-resolution.exp