From: Yao Qi <qiyaoltc@gmail.com>
To: Luis Machado <lgustavo@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 01/13] New regcache_raw_get_signed
Date: Tue, 22 Nov 2016 09:28:00 -0000 [thread overview]
Message-ID: <20161122092838.GC24810@E107787-LIN> (raw)
In-Reply-To: <3ce80f3c-44f6-8ec6-01fb-1564f8adc365@codesourcery.com>
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 (é½å°§)
next prev parent reply other threads:[~2016-11-22 9:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-14 17:43 [PATCH 00/13] Change gdbarch software_single_step frame_info to regcache Yao Qi
2016-11-14 17:43 ` [PATCH 09/13] gdbarch software_single_step frame_info to regcache: s390 Yao Qi
2016-11-14 17:43 ` [PATCH 11/13] gdbarch software_single_step frame_info to regcache: tic6x Yao Qi
2016-11-14 17:43 ` [PATCH 01/13] New regcache_raw_get_signed Yao Qi
2016-11-16 15:09 ` Luis Machado
2016-11-22 9:28 ` Yao Qi [this message]
[not found] ` <36110d4e-9c80-23cb-ee40-849fb155af53@codesourcery.com>
2016-11-22 14:33 ` Yao Qi
2016-11-14 17:43 ` [PATCH 07/13] gdbarch software_single_step frame_info to regcache: nios2 Yao Qi
2016-11-14 17:43 ` [PATCH 06/13] gdbarch software_single_step frame_info to regcache: moxie Yao Qi
2016-11-14 17:43 ` [PATCH 04/13] gdbarch software_single_step frame_info to regcache: cris Yao Qi
2016-11-14 17:43 ` [PATCH 10/13] gdbarch software_single_step frame_info to regcache: rs6000 Yao Qi
2016-11-14 17:43 ` [PATCH 02/13] gdbarch software_single_step frame_info to regcache: aarch64 Yao Qi
2016-11-14 17:43 ` [PATCH 03/13] gdbarch software_single_step frame_info to regcache: alpha Yao Qi
2016-11-14 17:43 ` [PATCH 08/13] gdbarch software_single_step frame_info to regcache: sparc Yao Qi
2016-11-14 17:43 ` [PATCH 05/13] gdbarch software_single_step frame_info to regcache: mips Yao Qi
2016-11-14 17:43 ` [PATCH 12/13] gdbarch software_single_step frame_info to regcache: spu Yao Qi
2016-11-14 17:43 ` [PATCH 13/13] Change gdbarch software_single_step frame_info to regcache Yao Qi
2016-11-16 16:17 ` Luis Machado
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161122092838.GC24810@E107787-LIN \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=lgustavo@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox