提交 d5355087 编写于 作者: H Hunter Laux 提交者: Michael Tokarev

Add support for the arm breakpoint syscall

OABI arm used a software interrupt(0xef9f0001) for breakpoints.
Since 2005 gdb has used the break instruction(0xe7f001f0) for EABI.
Apparently Steel Bank Common Lisp still uses the swi instruction.

This is the kernel implementation:
http://lxr.free-electrons.com/source/arch/arm/kernel/traps.c#L598Signed-off-by: NHunter Laux <hunterlaux@gmail.com>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 5f22b054
...@@ -29,6 +29,7 @@ struct target_pt_regs { ...@@ -29,6 +29,7 @@ struct target_pt_regs {
#define ARM_THUMB_SYSCALL 0 #define ARM_THUMB_SYSCALL 0
#define ARM_NR_BASE 0xf0000 #define ARM_NR_BASE 0xf0000
#define ARM_NR_breakpoint (ARM_NR_BASE + 1)
#define ARM_NR_cacheflush (ARM_NR_BASE + 2) #define ARM_NR_cacheflush (ARM_NR_BASE + 2)
#define ARM_NR_set_tls (ARM_NR_BASE + 5) #define ARM_NR_set_tls (ARM_NR_BASE + 5)
......
...@@ -806,6 +806,9 @@ void cpu_loop(CPUARMState *env) ...@@ -806,6 +806,9 @@ void cpu_loop(CPUARMState *env)
cpu_set_tls(env, env->regs[0]); cpu_set_tls(env, env->regs[0]);
env->regs[0] = 0; env->regs[0] = 0;
break; break;
case ARM_NR_breakpoint:
env->regs[15] -= env->thumb ? 2 : 4;
goto excp_debug;
default: default:
gemu_log("qemu: Unsupported ARM syscall: 0x%x\n", gemu_log("qemu: Unsupported ARM syscall: 0x%x\n",
n); n);
...@@ -849,6 +852,7 @@ void cpu_loop(CPUARMState *env) ...@@ -849,6 +852,7 @@ void cpu_loop(CPUARMState *env)
} }
break; break;
case EXCP_DEBUG: case EXCP_DEBUG:
excp_debug:
{ {
int sig; int sig;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册