This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Delete interp_exec_p
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 13 Nov 2013 11:22:48 +0000
- Subject: Re: [PATCH] Delete interp_exec_p
- Authentication-results: sourceware.org; auth=none
- References: <yjt2mwl9rwa6 dot fsf at ruffy dot mtv dot corp dot google dot com>
On 11/13/2013 12:16 AM, Doug Evans wrote:
> Hi.
>
> I noticed this while working on some MI stuff.
> AFAICT every interpreter defines exec_proc so interp_exec_p is
> unnecessary.
I looked at Insight, and was a little worried, but I think it's fine.
It has a hack to disable interpreter-exec (generic/gdbtk-interp.c):
/* See note in gdbtk_interpreter_init */
static void
hack_disable_interpreter_exec (char *args, int from_tty)
{
error ("interpreter-exec not available when running Insight");
}
static void *
gdbtk_interpreter_init (struct interp *interp, int top_level)
{
/* Disable interpreter-exec. It causes us big trouble right now. */
...
if (lookup_cmd_composition ("interpreter-exec", &alias, &prefix, &cmd))
{
set_cmd_cfunc (cmd, hack_disable_interpreter_exec);
}
And then installs a exec_proc hook that does nothing:
static struct gdb_exception
gdbtk_interpreter_exec (void *data, const char *command_str)
{
return exception_none;
}
void
_initialize_gdbtk_interp (void)
{
static const struct interp_procs procs = {
...
gdbtk_interpreter_exec, /* exec_proc */
...
I considered whether it would be a cleaner to not install
a exec_proc hook. But I think it'd be just as good to
have gdbtk_interpreter_exec itself return the error
instead of returning exception_none.
> Regression tested on amd64-linux.
>
> Ok to check in?
>
> 2013-11-12 Doug Evans <dje@google.com>
>
> * interps.h (interp_exec_p): Delete.
> * interps.c (interp_exec_p): Delete.
> (interp_exec): Update. Assert interp->procs->exec_proc != NULL.
> * mi/mi-interp.c (mi_cmd_interpreter_exec): Update.
Looks good to me.
--
Pedro Alves