mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-02 10:16:21 +00:00
Fix #10500 - oo reopens without debugger
This commit is contained in:
parent
2745486b16
commit
15ff90059f
@ -28,7 +28,7 @@ R_API int r_bin_open(RBin *bin, const char *filename, RBinOptions *bo) {
|
||||
rawstr = bo->rawstr;
|
||||
}
|
||||
if (r_bin_load (bin, filename, baddr, laddr, xtr_idx, iofd, rawstr)) {
|
||||
int id = bin->cur->id;
|
||||
int id = bin->cur->id; // TODO rename to bd?
|
||||
r_id_storage_set (bin->ids, bin->cur, id);
|
||||
return id;
|
||||
}
|
||||
|
@ -1440,7 +1440,21 @@ static int cmd_open(void *data, const char *input) {
|
||||
} else {
|
||||
fd = core->io->desc->fd;
|
||||
}
|
||||
r_io_reopen (core->io, fd, R_IO_READ, 644);
|
||||
if (r_config_get_i (core->config, "cfg.debug")) {
|
||||
RBinFile *bf = r_core_bin_cur (core);
|
||||
if (bf && r_file_exists (bf->file)) {
|
||||
char *file = strdup (bf->file);
|
||||
r_core_cmd0 (core, "ob-*");
|
||||
r_io_close_all (core->io);
|
||||
r_config_set (core->config, "cfg.debug", "false");
|
||||
r_core_cmdf (core, "o %s", file);
|
||||
free (file);
|
||||
} else {
|
||||
eprintf ("Nothing to do.\n");
|
||||
}
|
||||
} else {
|
||||
r_io_reopen (core->io, fd, R_IO_READ, 644);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '?':
|
||||
|
Loading…
Reference in New Issue
Block a user