From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57784 invoked by alias); 19 Jun 2018 14:52:43 -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 57752 invoked by uid 89); 19 Jun 2018 14:52:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Jun 2018 14:52:39 +0000 Received: by simark.ca (Postfix, from userid 112) id 4DACC1EF29; Tue, 19 Jun 2018 10:52:35 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 7650B1E529; Tue, 19 Jun 2018 10:52:33 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 19 Jun 2018 14:52:00 -0000 From: Simon Marchi To: Alan Hayward Cc: GDB Patches , nd Subject: Re: [PATCH] Support large registers in regcache transfer_regset In-Reply-To: <85CCB6E0-63F0-4298-B328-D43D3207A91E@arm.com> References: <20180612080356.33157-1-alan.hayward@arm.com> <6bba6aa4-c350-e5fb-3913-823eccae60ef@simark.ca> <85CCB6E0-63F0-4298-B328-D43D3207A91E@arm.com> Message-ID: X-Sender: simark@simark.ca User-Agent: Roundcube Webmail/1.3.6 X-SW-Source: 2018-06/txt/msg00477.txt.bz2 On 2018-06-19 07:27, Alan Hayward wrote: >>> +/* See regcache.h. */ >>> + >>> +void >>> +reg_buffer::raw_collect_part (int regnum, int offset, int len, void >>> *in) const >>> +{ >>> + struct gdbarch *gdbarch = arch (); >>> + gdb_byte *reg = (gdb_byte *) alloca (register_size (gdbarch, >>> regnum)); >>> + >>> + gdb_assert (in != NULL); >>> + gdb_assert (offset >= 0 && offset <= >>> m_descr->sizeof_register[regnum]); >>> + gdb_assert (len >= 0 && offset + len <= >>> m_descr->sizeof_register[regnum]); >> >> The "&& offset <= m_descr->sizeof_register[regnum]" is redundant, >> given the >> following line. Other than mimicking raw_read_part, is there a reason >> why >> these are signed integers? Having them unsigned would avoid having to >> assert >> they are >= 0. > > Looking at regcache, int is used for regnum throughout. I’d rather not > have a > mismatch, and wouldn’t want to update everything else either (at least > not > in this patch). In addition, if this code is going to now call down to > raw_collect/raw_supply, they should match. Sorry, I was talking about len and offset, not regnum. Simon