From 1c1fdbae2a75b6a3c6868150cdd949282125ae45 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Mon, 4 Nov 2002 22:08:26 +0000 Subject: [PATCH] 2002-11-04 Elena Zannoni * cli/cli-interp.c (cli_interpreter_delete): Delete. (_initialize_cli_interp): Remove delete_proc. * interps.h (struct gdb_interpreter_procs): Remove delete_proc. (interp_delete_ftype): Delete. (gdb_delete_interpreter): Remove. * interps.c (gdb_delete_interpreter): Remove. (gdb_new_interpreter): Don't initialize delete_proc. 2002-11-04 Elena Zannoni * mi-interp.c mi_interpreter_delete): Remove. (_initialize_mi_interp): Remove mi_interpreter_delete. --- gdb/ChangeLog | 12 +++++++ gdb/cli/cli-interp.c | 8 ----- gdb/interps.c | 75 -------------------------------------------- gdb/interps.h | 3 -- gdb/mi/ChangeLog | 5 +++ gdb/mi/mi-interp.c | 8 ----- 6 files changed, 17 insertions(+), 94 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 728a7cf5351..b5a11e53967 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2002-11-04 Elena Zannoni + + * cli/cli-interp.c (cli_interpreter_delete): Delete. + (_initialize_cli_interp): Remove delete_proc. + + * interps.h (struct gdb_interpreter_procs): Remove delete_proc. + (interp_delete_ftype): Delete. + (gdb_delete_interpreter): Remove. + + * interps.c (gdb_delete_interpreter): Remove. + (gdb_new_interpreter): Don't initialize delete_proc. + 2002-11-04 Elena Zannoni * interps.c (set_interpreter_cmd): Remove. diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index d22e228c893..33245cdb9d3 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -30,7 +30,6 @@ 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_delete (void *data); static int cli_interpreter_exec (void *data, char *command_str); static int cli_interpreter_display_prompt (void *data, char *new_prompt); @@ -71,12 +70,6 @@ cli_interpreter_suspend (void *data) return 1; } -static int -cli_interpreter_delete (void *data) -{ - return 1; -} - static int cli_interpreter_display_prompt (void *data, char *new_prompt) { @@ -135,7 +128,6 @@ _initialize_cli_interp (void) cli_interpreter_init, /* init_proc */ cli_interpreter_resume, /* resume_proc */ cli_interpreter_suspend, /* suspend_proc */ - cli_interpreter_delete, /* delete_proc */ cli_interpreter_exec, /* exec_proc */ cli_interpreter_display_prompt /* prompt_proc */ }; diff --git a/gdb/interps.c b/gdb/interps.c index 2137bfd93bc..727756bfae9 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -104,7 +104,6 @@ gdb_new_interpreter (char *name, new_interp->procs.init_proc = procs->init_proc; new_interp->procs.resume_proc = procs->resume_proc; new_interp->procs.suspend_proc = procs->suspend_proc; - new_interp->procs.delete_proc = procs->delete_proc; new_interp->procs.exec_proc = procs->exec_proc; new_interp->procs.prompt_proc = procs->prompt_proc; new_interp->inited = 0; @@ -132,80 +131,6 @@ gdb_add_interpreter (struct gdb_interpreter *interp) return 1; } -/* Looks for the interpreter INTERP in the interpreter list. If it exists, - runs the delete_proc, and if this is successful, the INTERP is deleted from - the interpreter list and the function returns 1. If the delete_proc fails, the - function returns -1 and the interpreter is NOT removed from the list. If the - interp is not found, 0 is returned. - - This isn't currently used by anything. */ - -int -gdb_delete_interpreter (struct gdb_interpreter *interp) -{ - struct gdb_interpreter *cur_ptr, *prev_ptr; - - if (!interpreter_initialized) - { - ui_out_message (uiout, 0, - "You can't delete an interp before you have added one!"); - return -1; - } - - if (interp_list == NULL) - { - ui_out_message (uiout, 0, "No interpreters to delete."); - return -1; - } - - if (interp_list->next == NULL) - { - ui_out_message (uiout, 0, "You can't delete gdb's only intepreter."); - return -1; - } - - for (cur_ptr = interp_list, prev_ptr = NULL; - cur_ptr != NULL; prev_ptr = cur_ptr, cur_ptr = cur_ptr->next) - { - if (cur_ptr == interp) - { - /* Can't currently delete the console interpreter... */ - if (strcmp (interp->name, "console") == 0) - { - ui_out_message (uiout, 0, - "You can't delete the console interpreter."); - return -1; - } - - /* If the interpreter is the current interpreter, switch - back to the console interpreter */ - - if (interp == current_interpreter) - { - gdb_set_interpreter (gdb_lookup_interpreter ("console")); - } - - /* Don't delete the interpreter if its delete proc fails */ - - if ((interp->procs.delete_proc != NULL) - && (!interp->procs.delete_proc (interp->data))) - return -1; - - if (cur_ptr == interp_list) - interp_list = cur_ptr->next; - else - prev_ptr->next = cur_ptr->next; - - break; - } - } - - if (cur_ptr == NULL) - return 0; - else - return 1; -} - /* This sets the current interpreter to be INTERP. If INTERP has not been initialized, then this will also run the init proc. If the init proc is successful, return 1, if it fails, set the old diff --git a/gdb/interps.h b/gdb/interps.h index 9d92c2c8fbc..0d8820c6471 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -25,7 +25,6 @@ typedef int (*interp_init_ftype) (void *data); typedef int (*interp_resume_ftype) (void *data); typedef int (*interp_suspend_ftype) (void *data); -typedef int (*interp_delete_ftype) (void *data); typedef int (*interp_prompt_ftype) (void *data, char *new_prompt); typedef int (*interp_exec_ftype) (void *data, char *command); @@ -37,7 +36,6 @@ struct gdb_interpreter_procs interp_init_ftype init_proc; interp_resume_ftype resume_proc; interp_suspend_ftype suspend_proc; - interp_delete_ftype delete_proc; interp_exec_ftype exec_proc; interp_prompt_ftype prompt_proc; }; @@ -47,7 +45,6 @@ extern struct gdb_interpreter struct gdb_interpreter_procs *procs); extern int gdb_add_interpreter (struct gdb_interpreter *interp); -extern int gdb_delete_interpreter (struct gdb_interpreter *interp); extern int gdb_set_interpreter (struct gdb_interpreter *interp); extern struct gdb_interpreter *gdb_lookup_interpreter (char *name); extern struct gdb_interpreter *gdb_current_interpreter (); diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 3854913615d..9765df1fdda 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,8 @@ +2002-11-04 Elena Zannoni + + * mi-interp.c mi_interpreter_delete): Remove. + (_initialize_mi_interp): Remove mi_interpreter_delete. + 2002-11-04 Elena Zannoni * mi-interp.c (mi_interpreter_do_one_event): Remove. diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 1cce419b5c7..6146b9c692e 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -47,7 +47,6 @@ struct gdb_interpreter *mi_interp; 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_delete (void *data); static int mi_interpreter_exec (void *data, char *command); static int mi_interpreter_prompt (void *data, char *new_prompt); @@ -167,12 +166,6 @@ mi_interpreter_suspend (void *data) return 1; } -static int -mi_interpreter_delete (void *data) -{ - return 1; -} - static int mi_interpreter_exec (void *data, char *command) { @@ -424,7 +417,6 @@ _initialize_mi_interp (void) mi_interpreter_init, /* init_proc */ mi_interpreter_resume, /* resume_proc */ mi_interpreter_suspend, /* suspend_proc */ - mi_interpreter_delete, /* delete_proc */ mi_interpreter_exec, /* exec_proc */ mi_interpreter_prompt /* prompt_proc */ }; -- 2.47.2