From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qHBZEGpsyGM5vhkAWB0awg (envelope-from ) for ; Wed, 18 Jan 2023 17:02:18 -0500 Received: by simark.ca (Postfix, from userid 112) id 40F061E128; Wed, 18 Jan 2023 17:02:18 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=OB19LWnR; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 000511E112 for ; Wed, 18 Jan 2023 17:02:17 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2EAC9385828D for ; Wed, 18 Jan 2023 22:02:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EAC9385828D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674079337; bh=xk4y0EN+JlojZsaoAvcS5w9k9HoFmUq09lteOD2amrk=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=OB19LWnRCWxqk/SrqhAYcwJb5nRqa6y/lk54nL25Sls5kq6gT7OvVN6rRtSVt/hFA xyKGqacVaIqR4sizf6aHv2Ed8djVM680HHeU3jqNCugTNA2sFZJIuTmyPrndWtdW5O Y++9m3PbXbIoQCfgN8rCkJlAlB2c8X0OWkjihJPg= Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 441D93858C52 for ; Wed, 18 Jan 2023 22:01:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 441D93858C52 Received: by mail-oi1-x232.google.com with SMTP id s124so207799oif.1 for ; Wed, 18 Jan 2023 14:01:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xk4y0EN+JlojZsaoAvcS5w9k9HoFmUq09lteOD2amrk=; b=zN2wmpf4kP/l5BjdKzaCW3cG7fbLXhWZpaPuapzgSLfvB88NYDa1CBRh6lboEZAlnp 4szLZXL9o0bMM2M2A984bhn1fhFfh7HfSFdFeNk5kaG1r9NdeCtOQVySCmdWbgqIjTXl lCebyKpJgyCJBne/bLSF3COr2J5QnGFYA1+pqICnk4JTDOw8+zC5eAXRJXN5mu2pgTOi 9QOanH3j4A5CKmIbSlo1fdrCW6oMdKaXIcUlR1JLRPKanluJQTT08Zv19mzqaSgbnSvM I311GGYNjBcBtOy2VpXjqgKb3NQJqLJdnRyvBZ3UAo0EFFx41/7d6sJedfn2qcmL+A6R MdYg== X-Gm-Message-State: AFqh2kqbE44tZ0Cxd8G0uO/+nquc8Z9VLWkukiTL/xsSwaeTzXq7AM1y n8n1xpLc7l9pUBeyi8UNSoWf7817mUnSzTGpbgh8eJJDIdE= X-Google-Smtp-Source: AMrXdXvI/n+/oO7T9hyxSuz2W3EExb4mBEZamKZKRqVzWVwFBAufCnEcIRISH2KtEo212dvFY7FWYexEqcRADgWpgFE= X-Received: by 2002:a05:6808:1513:b0:363:b8c3:a76b with SMTP id u19-20020a056808151300b00363b8c3a76bmr460300oiw.118.1674079307303; Wed, 18 Jan 2023 14:01:47 -0800 (PST) MIME-Version: 1.0 References: <525f9315-27f1-935a-4e5e-4a043b24eecf@simark.ca> In-Reply-To: <525f9315-27f1-935a-4e5e-4a043b24eecf@simark.ca> Date: Wed, 18 Jan 2023 14:01:35 -0800 Message-ID: Subject: Re: Decl/def matching with templates without template parameters in the DW_AT_name To: Simon Marchi Cc: gdb Content-Type: text/plain; charset="UTF-8" X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: David Blaikie via Gdb Reply-To: David Blaikie Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On Wed, Jan 11, 2023 at 5:46 PM Simon Marchi wrote: > Digging in the history leads me to: > > https://inbox.sourceware.org/gdb-patches/201007302017.41074.pedro@codesourcery.com/ > > So RVCT, the RealView compiler. I don't have access to that, > unfortunately. It seems obsolete, also. Oh, that's satisfying/interesting to know - figured /someone/ had done this before, judging by gdb's behavior. > If you end up merging this, it will be interesting to run the full GDB > testsuite against clang with that flag, it would cover a lot of things. Oh, it's already in Clang, under `-gsimple-template-names`, I think even Clang 15's functionality is well baked enough - I finished up the work about a year ago now. Here's a very small example: https://godbolt.org/z/r8zMf5qvr showing the shortened name in the .debug_info, and in the .debug_gdb_pubnames (which ends up in the index, which turns out was the bug I came across... filed here: https://sourceware.org/bugzilla/show_bug.cgi?id=30023 ) As I mentioned, though, there's a bunch of cases where Clang doesn't simplify names because they don't roundtrip well/DWARF is lossy/problematic in some way in the way it describes the template parameters. Some of the interesting (positive and negative/simplified and unsimplified) test cases I encountered were: https://github.com/llvm/llvm-project/blob/main/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp - this checks that I could easily rebuild the original name from llvm-dwarfdump. So, things like templates with lambda parameters aren't simplified because there isn't necessarily enough info to rebuild the name as clang generates them (also GCC generates those names differently - and those are probably harder to roundtrip, but more likely to be canonical/unique/unambiguous), operator overloads were not simplified because it was hard to tell if they were/weren't simplified with all the <> involved in some operator names even without template parameters - etc...