[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/19] Add support for the arm breakpoint syscall
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 02/19] Add support for the arm breakpoint syscall |
Date: |
Mon, 23 Jun 2014 16:26:17 +0300 |
From: Hunter Laux <address@hidden>
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#L598
Signed-off-by: Hunter Laux <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/arm/syscall.h | 1 +
linux-user/main.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/linux-user/arm/syscall.h b/linux-user/arm/syscall.h
index ce2c2a8..e0d2cc3 100644
--- a/linux-user/arm/syscall.h
+++ b/linux-user/arm/syscall.h
@@ -29,6 +29,7 @@ struct target_pt_regs {
#define ARM_THUMB_SYSCALL 0
#define ARM_NR_BASE 0xf0000
+#define ARM_NR_breakpoint (ARM_NR_BASE + 1)
#define ARM_NR_cacheflush (ARM_NR_BASE + 2)
#define ARM_NR_set_tls (ARM_NR_BASE + 5)
diff --git a/linux-user/main.c b/linux-user/main.c
index a87c6f7..9c3eddc 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -807,6 +807,9 @@ void cpu_loop(CPUARMState *env)
cpu_set_tls(env, env->regs[0]);
env->regs[0] = 0;
break;
+ case ARM_NR_breakpoint:
+ env->regs[15] -= env->thumb ? 2 : 4;
+ goto excp_debug;
default:
gemu_log("qemu: Unsupported ARM syscall: 0x%x\n",
n);
@@ -850,6 +853,7 @@ void cpu_loop(CPUARMState *env)
}
break;
case EXCP_DEBUG:
+ excp_debug:
{
int sig;
--
2.0.0
- [Qemu-devel] [PULL 00/19] linux-user changes for 2.1, riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 02/19] Add support for the arm breakpoint syscall,
riku . voipio <=
- [Qemu-devel] [PULL 04/19] linux-user: translate the result of getsockopt SO_TYPE, riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 03/19] linux-user: added fake open() for /proc/self/cmdline, riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 09/19] linux-user: support strace of epoll_create1, riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 10/19] linux-user: fix struct target_epoll_event layout for MIPS, riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 13/19] linux-user: support timerfd_{create, gettime, settime} syscalls, riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 01/19] Add support for MAP_NORESERVE mmap flag., riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 17/19] linux-user: support the unshare syscall, riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 12/19] linux-user: allow NULL tv argument for settimeofday, riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 11/19] linux-user: respect timezone for settimeofday, riku . voipio, 2014/06/23
- [Qemu-devel] [PULL 05/19] linux-user: support SO_ACCEPTCONN getsockopt option, riku . voipio, 2014/06/23