Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Dennis Brueni <dbrueni@slickedit.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: PATCH: GDB/MI - implement -exec-abort
Date: Sun, 23 Nov 2014 07:18:00 -0000	[thread overview]
Message-ID: <20141123071833.GA7136@adacore.com> (raw)
In-Reply-To: <D06EB23F.17560%dbrueni@slickedit.com>

Dennis,

On Thu, Oct 23, 2014 at 08:25:21PM +0000, Dennis Brueni wrote:
> 
> The -exec–abort command has been documented as the MI equivalent to the kill command since GDB 5.1, but it was never implemented.
> 
> This patch does that.
> 
> gdb/ChangeLog
> 2014-10-23  Dennis Brueni  <dbrueni@slickedit.com>
> 
> * mi/mi-cmds.c Add "exec-abort”
> * mi/mi-cmds.h Add prototype for mi_cmd_exec_abort
> * mi/mi-main.c Add mi_cmd_exec_abort (identical to kill_command minus prompting)
> 
> gdb/doc/ChangeLog
> 2014-10-23  Dennis Brueni  <dbrueni@slickedit.com>
> 
> * doc/gdb.texinfo Revive -exec–abort documentation, add example.

Sorry for the delay in reviewing your patch.

First things first, do you have an FSF copyright assignment on file?
I tried looking you up in the FSF records and couldn't find you.
Your patch is too big for us to be able to accept it. If you'd like
to be started on the process, please let me know, as it does take
a little bit of time to get through.

You didn't say how you tested your patch, and the headers of the diff
seem to indicate that the changes were made against GDB 7.8; instead,
we ask that patches be tested on top of our master branch, which is
the branch we use for development.

The formatting of your ChangeLog is not correct. Here is what they should
look like:

gdb/ChangeLog
2014-10-23  Dennis Brueni  <dbrueni@slickedit.com>

	* mi/mi-cmds.c (mi_cmds): Add "exec-abort” command.
	* mi/mi-cmds.h (mi_cmd_exec_abort):  Add prototype.
	* mi/mi-main.c (mi_cmd_exec_abort): New function.

gdb/doc/ChangeLog
2014-10-23  Dennis Brueni  <dbrueni@slickedit.com>

	* doc/gdb.texinfo (GDB/MI Miscellaneous Commands): Revive
        -exec-abort documentation, add example.

More explicitly, I made the following adjustements:

  - the contents should be indented by a tab (warning: _not_ 8 spaces);
  - sentences should start with a capital letter and end with a period;
  - the parts you touch (eg: function name, @node name for the doco,
    should be listed in between parenthesis;
  - there should be a colon before you start explaning what you change;
  - There is max line length soft limit of 74 characters, and a hard
    limit of 80.

I am not sure how you formatted this message to send the patch,
but a recommended way to work is to commit your change with a revision
log that serves both as revision log as well as email to be sent
here for us to review. That way, we see exactly what is proposed,
revision log included, and it also helps archeology to have
the what, where, how and why parts attach to each patch. And, as
a side-effect, the patch will also use diff's "-p" option, which
provides the name of the function each hunk is in, making review
of your patch a bit easier.

I realize that's a lot of info to process for such a small patch,
and I am sorry to hit you with this, but consistency is important
to us.

> +/* Stop the execution of the target. */
> +
> +void
> +mi_cmd_exec_abort (char *command, char **argv, int argc)

First of all, thank you _very much_ for thinking of adding an
introductory comment for the function you're adding! Not everyone
does that, and it's also a rule that we want everyone to follow...

In terms of the function's implementation, however, I would rather
you re-used the code in kill_command rather than reimplement it
entirely like it.

So, can you please do the following instead:

  - Extract the code from kill_command out to a subprogram called
    for instance kill_current_inferior, with one argument used
    to tell the function whether the user should be queried
    or not.

    In the function's command, please make it clear that it uses
    INFERIOR_PTID to determine which inferior to kill.
    "kill_current_inferior" alludes to the "current_inferior" function
    which returns the value of another global. Intuitively, the should
    be the same, but I do not remember why we have two anymore, and
    we don't have to worry about that for your patch.

  - Make both kill_command and mi_cmd_exec_abort both call
    kill_current_inferior.

Thank you,
-- 
Joel


      parent reply	other threads:[~2014-11-23  7:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 20:25 Dennis Brueni
2014-10-23 20:43 ` Eli Zaretskii
2014-10-23 22:01   ` Dennis Brueni
2014-10-24  6:50     ` Eli Zaretskii
2014-11-23  7:18 ` Joel Brobecker [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=20141123071833.GA7136@adacore.com \
    --to=brobecker@adacore.com \
    --cc=dbrueni@slickedit.com \
    --cc=gdb-patches@sourceware.org \
    /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