From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4080 invoked by alias); 22 Nov 2016 09:28:57 -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 4042 invoked by uid 89); 22 Nov 2016 09:28:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=training, late X-HELO: mail-wm0-f65.google.com Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com) (74.125.82.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Nov 2016 09:28:54 +0000 Received: by mail-wm0-f65.google.com with SMTP id m203so2330081wma.3 for ; Tue, 22 Nov 2016 01:28:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=H2Ows70F8DtJ2VPPOIvBJDm9QRMgnMyNw8vw622KJUM=; b=KfdejUnErBUcovrxDfhbAIszYAgLDwCDCJWftb9lMm82nW9uj/ojq2Wv3n5rCFAROU GGNC5RI42oKY6WA0BK6YVlJk/LQgXRH044pNcLsH0kXqm16Er3CbHdJo84Hf3AuFL7z+ mg0U08mvORKzy9UUq+TcKn5C/YBsWI2EFnZMhIWMfbsEPvudPYldgiMgl5wiYQQaxCdE qxgvFCkcGh8OqbkGlR+PSClTY7ouWEYB9P0cFbyhImbvBWGWs2ayY7CAEROXuUZ4NSz0 mOK+xjs0xMRo9/gsR7Uc0oc6tVcNltcolNrnnojM1S5HFQbt8rOdcDNme9oOHEgDyx0T qAjA== X-Gm-Message-State: AKaTC02Hq2JwDVEUl6M4Kw6xnmEVXjEglABGnwZ90hZ9Ndeb70rF7E0u+qYTyyPW5UBblw== X-Received: by 10.194.47.203 with SMTP id f11mr13486852wjn.146.1479806932381; Tue, 22 Nov 2016 01:28:52 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id l74sm1910282wmg.2.2016.11.22.01.28.50 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 22 Nov 2016 01:28:51 -0800 (PST) Date: Tue, 22 Nov 2016 09:28:00 -0000 From: Yao Qi To: Luis Machado Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 01/13] New regcache_raw_get_signed Message-ID: <20161122092838.GC24810@E107787-LIN> References: <1479145370-11432-1-git-send-email-yao.qi@linaro.org> <1479145370-11432-2-git-send-email-yao.qi@linaro.org> <3ce80f3c-44f6-8ec6-01fb-1564f8adc365@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3ce80f3c-44f6-8ec6-01fb-1564f8adc365@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00622.txt.bz2 On Wed, Nov 16, 2016 at 09:09:40AM -0600, Luis Machado wrote: > > > >+LONGEST > >+regcache_raw_get_signed (struct regcache *regcache, int regnum) > >+{ > > I don't quite like the name, but it is debatable whether it is > appropriate or not. :-) > > Making it shorter and to the point since it gets used so much? > Hi Luis, [Sorry for the late response. I was in a training last week, C++ 11 training btw.] We've already had regcache_raw_get_unsigned (in common/common-regcache.h), so it is reasonable to add regcache_raw_get_signed. The regcache API scheme is like regcache_{raw,cooked}_{read,write,get}_{signed,unsigned}. I can't find any redundant bits in the function name. > >diff --git a/gdb/regcache.h b/gdb/regcache.h > >index 1bb0ce0..19ea976 100644 > >--- a/gdb/regcache.h > >+++ b/gdb/regcache.h > >@@ -66,6 +66,9 @@ extern void regcache_raw_write_signed (struct regcache *regcache, > > extern void regcache_raw_write_unsigned (struct regcache *regcache, > > int regnum, ULONGEST val); > > > >+extern LONGEST regcache_raw_get_signed (struct regcache *regcache, > >+ int regnum); > >+ > > /* Set a raw register's value in the regcache's buffer. Unlike > > regcache_raw_write, this is not write-through. The intention is > > allowing to change the buffer contents of a read-only regcache > > > > I understand this command just mimics what get_frame_register_signed > does, but is it worth having some documentation to make it clear > what this does and that it throws when a register is not available? How about this comment ? /* Return the register's value in signed or throw if it's not available. */ -- Yao (齐尧)