cpu: Initialize breakpoint/watchpoint lists in cpu_common_initfn()

One small step in the simplification of cpu_exec_init().

Backports commit 7c39163e389e6e6e16965606fb5a26abcdb6ad73 from qemu
This commit is contained in:
Eduardo Habkost 2018-02-14 13:34:23 -05:00 committed by Lioncash
parent 4e39fabd4d
commit 79c95aa18b
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 4 additions and 3 deletions

View file

@ -411,9 +411,6 @@ void cpu_exec_init(CPUArchState *env, void *opaque)
env->uc = uc;
cpu->cpu_index = 0;
QTAILQ_INIT(&cpu->breakpoints);
QTAILQ_INIT(&cpu->watchpoints);
cpu->as = &uc->as;
// TODO: assert uc does not already have a cpu?

View file

@ -226,6 +226,10 @@ static int cpu_common_realizefn(struct uc_struct *uc, DeviceState *dev, Error **
static void cpu_common_initfn(struct uc_struct *uc, Object *obj, void *opaque)
{
CPUState *cpu = CPU(obj);
QTAILQ_INIT(&cpu->breakpoints);
QTAILQ_INIT(&cpu->watchpoints);
}
static int64_t cpu_common_get_arch_id(CPUState *cpu)