From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119325 invoked by alias); 14 Feb 2020 19:47:00 -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 119307 invoked by uid 89); 14 Feb 2020 19:47:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Feb 2020 19:46:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581709617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C36HU/HxpqA32P9OEDqOKKoR5kxCcmWPK1XsW3sc1ig=; b=Acxxl5S05g8CST/JxCAj/e5t0vAVcDHKfFu4AYAaHyRWm8+q3R/OY1zJ6Pewd9zDx3ln+m wzFTpDbt6LnFqHdZOnOaARCHpRu0h3Hd88RZWsCEmNzGnM0QXAdySJGPMgmcS6k6GmT+5Z tcPES9Zu75pigIXAuilF11aYUwPuPUQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-113-vG0g5DtkOzSKDlRPkVi_pQ-1; Fri, 14 Feb 2020 14:46:51 -0500 Received: by mail-wm1-f70.google.com with SMTP id b8so1191467wmj.0 for ; Fri, 14 Feb 2020 11:46:50 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f909:7b00:56ee:75ff:fe8d:232b? ([2001:8a0:f909:7b00:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id t12sm8043264wrq.97.2020.02.14.11.46.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Feb 2020 11:46:49 -0800 (PST) Subject: Re: [PATCH 2/2] gdb: make gdbarch_displaced_step_copy_insn return an std::unique_ptr To: Simon Marchi , gdb-patches@sourceware.org References: <20200122151410.30012-1-simon.marchi@efficios.com> <20200122151410.30012-2-simon.marchi@efficios.com> From: Pedro Alves Message-ID: Date: Fri, 14 Feb 2020 19:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200122151410.30012-2-simon.marchi@efficios.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2020-02/txt/msg00578.txt.bz2 On 1/22/20 3:14 PM, Simon Marchi wrote: > This callback dynamically allocates a specialized displaced_step_closure, and > gives the ownership of the object to its caller. So I think it would make > sense for the callback to return an std::unique_ptr, this is what this patch > implements. > > * gdbarch.sh (displaced_step_copy_insn): Change return type to an > std::unique_ptr. > * gdbarch.c: Re-generate. > * gdbarch.h: Re-generate. > * infrun.c (displaced_step_prepare_throw): Adjust to std::unique_ptr > change. > * aarch64-tdep.c (aarch64_displaced_step_copy_insn): Change return > type to std::unique_ptr. > * aarch64-tdep.h (aarch64_displaced_step_copy_insn): Likewise. > * amd64-tdep.c (amd64_displaced_step_copy_insn): Likewise. > * amd64-tdep.h (amd64_displaced_step_copy_insn): Likewise. > * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. > * i386-linux-tdep.c (i386_linux_displaced_step_copy_insn): Likewise. > * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. > * i386-tdep.h (i386_displaced_step_copy_insn): Likewise. > * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. > * s390-tdep.c (s390_displaced_step_copy_insn): Likewise. Looks fine. Thanks, Pedro Alves