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

Joel Brobecker brobecker@adacore.com
Tue Oct 1 15:53:00 GMT 2013


> 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



More information about the Gdb-patches mailing list