try_open_exec_file (const char *exec_file_host, struct inferior *inf,
symfile_add_flags add_flags)
{
- struct gdb_exception prev_err = exception_none;
+ struct gdb_exception prev_err;
/* exec_file_attach and symbol_file_add_main may throw an error if the file
cannot be opened either locally or remotely.
exec_file_attach will clear state. */
exec_file_attach (exec_file_host, add_flags & SYMFILE_VERBOSE);
}
- catch (const gdb_exception_error &err)
+ catch (gdb_exception_error &err)
{
if (err.message != NULL)
warning ("%s", err.what ());
- prev_err = err;
+ prev_err = std::move (err);
}
if (exec_file_host != NULL)