From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 3F37F3858425; Mon, 14 Nov 2022 17:57:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3F37F3858425 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-wm1-x333.google.com with SMTP id o30so8027427wms.2; Mon, 14 Nov 2022 09:57:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/k1zrSEMZkkDuKEHZTdL7x1+eLpGw1MaqRI0MFyl3cY=; b=ZeB7dstgRWULkp4lh/wSKm7rwb6l4K4049Sxzz0xky0GExg5Lj+AHf0JnJ7J97uZsJ HVDjbnR8kWBM+caqYrg8X/gViMXay+IqCUzfKGpxqgb4hyHpC80chRYBiDpWXggckolV iOQmfR1vMwKrNXRnuojpcQSIuO2w107Vrao5BcYikhn9i6bJSWNc4ihduRqVkI4XzecJ mt3X1GWE/dHeNOTe2FAKCpm29frM6p7q8zP07Y9+9ZqzALHLjqOMZVOU+tQd59sCVbux JaavxXmgd8saQu8kLq+2X7AcIedXAlB/3/1eQlvF8+AsxrUGKotDE5CuMP9w79B7X7Th MsGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/k1zrSEMZkkDuKEHZTdL7x1+eLpGw1MaqRI0MFyl3cY=; b=UPzVQ9NVyla29y4bL8CV4zUx/j3Gl/svS9duHjKyma79WpYBKS3jRKqGVvjUhFkICn bt2A5+Klwst/8ByeDLc1XXOid9+iNt93rFScvoon7lWKlItDVo+PfsMFR2nCywhLkYt6 c/klBWOG6zH+DKEsdOD43xsTnZiaq/+z17ii1BFbRsxT8WGX5SLgQ0xNMuYUtVBsRRqY rJqjkv5BWmh/dsi/yE2iJCSLwGatIFANDKDqtm82Imf8pVhzv4DQq201QBTlRGy48nIa 6dUXJGSD7I8iWHM4X2WdsVffSdI0qmfgXmih+5X69MHoOY7Be2O/LmLhPl/brPncuRBd NzGQ== X-Gm-Message-State: ANoB5pko68cylbBjG4IpE5eT2GZ4uhjtyTMGQ27hsg16Y3BR8URE0M1y O7vI9B37S7e/E8G/N1C6kz8cmAkJwkc= X-Google-Smtp-Source: AA0mqf4792+mNHw7z5TYkkaQZvXx38HCWWVVae3yRhhnAQZj9NgQb2plm9k+Bj8EdX9U8XnHkJpC3Q== X-Received: by 2002:a05:600c:1d27:b0:3cf:b102:c0e8 with SMTP id l39-20020a05600c1d2700b003cfb102c0e8mr8845203wms.169.1668448673599; Mon, 14 Nov 2022 09:57:53 -0800 (PST) Received: from [10.1.3.59] ([109.190.253.14]) by smtp.googlemail.com with ESMTPSA id u7-20020adff887000000b0023538fb27c1sm10165140wrp.85.2022.11.14.09.57.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Nov 2022 09:57:53 -0800 (PST) Message-ID: <6015c470-fa6e-1cbe-db7b-27c2a1663d68@gmail.com> Date: Mon, 14 Nov 2022 18:57:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] Fix gdb FilteringTypePrinter (again) Content-Language: fr From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= To: "libstdc++@gcc.gnu.org" Cc: gcc-patches References: <4d1dc3d4-e945-d283-964a-4dab3b3cb33e@gmail.com> In-Reply-To: <4d1dc3d4-e945-d283-964a-4dab3b3cb33e@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Any chance to review this one ? On 06/10/22 19:38, François Dumont wrote: > Hi > > Looks like the previous patch was not enough. When using it in the > context of a build without dual abi and versioned namespace I started > having failures again. I guess I hadn't rebuild everything properly. > > This time I think the problem was in those lines: > >             if self.type_obj == type_obj: >                 return strip_inline_namespaces(self.name) > > I've added a call to gdb.types.get_basic_type so that we do not > compare a type with its typedef. > > Thanks for the pointer to the doc ! > > Doing so I eventually use your code Jonathan to make > FilteringTypeFilter more specific to a given instantiation. > >     libstdc++: Fix gdb FilteringTypePrinter > >     Once we found a matching FilteringTypePrinter instance we look for > the associated >     typedef and check that the returned Python Type is equal to the > Type to recognize. >     But gdb Python Type includes properties to distinguish a typedef > from the actual >     type. So use gdb.types.get_basic_type to check if we are indeed on > the same type. > >     Additionnaly enhance FilteringTypePrinter matching mecanism by > introducing targ1 that, >     if not None, will be used as the 1st template parameter. > >     libstdc++-v3/ChangeLog: > >             * python/libstdcxx/v6/printers.py (FilteringTypePrinter): > Rename 'match' field >             'template'. Add self.targ1 to specify the first template > parameter of the instantiation >             to match. >             (add_one_type_printer): Add targ1 optional parameter, > default to None. >             Use gdb.types.get_basic_type to compare the type to > recognize and the type >             returned from the typedef lookup. >             (register_type_printers): Adapt calls to > add_one_type_printers. > > Tested under Linux x86_64 normal, version namespace with or without > dual abi. > > François >