From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66239 invoked by alias); 16 Dec 2016 11:32:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 66214 invoked by uid 89); 16 Dec 2016 11:32:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*i:sk:1481883, H*MI:sk:1481883, H*f:sk:1481883, 2016-12-16 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; Fri, 16 Dec 2016 11:32:44 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0DF344D68C; Fri, 16 Dec 2016 11:32:43 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBGBWf9t008244; Fri, 16 Dec 2016 06:32:42 -0500 Subject: Re: [PATCH obv] Darwin: Fix gdb compilation. To: Bernhard Heckel , gdb-patches@sourceware.org References: <1481883230-17279-1-git-send-email-bernhard.heckel@intel.com> From: Pedro Alves Message-ID: Date: Fri, 16 Dec 2016 11:32:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1481883230-17279-1-git-send-email-bernhard.heckel@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-12/txt/msg00318.txt.bz2 On 12/16/2016 10:13 AM, Bernhard Heckel wrote: > Due to changes introduced by > commit 4d01a485d29732b19743e8b138897f3509e071b0 > ('struct expression *' -> gdb::unique_xmalloc_ptr) > compilation is broken on Darwin. > > ../gdb/darwin-nat-info.c:733:8: error: assigning to 'struct expression *' > from incompatible type > 'expression_up' (aka 'std::__1::unique_ptr >') > expr = parse_expression (exp); > > 2016-12-16 Bernhard Heckel > > gdb/Changelog: > * darwin-nat-info.c (info_mach_region_command): Use expression_up. OK, please push if you haven't yet. > static void > info_mach_region_command (char *exp, int from_tty) > { > - struct expression *expr; > struct value *val; > mach_vm_address_t address; > struct inferior *inf; > > - expr = parse_expression (exp); > - val = evaluate_expression (expr); > + expression_up expr = parse_expression (exp); > + val = evaluate_expression (expr.get ()); > if (TYPE_CODE (value_type (val)) == TYPE_CODE_REF) > { > val = value_ind (val); > Note this fixes a leak as well -- nothing was deleting exp before. Thanks, Pedro Alves