From patchwork Wed Sep 11 11:39:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1160927 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508839-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="p/g2veuJ"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46T0L71Vprz9sCJ for ; Wed, 11 Sep 2019 21:39:27 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=MqY30njJgYsTjDWG1VieRpivWv15YnGGfXKq3OiRXKwcs23PhzkZ2 v6x4llUNNXhdTFJGUm6R1OIdMBJISotkVbYJC1461jA00JC25DfbD1Xgbchk03mj vjcT6xaCey8cmYbfJZifDectAR+1rausn5EQCpSMGTOLvhYKn9byxg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=esRJeOix5DhLjJYTcVKwubvX+6w=; b=p/g2veuJV5srFSUEd/ex MY2iw5SjraC60R8ELR7BJQGkJY06SSUaWxuI74rPKqqJRLSMFnXR8Rm3X4ALOi5Z /xRhG4UdIPiTR5jl7cyeT+VaZIbYqGztOKR7FOLXoxOZ6zOmh7OciMVt2V+RcDSL ueURl6iXGu8gkNCVLGDkUrM= Received: (qmail 64928 invoked by alias); 11 Sep 2019 11:39:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 64911 invoked by uid 89); 11 Sep 2019 11:39:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1383 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Sep 2019 11:39:17 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0981A371AC; Wed, 11 Sep 2019 11:39:15 +0000 (UTC) Received: from localhost (unknown [10.33.36.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A6A919C77; Wed, 11 Sep 2019 11:39:15 +0000 (UTC) Date: Wed, 11 Sep 2019 12:39:14 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] Fix Xmethod for shared_ptr::use_count() Message-ID: <20190911113914.GA31206@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.12.1 (2019-06-15) This was reported in https://bugzilla.redhat.com/show_bug.cgi?id=1749578 * python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker.__call__): Fix syntax error. Tested x86_64-linux (although I can't get tests for the use_count() or unique() Xmethods to actually work ...) Committed to trunk. I'll backport it too. commit 0f5caaa9b5fedebc6117cae5f3bc57c5cb3448d8 Author: redi Date: Wed Sep 11 11:38:23 2019 +0000 Fix Xmethod for shared_ptr::use_count() This was reported in https://bugzilla.redhat.com/show_bug.cgi?id=1749578 * python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker.__call__): Fix syntax error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@275644 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/libstdc++-v3/python/libstdcxx/v6/xmethods.py b/libstdc++-v3/python/libstdcxx/v6/xmethods.py index 623cb80bc0e..a720a63fa1a 100644 --- a/libstdc++-v3/python/libstdcxx/v6/xmethods.py +++ b/libstdc++-v3/python/libstdcxx/v6/xmethods.py @@ -739,7 +739,7 @@ class SharedPtrUseCountWorker(gdb.xmethod.XMethodWorker): return gdb.lookup_type('long') def __call__(self, obj): - refcounts = ['_M_refcount']['_M_pi'] + refcounts = obj['_M_refcount']['_M_pi'] return refcounts['_M_use_count'] if refcounts else 0 class SharedPtrUniqueWorker(SharedPtrUseCountWorker):