[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 14/14] Add support for the arm breakpoint syscall
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 14/14] Add support for the arm breakpoint syscall |
Date: |
Tue, 24 Jun 2014 20:09:20 +0400 |
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: Michael Tokarev <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 df1bb0e..900a17f 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -806,6 +806,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);
@@ -849,6 +852,7 @@ void cpu_loop(CPUARMState *env)
}
break;
case EXCP_DEBUG:
+ excp_debug:
{
int sig;
--
1.7.10.4
- [Qemu-trivial] [PULL 00/14] Trivial patches for 2014-06-24, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 06/14] block.c: Remove useless 'buf' variable, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 02/14] Fix new typos (found by codespell), Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 01/14] virtio-serial: remove useless set_config function, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 07/14] rng-random: NULL check not needed before g_free(), Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 03/14] configure: Enable TPM by default, add --disable-tpm, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 14/14] Add support for the arm breakpoint syscall,
Michael Tokarev <=
- [Qemu-trivial] [PULL 12/14] target-s390x: Remove unused ld_code6() function, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 08/14] tcg: mark tcg_out* and tcg_patch* with attribute 'unused', Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 13/14] Increase maximum number of session of the internal TFTP server., Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 10/14] target-unicore: Remove unused functions, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 05/14] vscclient: Add required headers to fix build on FreeBSD, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 09/14] build-sys: introduce install-prog macro to install&strip binaries and use it, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 04/14] target-ppc: Fix compiler warning, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 11/14] hw/moxie/moxiesim.c: Remove unused moxie_intc_create(), Michael Tokarev, 2014/06/24
- Re: [Qemu-trivial] [Qemu-devel] [PULL 00/14] Trivial patches for 2014-06-24, Peter Maydell, 2014/06/24