Skip to content

Commit

Permalink
bsd-user: Update cpu_copy() to use new cpu_init().
Browse files Browse the repository at this point in the history
  • Loading branch information
staceyson committed May 28, 2015
1 parent b7d6d72 commit bdffcf3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions bsd-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,14 @@ void init_task_state(TaskState *ts)

CPUArchState *cpu_copy(CPUArchState *env)
{
CPUArchState *new_env = cpu_init(cpu_model);
CPUState *cpu = ENV_GET_CPU(env);
#if defined(TARGET_HAS_ICE)
CPUState *new_cpu = cpu_init(cpu_model);
CPUArchState *new_env = new_cpu->env_ptr;
CPUBreakpoint *bp;
CPUWatchpoint *wp;
#endif

/* Reset non arch specific state */
cpu_reset(ENV_GET_CPU(new_env));
cpu_reset(new_cpu);

memcpy(new_env, env, sizeof(CPUArchState));

Expand All @@ -294,15 +293,12 @@ CPUArchState *cpu_copy(CPUArchState *env)
BP_CPU break/watchpoints are handled correctly on clone. */
QTAILQ_INIT(&cpu->breakpoints);
QTAILQ_INIT(&cpu->watchpoints);
#if defined(TARGET_HAS_ICE)
QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
cpu_breakpoint_insert(cpu, bp->pc, bp->flags, NULL);
cpu_breakpoint_insert(new_cpu, bp->pc, bp->flags, NULL);
}
QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) {
cpu_watchpoint_insert(cpu, wp->vaddr, (~wp->len) + 1,
wp->flags, NULL);
cpu_watchpoint_insert(new_cpu, wp->vaddr, wp->len, wp->flags, NULL);
}
#endif

return new_env;
}
Expand Down

0 comments on commit bdffcf3

Please sign in to comment.