This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/RFC] New command: ``start''


> Date: Mon, 17 May 2004 19:47:00 -0700
> From: Joel Brobecker <brobecker@gnat.com>
> 
> As briefly discussed on gdb@ and gdb-patches@, here is a first proposal
> for the addition of a new command: ``start''.

Thanks.

> The other decision I made was to allow this new method to be undefined
> (NULL). In that case, we use "main" as the location where to insert the
> temporary breakpoint. I am not too sure about this approach, but I
> selected it because it avoids a xstrdup ("main")/xfree sequence.
> On the other hand, forcing the method to always be set would make the
> implemention clearer, I think, just at the expense of an unnecessary
> xstrdup/xfree sequence.

I think it's better to have a non-NULL string there.  The benfit is
that whoever reads the code doesn't need to look elsewhere to
understand what effect does NULL have there.

> +  if (current_language->la_xmain_procedure_name == NULL)
> +    {
> +      main_program_name = "main";
> +    }
> +  else
> +    {
> +      main_program_name =
> +        current_language->la_xmain_procedure_name ();
> +
> +      if (main_program_name == NULL)
> +        error ("Unable to get the main program name.");

If we use "main" when the method is NULL, we should also use "main"
if the method returns NULL, I think.

> +  c = add_com ("start", class_run, start_command,
> +               "\
> +Start the debugged program until the beginning of the main procedure.\n\

I think this should say "Run the debugged program until ...".  "Start
until" sounds like incorrect English.

> +Depending on the language, the name of the main procedure can vary.
> +With languages such as C or C++, the main procedure name is always

Please use "C@t{++}" instead of "C++", the former looks prettier in
print.

> +@code{main()}, but other languages such as Ada do not require a specific

Please say "@code{main}", without the parens.  "main()" looks like a
call to `main' with no arguments, which is not what you mean here.

> +The @code{start} command does the equivalent of setting a temporary
> +breakpoint at the beginning of the main procedure and then performing
> +a @code{run}.

`run' should be in @samp here, and I think "invoking the @samp{run}
command" is better than "performing a @samp{run}".

> Some programs contain an elaboration phase that will be
> +performed before the main procedure is reached, and it is possible that
> +the debugger will stop before reaching the main procedure. However,
> +the temporary breakpoint will remain to halt execution.

Sorry, I don't understand this part (what is ``elaboration''?).
Could you perhaps make this text more explanatory?

> +The arguments used when using this command are directly passed to the
> +@code{run} command.

You mean, if you type "run" thereafter, it will reuse the arguments
you type for the "start" command?  If so, we should reword this text
to make that more clear.  ``Directly passed'' is confusing, since
nothing is really passed anywhere.

Finally, our standard is to have 2 spaces after the period that ends a
sentence.  Please make sure you do that in your patch.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]