This is the mail archive of the gdb-patches@sourceware.org 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: [RFC] Add support for --start option in -exec-run GDB/MI command.


> 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


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