[RFC] Add support for --start option in -exec-run GDB/MI command.

Tom Tromey tromey@redhat.com
Tue Oct 1 15:39:00 GMT 2013


>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> We'd like to be able to do the equivalent of the "start" command
Joel> using the GDB/MI interpreter.  For this, I propose the addition
Joel> of the --start command-line option to the -exec-run command.

Joel> Attached is first try at its implementation.  This is just an RFC,
Joel> just in case another interface to this feature gets prefered.
Joel> Once we've settled on that, I'll finalize the implementation
Joel> as well as provide documentation + NEWS.

Joel> Thoughts?

It seems reasonable enough to me.

My first thought was: why not just insert a temporary breakpoint by
hand?  But then it occurred to me that perhaps gdb would know someday
not to always use "main" (there is at least one PR about this); in which
case having the functionality directly in gdb seems superior.

Joel> +  char *run_cmd = start_p ? "start" : "run";

const, here and elsewhere.

Joel> +  for (i = 0; i < argc; i++)
Joel> +    {
Joel> +      if (strcmp (argv[i], "--start") == 0)
Joel> +	start_p = 1;
Joel> +      else
Joel> +	error (_("invalid option '%s'"), argv[i]);
Joel> +    }

I'd prefer that we not add new ad hoc option parsers but instead stick
to mi_getopt whenever possible.

Tom



More information about the Gdb-patches mailing list