mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
Refactor start_inferior
This patch is to refactor function start_inferior that signal_pid is return in one place. gdb/gdbserver: 2015-07-24 Yao Qi <yao.qi@linaro.org> * server.c (start_inferior): Code refactor.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2015-07-24 Yao Qi <yao.qi@linaro.org>
|
||||||
|
|
||||||
|
* server.c (start_inferior): Code refactor.
|
||||||
|
|
||||||
2015-07-24 Yao Qi <yao.qi@linaro.org>
|
2015-07-24 Yao Qi <yao.qi@linaro.org>
|
||||||
|
|
||||||
* server.c (process_serial_event): Set general_thread.
|
* server.c (process_serial_event): Set general_thread.
|
||||||
|
@ -257,22 +257,21 @@ start_inferior (char **argv)
|
|||||||
|
|
||||||
last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
|
last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
|
||||||
|
|
||||||
if (last_status.kind != TARGET_WAITKIND_STOPPED)
|
if (last_status.kind == TARGET_WAITKIND_STOPPED)
|
||||||
return signal_pid;
|
{
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
(*the_target->resume) (&resume_info, 1);
|
(*the_target->resume) (&resume_info, 1);
|
||||||
|
|
||||||
last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
|
last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
|
||||||
if (last_status.kind != TARGET_WAITKIND_STOPPED)
|
if (last_status.kind != TARGET_WAITKIND_STOPPED)
|
||||||
return signal_pid;
|
break;
|
||||||
|
|
||||||
current_thread->last_resume_kind = resume_stop;
|
current_thread->last_resume_kind = resume_stop;
|
||||||
current_thread->last_status = last_status;
|
current_thread->last_status = last_status;
|
||||||
}
|
}
|
||||||
while (last_status.value.sig != GDB_SIGNAL_TRAP);
|
while (last_status.value.sig != GDB_SIGNAL_TRAP);
|
||||||
|
}
|
||||||
return signal_pid;
|
return signal_pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user