+2002-11-04 Elena Zannoni <ezannoni@redhat.com>
+
+ * event-top.c (display_gdb_prompt): Use
+ gdb_interpreter_display_prompt_p.
+ * cli/cli-interp.c (cli_interpreter_display_prompt_p): Rename from
+ cli_interpreter_display_prompt and rewrite.
+ (_initialize_cli_interp): New proc name is
+ cli_interpreter_display_prompt_p.
+ * interps.c (gdb_new_interpreter): Initialize prompt_proc_p
+ instead of prompt_proc.
+ (gdb_interpreter_display_prompt_p): Rewrite as a predicate.
+ * interps.h (interp_prompt_ftype): Update typedef.
+ (struct gdb_interpreter_procs): Rename prompt_proc to
+ prompt_proc_p.
+ (gdb_interpreter_display_prompt_p): Export this instead of old
+ function.
+
2002-11-04 Elena Zannoni <ezannoni@redhat.com>
* interps.c (list_interpreter_cmd, do_set_interpreter): Remove
static int cli_interpreter_resume (void *data);
static int cli_interpreter_suspend (void *data);
static int cli_interpreter_exec (void *data, char *command_str);
-static int cli_interpreter_display_prompt (void *data, char *new_prompt);
+static int cli_interpreter_display_prompt_p (void);
/* These are the ui_out and the interpreter for the console interpreter. */
static struct ui_out *cli_uiout;
return 1;
}
+/* Don't display the prompt if we are set quiet. */
static int
-cli_interpreter_display_prompt (void *data, char *new_prompt)
+cli_interpreter_display_prompt_p (void)
{
if (gdb_interpreter_is_quiet (NULL))
- {
- return 1;
- }
+ return 0;
else
- {
- return 0;
- }
+ return 1;
}
static int
cli_interpreter_resume, /* resume_proc */
cli_interpreter_suspend, /* suspend_proc */
cli_interpreter_exec, /* exec_proc */
- cli_interpreter_display_prompt /* prompt_proc */
+ cli_interpreter_display_prompt_p /* prompt_proc_p */
};
/* Create a default uiout builder for the CLI. */
int prompt_length = 0;
char *gdb_prompt = get_prompt ();
- /* When an alternative interpreter has been installed, do not
- display the comand prompt. */
- if (gdb_interpreter_display_prompt (new_prompt))
+ /* Each interpreter has its own rules on wether or not display the
+ command prompt. */
+ if (!gdb_interpreter_display_prompt_p ())
return;
if (target_executing && sync_execution)
new_interp->procs.resume_proc = procs->resume_proc;
new_interp->procs.suspend_proc = procs->suspend_proc;
new_interp->procs.exec_proc = procs->exec_proc;
- new_interp->procs.prompt_proc = procs->prompt_proc;
+ new_interp->procs.prompt_proc_p = procs->prompt_proc_p;
new_interp->inited = 0;
return new_interp;
}
/* This is called in display_gdb_prompt.
- If the current interpreter defines a prompt_proc, then that proc is
- run. If the proc returns a non-zero value, display_gdb_prompt will
- return without itself displaying the prompt. */
+ If the proc returns a zero value, display_gdb_prompt will
+ return without displaying the prompt. */
int
-gdb_interpreter_display_prompt (char *new_prompt)
+gdb_interpreter_display_prompt_p (void)
{
- if (current_interpreter->procs.prompt_proc == NULL)
+ if (current_interpreter->procs.prompt_proc_p == NULL)
return 0;
else
- return current_interpreter->procs.prompt_proc (current_interpreter->data,
- new_prompt);
+ return current_interpreter->procs.prompt_proc_p ();
}
int
typedef int (*interp_init_ftype) (void *data);
typedef int (*interp_resume_ftype) (void *data);
typedef int (*interp_suspend_ftype) (void *data);
-typedef int (*interp_prompt_ftype) (void *data, char *new_prompt);
+typedef int (*interp_prompt_ftype) (void);
typedef int (*interp_exec_ftype) (void *data, char *command);
struct ui_out;
interp_resume_ftype resume_proc;
interp_suspend_ftype suspend_proc;
interp_exec_ftype exec_proc;
- interp_prompt_ftype prompt_proc;
+ interp_prompt_ftype prompt_proc_p;
};
extern struct gdb_interpreter
extern struct ui_out *gdb_interpreter_ui_out (struct gdb_interpreter *interp);
extern int gdb_current_interpreter_is_named (char *interp_name);
extern int gdb_interpreter_exec (char *command_str);
-extern int gdb_interpreter_display_prompt (char *new_prompt);
+extern int gdb_interpreter_display_prompt_p (void);
extern int gdb_interpreter_set_quiet (struct gdb_interpreter *interp,
int quiet);
extern int gdb_interpreter_is_quiet (struct gdb_interpreter *interp);
+2002-11-04 Elena Zannoni <ezannoni@redhat.com>
+
+ * mi-interp.c (_initialize_mi_interp): Use mi_interpreter_prompt_p
+ instead of mi_interpreter_prompt.
+ (mi_interpreter_prompt_p): Rename from mi_interpreter_prompt and
+ rewrite.
+
2002-11-04 Elena Zannoni <ezannoni@redhat.com>
* mi-interp.c mi_interpreter_delete): Remove.
static int mi_interpreter_resume (void *data);
static int mi_interpreter_suspend (void *data);
static int mi_interpreter_exec (void *data, char *command);
-static int mi_interpreter_prompt (void *data, char *new_prompt);
+static int mi_interpreter_prompt_p (void);
static void mi_execute_command_wrapper (char *cmd);
static void mi_command_loop (int mi_version);
return 1;
}
+/* Never display the default gdb prompt in mi case. */
static int
-mi_interpreter_prompt (void *data, char *new_prompt)
+mi_interpreter_prompt_p (void)
{
- return 1;
+ return 0;
}
static void
mi_interpreter_resume, /* resume_proc */
mi_interpreter_suspend, /* suspend_proc */
mi_interpreter_exec, /* exec_proc */
- mi_interpreter_prompt /* prompt_proc */
+ mi_interpreter_prompt_p /* prompt_proc_p */
};
/* Create MI1 interpreter */