* [Qemu-devel] [PATCH] pass env to raise_exception if called outside of op_helper code
@ 2010-01-03 12:09 Igor V. Kovalenko
2010-01-03 12:24 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Igor V. Kovalenko @ 2010-01-03 12:09 UTC (permalink / raw)
To: qemu-devel
From: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
- 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 <igor.v.kovalenko@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] pass env to raise_exception if called outside of op_helper code
2010-01-03 12:09 [Qemu-devel] [PATCH] pass env to raise_exception if called outside of op_helper code Igor V. Kovalenko
@ 2010-01-03 12:24 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2010-01-03 12:24 UTC (permalink / raw)
To: Igor V. Kovalenko; +Cc: qemu-devel
Thanks, applied.
On Sun, Jan 3, 2010 at 12:09 PM, Igor V. Kovalenko
<igor.v.kovalenko@gmail.com> wrote:
> From: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
>
> - 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 <igor.v.kovalenko@gmail.com>
> ---
> 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
>
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-03 12:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03 12:09 [Qemu-devel] [PATCH] pass env to raise_exception if called outside of op_helper code Igor V. Kovalenko
2010-01-03 12:24 ` Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).