From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id 5DF943858D33 for ; Fri, 6 Jan 2023 17:37:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DF943858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-x22f.google.com with SMTP id i127so1610532oif.8 for ; Fri, 06 Jan 2023 09:37:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=dldI4Q117+21fARb4n90nFu2OleeFYR2ICm1i4GRd4M=; b=feF44n4TGSoBAlgo9d7tI4jzl9HnUnk/MhS1l3Viiq+FmxAT3TXt7mH9lOc2C+3CQ7 7Q8ic7kY55kbmv4T9P2X6cTY3yiDd4stxTFpzgFVT/DaI2YJ7KS+f+Rr1n32dQsMEgyJ TsAGf58Ce865wLo1KdwURSYq38hKtsoJ3OBf17DRR/4wNClaE01F7eLs7OV7mPIttadE gW4Jv46hs493dhu3Xxj51o8ZHTNvKwiI+ig2HEO3HTCyZkG5Vze4yL4gs2RLb757700w AisP+nfDrWECNdABAthN/AH/9X2jjZ3SsLqa8Qkeo8OeJUc1yk2JwFDok2OIIypKqZo/ 4fyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dldI4Q117+21fARb4n90nFu2OleeFYR2ICm1i4GRd4M=; b=tzlY19PVNEbFhW/SXu2sATyQKGLqyfjONawzFEAOh+U8Pdg8HcUvxj1bPlit3UV6tM 4zMXTtQN5om1Crm5JeqWD9a7ew1k6/t8CR+PdoE7iKmLl6qhkotCNnYs96JOZz/Lca9h i6n/1Y3jq/6H/rN3hpEI4q+cWk3PiLyN1U3JZQUDy8FJcko2kmGxA/Qjl+yp00FGPEZr e9tY8fyIi63Xuq88DOEgqTASPnjHNc0xxaVTb9nSQcXREhGotD5l4y8CGPRBjg+oqRco zwa/8KMpgRdFEOslwLhAfQfDNkUC5GwbnoM0VWBsSmJ04igFNFfE8WM/HLjJlEoYQoFF K17Q== X-Gm-Message-State: AFqh2krN15ykwe5knYM3Xxj7GW8CV01aJ+OVIWcpJGdFGhqDvCKtteat dqi2TprAxy+kF1cOEpRhthQZW79Psv/ujPJsTpNV4lMO X-Google-Smtp-Source: AMrXdXv2UPNSGfM88NphZ44P1LRXmurWtCjkwwOlHmgy1ikAoTOHDPa9Y8ASRoHD6esJzDrfMbxSxZrG4Ux5mfuzwJQ= X-Received: by 2002:a05:6808:1385:b0:363:b8c3:a76b with SMTP id c5-20020a056808138500b00363b8c3a76bmr1147705oiw.118.1673026673380; Fri, 06 Jan 2023 09:37:53 -0800 (PST) MIME-Version: 1.0 From: David Blaikie Date: Fri, 6 Jan 2023 09:37:41 -0800 Message-ID: Subject: Decl/def matching with templates without template parameters in the DW_AT_name To: gdb Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: I've been working on reducing debug info size, especially for expression-template heavy code like in Tensorflow and Eigen. To that end, I've implemented the flag -gsimple-template-names in Clang that simplifies the DW_AT_name for templates by omitting template parameters (eg: "vector" instead of "vector>") when the DW_TAG_template_*_parameters contain sufficient information to reconstruct the original name. This generally seems to work in GDB - that looks intentional (perhaps because someone else implemented this feature elsewhere, or just for canonicalization reasons (the full string with template parameters might have different whitespace, parentheses, other formatting)), it seems unlikely that GDB would accidentally be able to connect two "vector" declarations up to the right "vector" definitions based on the template parameters without intentional code to support this scenario. But one place I found a problem was in pretty printers. I have situations where a type declaration isn't resolved to a definition when working within a pretty printer (resulting in the pretty printer being unable to find member variables in the object/of that type) - but if I print out the variable/member it works correctly - or if I "list" the source of the file where the definition of the type is, then the pretty printer works correctly. Does this ring a bell for anyone/sound like something sufficient to file a bug, or would I need to dig in further to create an isolated reproduction to help communicate the issue I'm seeing?