This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Add support for --start option in -exec-run GDB/MI command.
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 01 Oct 2013 09:39:08 -0600
- Subject: Re: [RFC] Add support for --start option in -exec-run GDB/MI command.
- Authentication-results: sourceware.org; auth=none
- References: <1380618763-27926-1-git-send-email-brobecker at adacore dot com>
>>>>> "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