From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNAdr-0007L8-9P for qemu-devel@nongnu.org; Wed, 14 Jan 2009 13:39:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNAdp-0007Kh-Pg for qemu-devel@nongnu.org; Wed, 14 Jan 2009 13:39:03 -0500 Received: from [199.232.76.173] (port=53332 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNAdp-0007Ka-KG for qemu-devel@nongnu.org; Wed, 14 Jan 2009 13:39:01 -0500 Received: from soufre.accelance.net ([213.162.48.15]:59766) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LNAdp-0000jp-4A for qemu-devel@nongnu.org; Wed, 14 Jan 2009 13:39:01 -0500 Received: from [192.168.0.3] (potipota.net [88.168.176.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by soufre.accelance.net (Postfix) with ESMTP id DDDBF4507C for ; Wed, 14 Jan 2009 19:38:57 +0100 (CET) Subject: Re: [Qemu-devel] [RESEND][PATCH] Adopt cpu_copy to new breakpoint API From: Lionel Landwerlin In-Reply-To: <496DE65A.9050609@web.de> References: <496DE65A.9050609@web.de> Content-Type: text/plain; charset=utf-8 Date: Wed, 14 Jan 2009 19:38:56 +0100 Message-Id: <1231958336.3905.5.camel@cocoduo.atr> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Le mercredi 14 janvier 2009 =C3=A0 14:19 +0100, Jan Kiszka a =C3=A9crit : > [ Also available via git://git.kiszka.org/qemu.git queue/gdb ] >=20 > Latest changes to the cpu_breakpoint/watchpoint API broke cpu_copy. Thi= s > patch fixes it by cloning the breakpoint and watchpoint lists > appropriately. >=20 > Thanks to Lionel Landwerlin for pointing out. >=20 > Signed-off-by: Jan Kiszka Thanks for resending Acked-by: Lionel Landwerlin --- >=20 > exec.c | 24 +++++++++++++++++++++++- > 1 files changed, 23 insertions(+), 1 deletions(-) >=20 > diff --git a/exec.c b/exec.c > index e633b74..d6fa977 100644 > --- a/exec.c > +++ b/exec.c > @@ -1654,12 +1654,34 @@ void cpu_abort(CPUState *env, const char *fmt, = ...) > CPUState *cpu_copy(CPUState *env) > { > CPUState *new_env =3D cpu_init(env->cpu_model_str); > - /* preserve chaining and index */ > CPUState *next_cpu =3D new_env->next_cpu; > int cpu_index =3D new_env->cpu_index; > +#if defined(TARGET_HAS_ICE) > + CPUBreakpoint *bp; > + CPUWatchpoint *wp; > +#endif > + > memcpy(new_env, env, sizeof(CPUState)); > + > + /* Preserve chaining and index. */ > new_env->next_cpu =3D next_cpu; > new_env->cpu_index =3D cpu_index; > + > + /* Clone all break/watchpoints. > + Note: Once we support ptrace with hw-debug register access, mak= e sure > + BP_CPU break/watchpoints are handled correctly on clone. */ > + TAILQ_INIT(&env->breakpoints); > + TAILQ_INIT(&env->watchpoints); > +#if defined(TARGET_HAS_ICE) > + TAILQ_FOREACH(bp, &env->breakpoints, entry) { > + cpu_breakpoint_insert(new_env, bp->pc, bp->flags, NULL); > + } > + TAILQ_FOREACH(wp, &env->watchpoints, entry) { > + cpu_watchpoint_insert(new_env, wp->vaddr, (~wp->len_mask) + 1, > + wp->flags, NULL); > + } > +#endif > + > return new_env; > } > =20 >=20 >=20