From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRPW3-0002bE-DC for qemu-devel@nongnu.org; Sun, 03 Jan 2010 07:25:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRPVy-0002X6-KZ for qemu-devel@nongnu.org; Sun, 03 Jan 2010 07:25:02 -0500 Received: from [199.232.76.173] (port=53643 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRPVy-0002Ww-D3 for qemu-devel@nongnu.org; Sun, 03 Jan 2010 07:24:58 -0500 Received: from mail-pz0-f188.google.com ([209.85.222.188]:44168) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRPVy-0004he-8P for qemu-devel@nongnu.org; Sun, 03 Jan 2010 07:24:58 -0500 Received: by pzk26 with SMTP id 26so9031551pzk.4 for ; Sun, 03 Jan 2010 04:24:57 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20100103120926.29681.1917.stgit@skyserv> References: <20100103120926.29681.1917.stgit@skyserv> From: Blue Swirl Date: Sun, 3 Jan 2010 12:24:37 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH] pass env to raise_exception if called outside of op_helper code Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Igor V. Kovalenko" Cc: qemu-devel@nongnu.org Thanks, applied. On Sun, Jan 3, 2010 at 12:09 PM, Igor V. Kovalenko wrote: > From: Igor V. Kovalenko > > - this fixes stepping with gdb, where do_unassigned_access > =C2=A0may be called from gdb handler, outside of generated code > > Signed-off-by: Igor V. Kovalenko > --- > =C2=A0target-sparc/op_helper.c | =C2=A0 =C2=A07 +++++-- > =C2=A01 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c > index 4e0a0e3..bd01a5e 100644 > --- a/target-sparc/op_helper.c > +++ b/target-sparc/op_helper.c > @@ -3686,21 +3686,24 @@ void do_unassigned_access(target_phys_addr_t addr= , int is_write, int is_exec, > =C2=A0void do_unassigned_access(target_phys_addr_t addr, int is_write, in= t is_exec, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 int is_asi, int size) > =C2=A0{ > -#ifdef DEBUG_UNASSIGNED > =C2=A0 =C2=A0 CPUState *saved_env; > > =C2=A0 =C2=A0 /* XXX: hack to restore env in all cases, even if not calle= d from > =C2=A0 =C2=A0 =C2=A0 =C2=A0generated code */ > =C2=A0 =C2=A0 saved_env =3D env; > =C2=A0 =C2=A0 env =3D cpu_single_env; > + > +#ifdef DEBUG_UNASSIGNED > =C2=A0 =C2=A0 printf("Unassigned mem access to " TARGET_FMT_plx " from " = TARGET_FMT_lx > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"\n", addr, env->pc); > - =C2=A0 =C2=A0env =3D saved_env; > =C2=A0#endif > + > =C2=A0 =C2=A0 if (is_exec) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 raise_exception(TT_CODE_ACCESS); > =C2=A0 =C2=A0 else > =C2=A0 =C2=A0 =C2=A0 =C2=A0 raise_exception(TT_DATA_ACCESS); > + > + =C2=A0 =C2=A0env =3D saved_env; > =C2=A0} > =C2=A0#endif > > > > >