From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRPH5-0001Y0-6A for qemu-devel@nongnu.org; Sun, 03 Jan 2010 07:09:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRPH0-0001Pq-4A for qemu-devel@nongnu.org; Sun, 03 Jan 2010 07:09:34 -0500 Received: from [199.232.76.173] (port=46876 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRPGz-0001Pc-St for qemu-devel@nongnu.org; Sun, 03 Jan 2010 07:09:29 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:51631) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRPGz-0007Nd-LW for qemu-devel@nongnu.org; Sun, 03 Jan 2010 07:09:29 -0500 Received: by fxm22 with SMTP id 22so17224972fxm.2 for ; Sun, 03 Jan 2010 04:09:28 -0800 (PST) Received: from localhost ([127.0.0.1] helo=[192.168.1.2]) by skyserv with esmtp (Exim 4.71) (envelope-from ) id 1NRPGx-0007j6-2R for qemu-devel@nongnu.org; Sun, 03 Jan 2010 15:09:27 +0300 From: "Igor V. Kovalenko" Date: Sun, 03 Jan 2010 15:09:27 +0300 Message-ID: <20100103120926.29681.1917.stgit@skyserv> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] pass env to raise_exception if called outside of op_helper code List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Igor V. Kovalenko - this fixes stepping with gdb, where do_unassigned_access may be called from gdb handler, outside of generated code Signed-off-by: Igor V. Kovalenko --- target-sparc/op_helper.c | 7 +++++-- 1 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, void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec, int is_asi, int size) { -#ifdef DEBUG_UNASSIGNED CPUState *saved_env; /* XXX: hack to restore env in all cases, even if not called from generated code */ saved_env = env; env = cpu_single_env; + +#ifdef DEBUG_UNASSIGNED printf("Unassigned mem access to " TARGET_FMT_plx " from " TARGET_FMT_lx "\n", addr, env->pc); - env = saved_env; #endif + if (is_exec) raise_exception(TT_CODE_ACCESS); else raise_exception(TT_DATA_ACCESS); + + env = saved_env; } #endif