Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Pierre Langlois <pierre.langlois@embecosm.com>,
	gdb-patches@sourceware.org
Subject: Re: [RFC][PATCH v2][PR remote/16896] Invalidate a register in cache when a remote target failed to write it.
Date: Thu, 12 Jun 2014 13:23:00 -0000	[thread overview]
Message-ID: <5399A9CE.4040900@redhat.com> (raw)
In-Reply-To: <537E086A.9030803@embecosm.com>

Hi Pierre,

On 05/22/2014 03:23 PM, Pierre Langlois wrote:
> Hello all,
> 
> This patch addresses the issue in patch [1] generically as pointed out by
> a comment [2].
> 
> As opposed to invalidating a register in cache in the remote target before
> throwing an error, we can do this using a cleanup in regcache_raw_write.  This
> patch adds routines to add a regcache_invalidate cleanup to the current chain.
> We can use this before target_store_registers and discard it after if an error
> was not thrown.
> 
> [1] https://sourceware.org/ml/gdb-patches/2014-05/msg00083.html
> [2] https://sourceware.org/ml/gdb-patches/2014-05/msg00357.html

Based on the commit log / description of the change in v1, could
you propose a commit log for this version of the patch, please?

> 2014-05-20  Pierre Langlois  <pierre.langlois@embecosm.com>
> 
> 	PR remote/16896
> 	* regcache.c (register_to_invalidate): New structure. Combines a pointer

Double space after periods. "structure.  Combines".

But just "New structure" is enough.  The structure's description should be
in the code.  We usually spell out "struct" in the context part as well.  So:

	* regcache.c (struct register_to_invalidate): New structure.

>          to a struct regcache and a register number.
> 	(do_register_invalidate): New function. Call regcache_invalidate.
> 	(make_cleanup_regcache_invalidate): New function. Construct a cleanup
>          for invalidating a register.
> 	(regcache_raw_write): Call make_cleanup_regcache_invalidate

Missing period.

Also, please make sure ChangeLog entries are indented with a tab instead
of spaces.

I suggest:

	* regcache.c (struct register_to_invalidate): New structure.
	(do_register_invalidate, make_cleanup_regcache_invalidate): New
	functions.
	(regcache_raw_write): Call make_cleanup_regcache_invalidate.
	* regcache.h (make_cleanup_regcache_invalidate): New prototype.

> +
> +static void
> +do_regcache_invalidate (void *data)
> +{
> +  struct register_to_invalidate *reg = data;
> +  regcache_invalidate (reg->regcache, reg->regnum);

Empty line after declaration.

> +}
> +
> +struct cleanup *
> +make_cleanup_regcache_invalidate (struct regcache *regcache, int regnum)

As nothing is calling this outside regcache.c, please make it static.

> +{
> +  struct register_to_invalidate* reg = XNEW (struct register_to_invalidate);
> +  reg->regcache = regcache;

Empty line after declaration.

Thanks!

-- 
Pedro Alves


  parent reply	other threads:[~2014-06-12 13:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 14:23 Pierre Langlois
2014-06-02  9:12 ` [PING][RFC][PATCH " Pierre Langlois
2014-06-11 16:58   ` [PING^2][RFC][PATCH " Pierre Langlois
2014-06-12 13:23 ` Pedro Alves [this message]
2014-06-12 16:03   ` [RFC][PATCH " Pierre Langlois
2014-06-12 16:31     ` Pedro Alves

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=5399A9CE.4040900@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pierre.langlois@embecosm.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