Tell the user that debugging projects don't work ##projects (#18134)

This commit is contained in:
RHL120 2020-12-31 15:35:40 +01:00 committed by GitHub
parent c551ddb203
commit b2117e48c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -658,8 +658,8 @@ static bool project_save_script(RCore *core, const char *file, int opts) {
r_cons_singleton ()->fdout = fd;
r_cons_singleton ()->context->is_interactive = false;
r_str_write (fd, "# r2 rdb project file\n");
if (!core->bin->is_debugger && !r_config_get_i (core->config, "asm.emu")) {
if (core->bin->file) {
if (core->bin->file) {
if (!r_config_get_i (core->config, "asm.emu")) {
char *fpath = r_file_abspath (core->bin->file);
if (fpath) {
char *reopen = r_str_newf ("\"o %s\"\n", fpath);
@ -772,8 +772,12 @@ R_API bool r_core_project_save(RCore *core, const char *prj_name) {
SdbListIter *it;
SdbNs *ns;
char *old_prj_name = NULL;
r_return_val_if_fail(prj_name && *prj_name, false);
r_return_val_if_fail (prj_name && *prj_name, false);
script_path = get_project_script_path (core, prj_name);
if (r_config_get_i (core->config, "cfg.debug")) {
eprintf ("radare2 does not support projects on debugged bins\n");
return false;
}
if (!script_path) {
eprintf ("Invalid project name '%s'\n", prj_name);
return false;