diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-11-04 22:47:26 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-11-04 22:47:26 +0000 |
commit | eb5447add9c6bfabe4d851d50aa6097ccf844aef (patch) | |
tree | 52307486f7580d47ec7d31b9df02505ec22a1b91 | |
parent | c758cb4a74cbb9d5afdbe90e3175b6412b3d2714 (diff) | |
download | gdb-eb5447add9c6bfabe4d851d50aa6097ccf844aef.tar.gz |
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>
* 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.
-rw-r--r-- | gdb/ChangeLog | 17 | ||||
-rw-r--r-- | gdb/cli/cli-interp.c | 15 | ||||
-rw-r--r-- | gdb/event-top.c | 6 | ||||
-rw-r--r-- | gdb/interps.c | 14 | ||||
-rw-r--r-- | gdb/interps.h | 6 | ||||
-rw-r--r-- | gdb/mi/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/mi/mi-interp.c | 9 |
7 files changed, 47 insertions, 27 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5b1f4607b5a..084e45f7e77 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,22 @@ 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 useless prototypes. Update a few comments, remove gratuitous blank lines. diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index 33245cdb9d3..cb53608d975 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -31,7 +31,7 @@ static int cli_interpreter_init (void *data); 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; @@ -70,17 +70,14 @@ cli_interpreter_suspend (void *data) 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 @@ -129,7 +126,7 @@ _initialize_cli_interp (void) 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. */ diff --git a/gdb/event-top.c b/gdb/event-top.c index 591e0be7b43..1b54e5ff073 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -251,9 +251,9 @@ display_gdb_prompt (char *new_prompt) 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) diff --git a/gdb/interps.c b/gdb/interps.c index 53ff28844bd..b3327802c78 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -101,7 +101,7 @@ gdb_new_interpreter (char *name, 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; @@ -278,17 +278,15 @@ gdb_current_interpreter_is_named (char *interp_name) } /* 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 diff --git a/gdb/interps.h b/gdb/interps.h index 0d8820c6471..40ba7145134 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -25,7 +25,7 @@ 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; @@ -37,7 +37,7 @@ struct gdb_interpreter_procs 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 @@ -51,7 +51,7 @@ extern struct gdb_interpreter *gdb_current_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); diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 9765df1fdda..d15ef620c7a 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,5 +1,12 @@ 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. (_initialize_mi_interp): Remove mi_interpreter_delete. diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 6146b9c692e..1d1c5b96554 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -48,7 +48,7 @@ static int mi_interpreter_init (void *data); 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); @@ -173,10 +173,11 @@ mi_interpreter_exec (void *data, char *command) 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 @@ -418,7 +419,7 @@ _initialize_mi_interp (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 */ |