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: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 1 Oct 2013 17:53:03 +0200
- 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> <87fvsl80gz dot fsf at fleche dot redhat dot com>
> 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.
Correct. For programs in C, the main subprogram is always "main",
but in Ada, it could be any symbol name so the front-end wouldn't
be able to know where to insert it without poking inside the program.
I think the same situation arrises with other languages too.
> 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.
OK, I can do that.
Thanks!
--
Joel