some cleanup checker fixes
Fix some bugs pointed out by the cleanup checker. This one just fixes some simple CLI reports, where CLI commands know that their caller will do cleanups. This an older style with few instances, so it is simpler to fix them up than to teach the checker about it. * cli/cli-cmds.c (cd_command, alias_command): Call do_cleanups. * cli/cli-dump.c (restore_binary_file): Call do_cleanups. * interps.c (interpreter_exec_cmd): Call do_cleanups. * source.c (show_substitute_path_command): Call do_cleanups. (unset_substitute_path_command, set_substitute_path_command): Likewise. * symfile.c (load_command): Call do_cleanups.
This commit is contained in:
parent
af83e3f886
commit
5b3fca71ae
6 changed files with 40 additions and 7 deletions
|
@ -409,12 +409,13 @@ interpreter_exec_cmd (char *args, int from_tty)
|
|||
unsigned int nrules;
|
||||
unsigned int i;
|
||||
int old_quiet, use_quiet;
|
||||
struct cleanup *cleanup;
|
||||
|
||||
if (args == NULL)
|
||||
error_no_arg (_("interpreter-exec command"));
|
||||
|
||||
prules = gdb_buildargv (args);
|
||||
make_cleanup_freeargv (prules);
|
||||
cleanup = make_cleanup_freeargv (prules);
|
||||
|
||||
nrules = 0;
|
||||
for (trule = prules; *trule != NULL; trule++)
|
||||
|
@ -452,6 +453,8 @@ interpreter_exec_cmd (char *args, int from_tty)
|
|||
interp_set (old_interp, 0);
|
||||
interp_set_quiet (interp_to_use, use_quiet);
|
||||
interp_set_quiet (old_interp, old_quiet);
|
||||
|
||||
do_cleanups (cleanup);
|
||||
}
|
||||
|
||||
/* List the possible interpreters which could complete the given text. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue