eval_compile_command (NULL, arg, scope, NULL);
else
{
- struct command_line *l = get_command_line (compile_control, "");
- struct cleanup *cleanup = make_cleanup_free_command_lines (&l);
+ command_line_up l = get_command_line (compile_control, "");
l->control_u.compile.scope = scope;
- execute_control_command_untraced (l);
- do_cleanups (cleanup);
+ execute_control_command_untraced (l.get ());
}
}
eval_compile_command (NULL, arg, scope, &fmt);
else
{
- struct command_line *l = get_command_line (compile_control, "");
- struct cleanup *cleanup = make_cleanup_free_command_lines (&l);
+ command_line_up l = get_command_line (compile_control, "");
l->control_u.compile.scope = scope;
l->control_u.compile.scope_data = &fmt;
- execute_control_command_untraced (l);
- do_cleanups (cleanup);
+ execute_control_command_untraced (l.get ());
}
}
compile_file_names fnames = get_new_file_names ();
- src = gdb_fopen_cloexec (fnames.source_file (), "w");
- if (src == NULL)
- perror_with_name (_("Could not open source file for writing"));
- inner_cleanup = make_cleanup (cleanup_unlink_file,
- (void *) fnames.source_file ());
- if (fputs (code.c_str (), src) == EOF)
- perror_with_name (_("Could not write to source file"));
- fclose (src);
+ {
+ gdb_file_up src = gdb_fopen_cloexec (fnames.source_file (), "w");
+ if (src == NULL)
+ perror_with_name (_("Could not open source file for writing"));
+ inner_cleanup = make_cleanup (cleanup_unlink_file,
+ (void *) fnames.source_file ());
+ if (fputs (code.c_str (), src.get ()) == EOF)
+ perror_with_name (_("Could not write to source file"));
+ }
if (compile_debug)
fprintf_unfiltered (gdb_stdlog, "source file produced: %s\n\n",