From: Pedro Alves <palves@redhat.com>
To: John Baldwin <jhb@FreeBSD.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH v3] Add a 'starti' command.
Date: Tue, 19 Sep 2017 14:35:00 -0000 [thread overview]
Message-ID: <7b165874-88ec-0ef2-50c5-9eb7b19eeb53@redhat.com> (raw)
In-Reply-To: <20170911220803.73819-1-jhb@FreeBSD.org>
Hi John,
This looks good to me, with a couple minor nits below.
On 09/11/2017 11:08 PM, John Baldwin wrote:
>
> -/* Implement the "run" command. If TBREAK_AT_MAIN is set, then insert
> - a temporary breakpoint at the begining of the main program before
> - running the program. */
> +/* Determine how the new inferior will behave. */
> +
> +enum run_how {
{ goes on next line.
> + /* Do not create any breakpoint. */
I wonder about tweaking this comment to avoid talking
about breakpoints, since this enum is not really strictly
about breakpoints anymore.
> + RUN_NORMAL,
> +
> + /* Stop at the beginning of the program's main function. */
> + RUN_STOP_AT_MAIN,
> +
> + /* Stop at the first instruction of the program. */
> + RUN_STOP_AT_FIRST_INSN
> +};
> +
> +/* This help string is used for the run, start, and starti commands.
> + It is defined as a macro to prevent duplication. */
> +
> +#define RUN_ARGS_HELP \
> +"You may specify arguments to give it.\n\
> +Args may include \"*\", or \"[...]\"; they are expanded using the\n\
> +shell that will start the program (specified by the \"$SHELL\"\
> +environment\nvariable). Input and output redirection with \">\",\
> +\"<\", or \">>\"\nare also allowed.\n\n\
You have a "\n" in the middle of some lines above. Was that intended?
I'd expect to see instead lines broken at \n, ending with \n\ .
> +With no arguments, uses arguments last specified (with \"run\" \
> +or \"set args\").\n\
> +To cancel previous arguments and run with no arguments,\n\
> +use \"set args\" without arguments.\n\
> +To start the inferior without using a shell, use \"set \
> +startup-with-shell off\"."
> +
> diff --git a/gdb/testsuite/gdb.base/starti.c b/gdb/testsuite/gdb.base/starti.c
> new file mode 100644
> index 0000000000..dc098fe8aa
> --- /dev/null
> +++ b/gdb/testsuite/gdb.base/starti.c
> @@ -0,0 +1,30 @@
> + You should have received a copy of the GNU General Public License
> + along with this program. If not, see <http://www.gnu.org/licenses/>. */
> +
> +#include <stdio.h>
This isn't necessary, AFAICS.
> +
> +int x;
> +
> +__attribute__((constructor)) void ctor()
> +{
> + x = 1;
> +}
> +
> +int main()
> +{
> + return 0;
> +}
Space before parens, line break after return type.
We follow GNU convention in tests too, unless different syntax is
relevant for the test.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-09-19 14:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 22:08 John Baldwin
2017-09-18 23:15 ` John Baldwin
2017-09-19 14:35 ` Pedro Alves [this message]
2017-09-19 18:23 ` John Baldwin
2017-09-19 18:29 ` Pedro Alves
2017-11-03 13:00 ` Yao Qi
2017-11-15 20:11 ` John Baldwin
2017-11-15 20:23 ` Pedro Alves
2017-11-15 23:32 ` John Baldwin
2017-11-16 10:54 ` Pedro Alves
2017-11-16 12:38 ` [pushed] Fix gdb.base/starti.exp racy test (Re: [PATCH v3] Add a 'starti' command.) Pedro Alves
2017-11-16 18:00 ` John Baldwin
2017-11-16 18:15 ` Pedro Alves
2017-11-16 9:55 ` [PATCH v3] Add a 'starti' command Yao Qi
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=7b165874-88ec-0ef2-50c5-9eb7b19eeb53@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jhb@FreeBSD.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).