Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch 3/4] hw watchpoints made multi-inferior
Date: Mon, 13 Dec 2010 02:47:00 -0000	[thread overview]
Message-ID: <4D05892D.8030800@codesourcery.com> (raw)
In-Reply-To: <20101211051554.GC10298@host0.dyn.jankratochvil.net>

On 12/11/2010 01:15 PM, Jan Kratochvil wrote:
> 
>>> 	* linux-nat.c (linux_nat_iterate_watchpoint_lwps): Fix
>>> 	iterate_over_lwps FILTER.
>>
>> What is FILTER?
> 
> `filter' is name of the first parameter of iterate_over_lwps.
> 
>> Why capitalized?
> 
> I follow:
> 
> http://sourceware.org/ml/gdb-patches/2008-09/msg00374.html
> On Wed, 17 Sep 2008 20:03:37 +0200, Daniel Jacobowitz wrote:
> # You capitalize FOO when you mean "the value of a variable named foo", but the
> # name of the variable is still "foo".
> 
> But I haven't found such rule in GNU Coding Standards (GCS) now.  But some
> keywords are capitalized in GCS.
> 

IMO, this rule is for comments of function header, and I don't see it in
ChangeLog entries before.  Thanks for this explanation.  It looks OK to me.

>>> +      if (old_loc->pspace != current_program_space)
>>> +	continue;
>>
>> code indent problem?  Put extra three spaces in front of "continue".
> 
> There is <tab> before `continue;'.  The tab should be there for any 8 spaces
> according to GNU indent options present in GCS.
> 
> It just gets displayed wrong in the patch file due to the first column from
> diff.  I do not know an easy solution for it.  Rather well formatted code
> using >=4 blocks indentation looks wrong to me (as it may not be using tabs).
> 

OK, no problem.

> 
>>> +static void
>>> +i386_inferior_data_cleanup (struct inferior *inf, void *arg)
>>> +{
>>> +  struct i386_inferior_data *inf_data = arg;
>>> +
>>> +  xfree (inf_data);
>>> +}
>>
>> Can't we 'xfree (arg);' directly?
> 
> This was discussed here before at least in:
> 	http://sourceware.org/ml/gdb-patches/2010-05/msg00162.html
> 
> The problem is primarily GDB still has not switched to C++ with templates
> where ARG could have the right type instead of `void *'.
> 
> With the `void *' cast I find it both more readable to see what the parameter
> in fact is.  And I also find it safer is someone needs to access some members
> of `struct i386_inferior_data' in the future.  Having to re-cast `void *' to
> the right type during such code changes can be IMO more fragile than to just
> write it down once when one implements both the caller and the callback.
> 
> And it is just the simpler stupid writing of code when one does not have to
> think about it much and it just works.
> 
> Unless decided otherwise so far I consider this style is agreed upon for GDB.

Oh, yes.  I didn't know it before.  Thanks for your explanation.


>>> +if ![runto_main] {
>>
>> Please add `perror "Couldn't run ${testfile}"'
>>
>>> +    return
>>> +}
> 
> In any case runto_main returns 0 some kind of error message has been already
> printed.  Or do I miss some case?
> 

No.  Let's keep it as it is now.

I have no other comments to your new patch.

-- 
Yao (齐尧)


      parent reply	other threads:[~2010-12-13  2:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 11:14 [patch 4/4] " Jan Kratochvil
2010-12-07  5:02 ` Yao Qi
2010-12-11  5:16   ` [patch 3/4] " Jan Kratochvil
2010-12-12  8:05     ` Jan Kratochvil
2010-12-13  2:47     ` Yao Qi [this message]

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=4D05892D.8030800@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.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