提交 c52a6b67 编写于 作者: A Andreas Färber

gdbstub: Simplify find_cpu()

Use qemu_get_cpu() and CPUState::env_ptr.
Reviewed-by: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 8d0f2bae
......@@ -2071,17 +2071,13 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
static CPUArchState *find_cpu(uint32_t thread_id)
{
CPUArchState *env;
CPUState *cpu;
for (env = first_cpu; env != NULL; env = env->next_cpu) {
cpu = ENV_GET_CPU(env);
if (cpu_index(cpu) == thread_id) {
return env;
}
cpu = qemu_get_cpu(thread_id);
if (cpu == NULL) {
return NULL;
}
return NULL;
return cpu->env_ptr;
}
static int gdb_handle_packet(GDBState *s, const char *line_buf)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册