From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77045 invoked by alias); 17 Feb 2018 02:07:29 -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 76859 invoked by uid 89); 17 Feb 2018 02:07:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 17 Feb 2018 02:07:27 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w1H27Kxh008912 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 16 Feb 2018 21:07:25 -0500 Received: by simark.ca (Postfix, from userid 112) id 6EA161E76C; Fri, 16 Feb 2018 21:07:20 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id BBDA21E093; Fri, 16 Feb 2018 21:07:19 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 17 Feb 2018 02:07:00 -0000 From: Simon Marchi To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 03/10] Remove regcache_save and regcache_cpy In-Reply-To: <1517999572-14987-4-git-send-email-yao.qi@linaro.org> References: <1517999572-14987-1-git-send-email-yao.qi@linaro.org> <1517999572-14987-4-git-send-email-yao.qi@linaro.org> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.4 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 17 Feb 2018 02:07:20 +0000 X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00225.txt.bz2 On 2018-02-07 05:32, Yao Qi wrote: > --- a/gdb/regcache.h > +++ b/gdb/regcache.h > @@ -198,20 +198,10 @@ extern struct type *register_type (struct > gdbarch *gdbarch, int regnum); > > extern int register_size (struct gdbarch *gdbarch, int regnum); > > - > -/* Save/restore a register cache. The set of registers saved / > - restored into the DST regcache determined by the save_reggroup / > - restore_reggroup respectively. COOKED_READ returns zero iff the > - register's value can't be returned. */ > - > typedef enum register_status (regcache_cooked_read_ftype) (void *src, > int regnum, > gdb_byte *buf); > > -extern void regcache_save (struct regcache *dst, > - regcache_cooked_read_ftype *cooked_read, > - void *cooked_read_context); > - > enum regcache_dump_what > { > regcache_dump_none, regcache_dump_raw, > @@ -317,7 +307,14 @@ public: > return m_aspace; > } > > +/* Save/restore a register cache. The set of registers saved / > + restored into the regcache determined by the save_reggroup / > + restore_reggroup respectively. COOKED_READ returns zero iff the > + register's value can't be returned. */ > void save (regcache_cooked_read_ftype *cooked_read, void *src); > + /* Writes to regcache will go through to the target. SRC is a > + read-only register cache. */ > + void restore (struct regcache *src); Nit: add an empty line after the declaration of save. Also, would it be possible to improve the comment of save? I read them multiple times, and I still haven't figured out what the function does exactly. It saves the content of this regcache in another regcache? Or it saves another regcache in this regcache? How are the parameters used exactly? Simon