X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Finterps.c;h=63a123042e284d1596086e3de39ab72d4927f4e0;hb=be0d7abb5e3b0be4cb928845e70a9134f1b19700;hp=4de7c4e8be6c48d4b266943e06f4ba90c3babaf5;hpb=eb3ff9a55175dcdac8328b558d54951a14d719b1;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/interps.c b/gdb/interps.c index 4de7c4e8be..63a123042e 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -74,8 +74,6 @@ get_current_interp_info (void) /* The magic initialization routine for this module. */ -void _initialize_interpreter (void); - static struct interp *interp_lookup_existing (struct ui *ui, const char *name); @@ -290,7 +288,7 @@ current_interp_set_logging (ui_file_up logfile, /* Temporarily overrides the current interpreter. */ struct interp * -interp_set_temp (const char *name) +scoped_restore_interp::set_interp (const char *name) { struct ui_interp_info *ui_interp = get_current_interp_info (); struct interp *interp = interp_lookup (current_ui, name); @@ -407,21 +405,14 @@ interpreter_exec_cmd (char *args, int from_tty) { struct ui_interp_info *ui_interp = get_current_interp_info (); struct interp *old_interp, *interp_to_use; - char **prules = NULL; - char **trule = NULL; unsigned int nrules; unsigned int i; - struct cleanup *cleanup; if (args == NULL) error_no_arg (_("interpreter-exec command")); - prules = gdb_buildargv (args); - cleanup = make_cleanup_freeargv (prules); - - nrules = 0; - for (trule = prules; *trule != NULL; trule++) - nrules++; + gdb_argv prules (args); + nrules = prules.count (); if (nrules < 2) error (_("usage: interpreter-exec [ ... ]")); @@ -446,8 +437,6 @@ interpreter_exec_cmd (char *args, int from_tty) } interp_set (old_interp, 0); - - do_cleanups (cleanup); } /* See interps.h. */