+2017-02-08 Pedro Alves <palves@redhat.com>
+
+ * interps.c (interp::interp): Remove reference to quiet_p.
+ (interp_set): Make static. Remove dead "Switching to" output
+ code.
+ (interp_quiet_p, interp_set_quiet): Delete.
+ (interpreter_exec_cmd): Don't set the interpreter quiet.
+ * interps.h (interp_quiet_p): Make static.
+ (class interp) <quiet_p>: Remove field
+
2017-02-08 Jerome Guitton <guitton@adacore.com>
* cli/cli-decode.c (find_command_name_length): Make it extern.
interp::interp (const char *name)
{
this->name = xstrdup (name);
- this->quiet_p = false;
this->inited = false;
}
events such as target stops and new thread creation, even if they
are caused by CLI commands. */
-void
+static void
interp_set (struct interp *interp, bool top_level)
{
struct ui_interp_info *ui_interp = get_current_interp_info ();
struct interp *old_interp = ui_interp->current_interpreter;
- int first_time = 0;
- char buffer[64];
/* If we already have an interpreter, then trying to
set top level interpreter is kinda pointless. */
current_uiout->flush ();
old_interp->suspend ();
}
- else
- {
- first_time = 1;
- }
ui_interp->current_interpreter = interp;
if (top_level)
clear_interpreter_hooks ();
interp->resume ();
-
- if (!first_time && !interp_quiet_p (interp))
- {
- xsnprintf (buffer, sizeof (buffer),
- "Switching to interpreter \"%.24s\".\n", interp->name);
- current_uiout->text (buffer);
- }
}
/* Look up the interpreter for NAME. If no such interpreter exists,
return interp->supports_command_editing ();
}
-int
-interp_quiet_p (struct interp *interp)
-{
- struct ui_interp_info *ui_interp = get_current_interp_info ();
-
- if (interp != NULL)
- return interp->quiet_p;
- else
- return ui_interp->current_interpreter->quiet_p;
-}
-
-static int
-interp_set_quiet (struct interp *interp, int quiet)
-{
- int old_val = interp->quiet_p;
-
- interp->quiet_p = quiet;
- return old_val;
-}
-
/* interp_exec - This executes COMMAND_STR in the current
interpreter. */
char **trule = NULL;
unsigned int nrules;
unsigned int i;
- int old_quiet, use_quiet;
struct cleanup *cleanup;
if (args == NULL)
if (interp_to_use == NULL)
error (_("Could not find interpreter \"%s\"."), prules[0]);
- /* Temporarily set interpreters quiet. */
- old_quiet = interp_set_quiet (old_interp, 1);
- use_quiet = interp_set_quiet (interp_to_use, 1);
-
interp_set (interp_to_use, false);
for (i = 1; i < nrules; i++)
if (e.reason < 0)
{
interp_set (old_interp, 0);
- interp_set_quiet (interp_to_use, use_quiet);
- interp_set_quiet (old_interp, old_quiet);
error (_("error in command: \"%s\"."), prules[i]);
}
}
interp_set (old_interp, 0);
- interp_set_quiet (interp_to_use, use_quiet);
- interp_set_quiet (old_interp, old_quiet);
do_cleanups (cleanup);
}
extern int interp_suspend (struct interp *interp);
extern struct gdb_exception interp_exec (struct interp *interp,
const char *command);
-extern int interp_quiet_p (struct interp *interp);
class interp
{
/* Has the init method been run? */
bool inited;
-
- bool quiet_p;
};
extern void interp_add (struct ui *ui, struct interp *interp);
-extern void interp_set (struct interp *interp, bool top_level);
/* Look up the interpreter for NAME, creating one if none exists yet.
If NAME is not a interpreter type previously registered with