pass env to raise_exception if called outside of op_helper code
PATCH 1/1 pass env to raise_exception if called outside of op_helper code
From: Igor V. Kovalenko <[email protected]>
- this fixes stepping with gdb, where do_unassigned_access may be called from gdb handler, outside of generated code
--- target-sparc/op_helper.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
target-sparc/op_helper.c +5 -2
@@ -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
Blue Swirl
AppliedThanks, applied.
Quoted 45 lines · Igor V. Kovalenko
From: Igor V. Kovalenko <[email protected]>
- this fixes stepping with gdb, where
do_unassigned_accessmay be called from gdb handler, outside of generated codeSigned-off-by Igor V. Kovalenko <[email protected]>---
target-sparc/op_helper.c | 7 +++++--1 files changed, 5 insertions(+), 2 deletions(-)target-sparc/op_helper.c +0
-1@@ -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 fromgenerated code */
saved_env= env;
env =cpu_single_env;target-sparc/op_helper.c +2
-0+ +#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