From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30496 invoked by alias); 19 Jul 2014 09:17:48 -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 30458 invoked by uid 89); 19 Jul 2014 09:17:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oa0-f48.google.com Received: from mail-oa0-f48.google.com (HELO mail-oa0-f48.google.com) (209.85.219.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 19 Jul 2014 09:17:45 +0000 Received: by mail-oa0-f48.google.com with SMTP id m1so4772088oag.7 for ; Sat, 19 Jul 2014 02:17:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=ZzHW/uqnfmDXlcXRCGCk8C7KFK1bK6IGCLGTpeh/2OA=; b=dFEcDwK8oMCPYNDJaIiB6lamYgxwanTpO3U59fbKeyS9xmtXU7Qm3z8ApTte4lfbcd ZuwUqcWWovCN+npDBAjxFNT9Vo1JduEaq51yfAxW10pCVK1wEzXsperKuenYWOJe4MQc oHvRYDajQKPo+31LbiNrJi5hujK6Vvjhxi76CNPZ3kVBllbPXi1MOyJ46pZnmmxpYwfc qxLhwsVCX61cgEm7LtdQcNO2r4lk4v5zwkHzkmeB9slnACqiiakCgTST1WSxayLhA8gm VSVLMFqz8rV8ppn0w6EIjDkc1hsIrYZukmTdhE/pMb5/TXnjcd2w0sESc2a6sAcTcQ+a cnbQ== X-Gm-Message-State: ALoCoQlNgBqB4Kt9DMr9Nv7RX1bE9w3rU3dB95Kl38k+YcVJfc3V1sAHOLaWQUi47i+HqV/nlHUZ X-Received: by 10.60.46.167 with SMTP id w7mr11235481oem.50.1405761463786; Sat, 19 Jul 2014 02:17:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.224.196 with HTTP; Sat, 19 Jul 2014 02:17:23 -0700 (PDT) In-Reply-To: <87ha2pfy3m.fsf@br87z6lw.de.ibm.com> References: <1403714949-28133-1-git-send-email-arnez@linux.vnet.ibm.com> <1403714949-28133-3-git-send-email-arnez@linux.vnet.ibm.com> <87lhs4f5ng.fsf@br87z6lw.de.ibm.com> <87ha2pfy3m.fsf@br87z6lw.de.ibm.com> From: Omair Javaid Date: Sat, 19 Jul 2014 13:10:00 -0000 Message-ID: Subject: Re: [PATCH v2 02/13] regcache: Add functions suitable for regset_supply/collect. To: Andreas Arnez Cc: "gdb-patches@sourceware.org" , Yao Qi , Mark Kettenis Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00519.txt.bz2 On 10 July 2014 12:54, Andreas Arnez wrote: > On Tue, Jul 08 2014, Omair Javaid wrote: > >> I think you are right its better off if we leave the single register >> variants to target specific *-tdep where they can be retrieved using >> regcache_raw_ supply/collect functions. All other options to get >> around the loops wont be trivial. > > Hm, I'd actually prefer if the new functions could be used for any > case where registers are supplied to the regcache from a buffer, or > collected from the regcache to a buffer. > > Which variants do you mean? Do you have examples where they are used? > Here's one implementation I saw for PPC, this is done for rs6000-tdep.c ppc_supply_reg (struct regcache *regcache, int regnum, const gdb_byte *regs, size_t offset, int regsize) { if (regnum != -1 && offset != -1) { if (regsize > 4) { struct gdbarch *gdbarch = get_regcache_arch (regcache); int gdb_regsize = register_size (gdbarch, regnum); if (gdb_regsize < regsize && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) offset += regsize - gdb_regsize; } regcache_raw_supply (regcache, regnum, regs + offset); } } But I agree that its better the way its been done already.