mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-04 12:36:30 +00:00
Fix file reopen in debug mode ood/doo (#16131) ##debug
This commit is contained in:
parent
5e1d5faebd
commit
0cacc6e829
@ -75,7 +75,8 @@ R_API int r_core_file_reopen(RCore *core, const char *args, int perm, int loadbi
|
||||
int newpid = odesc? odesc->fd: -1;
|
||||
|
||||
if (isdebug) {
|
||||
r_debug_kill (core->dbg, core->dbg->pid, core->dbg->tid, 9); // KILL
|
||||
r_debug_kill (core->dbg, core->dbg->pid, core->dbg->tid, 9); // SIGKILL
|
||||
r_debug_continue (core->dbg);
|
||||
perm = 7;
|
||||
} else {
|
||||
if (!perm) {
|
||||
|
@ -1117,9 +1117,9 @@ R_API void r_core_file_reopen_debug(RCore *core, const char *args) {
|
||||
char *newfile = r_str_newf ("dbg://%s %s", escaped_path, args);
|
||||
desc->uri = newfile;
|
||||
desc->referer = NULL;
|
||||
r_core_file_reopen (core, newfile, 0, 2);
|
||||
r_config_set_i (core->config, "asm.bits", bits);
|
||||
r_config_set_i (core->config, "cfg.debug", true);
|
||||
r_core_file_reopen (core, newfile, 0, 2);
|
||||
if (r_config_get_i (core->config, "dbg.rebase")) {
|
||||
__rebase_everything (core, old_sections, old_base);
|
||||
}
|
||||
|
@ -427,6 +427,8 @@ repeat:
|
||||
if (WIFEXITED (status)) {
|
||||
eprintf ("child exited with status %d\n", WEXITSTATUS (status));
|
||||
if (pid == dbg->main_pid) {
|
||||
r_list_free (dbg->threads);
|
||||
dbg->threads = NULL;
|
||||
reason = R_DEBUG_REASON_DEAD;
|
||||
} else {
|
||||
reason = R_DEBUG_REASON_EXIT_TID;
|
||||
|
@ -26,6 +26,21 @@ dbg:///bin/ls
|
||||
EOF
|
||||
RUN
|
||||
|
||||
NAME= ood after open in debug mode
|
||||
FILE=../bins/elf/analysis/x86-helloworld-gcc
|
||||
ARGS=-d
|
||||
CMDS=<<EOF
|
||||
ood > $_
|
||||
dc
|
||||
ood > $_
|
||||
dc
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
Hello world!
|
||||
Hello world!
|
||||
EOF
|
||||
RUN
|
||||
|
||||
NAME=oo ; dc
|
||||
FILE=../bins/elf/analysis/x86-helloworld-gcc
|
||||
ARGS=-d
|
||||
|
Loading…
x
Reference in New Issue
Block a user