* [Qemu-devel] [PATCH v2] Add support for the arm breakpoint syscall
@ 2014-06-20 11:13 Hunter Laux
2014-06-20 11:16 ` Peter Maydell
2014-06-24 15:58 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
0 siblings, 2 replies; 5+ messages in thread
From: Hunter Laux @ 2014-06-20 11:13 UTC (permalink / raw)
To: qemu-devel, qemu-trivial, riku.voipio, peter.maydell; +Cc: Hunter Laux
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 <hunterlaux@gmail.com>
---
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;
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v2] Add support for the arm breakpoint syscall
2014-06-20 11:13 [Qemu-devel] [PATCH v2] Add support for the arm breakpoint syscall Hunter Laux
@ 2014-06-20 11:16 ` Peter Maydell
2014-06-24 15:58 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
1 sibling, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2014-06-20 11:16 UTC (permalink / raw)
To: Hunter Laux; +Cc: QEMU Trivial, Riku Voipio, QEMU Developers
On 20 June 2014 12:13, Hunter Laux <hunterlaux@gmail.com> wrote:
> 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 <hunterlaux@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] Add support for the arm breakpoint syscall
2014-06-20 11:13 [Qemu-devel] [PATCH v2] Add support for the arm breakpoint syscall Hunter Laux
2014-06-20 11:16 ` Peter Maydell
@ 2014-06-24 15:58 ` Michael Tokarev
2014-06-24 18:54 ` Riku Voipio
1 sibling, 1 reply; 5+ messages in thread
From: Michael Tokarev @ 2014-06-24 15:58 UTC (permalink / raw)
To: Hunter Laux, qemu-devel, qemu-trivial, riku.voipio, peter.maydell
20.06.2014 15:13, Hunter Laux wrote:
> 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.
Applied to -trivial, despite the ugliness with the goto. Oh well.
Thank you!
/mjt
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] Add support for the arm breakpoint syscall
2014-06-24 15:58 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
@ 2014-06-24 18:54 ` Riku Voipio
2014-06-25 8:20 ` Michael Tokarev
0 siblings, 1 reply; 5+ messages in thread
From: Riku Voipio @ 2014-06-24 18:54 UTC (permalink / raw)
To: Michael Tokarev
Cc: qemu-trivial, peter.maydell, riku.voipio, Hunter Laux, qemu-devel
On Tue, Jun 24, 2014 at 07:58:36PM +0400, Michael Tokarev wrote:
> 20.06.2014 15:13, Hunter Laux wrote:
> > 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.
> Applied to -trivial, despite the ugliness with the goto. Oh well.
It was already in my yesterdays linux-user pull req ( which I need
to resend with the name_to_handle_at/open_by_handle_at syscalls fixed ).
Riku
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] Add support for the arm breakpoint syscall
2014-06-24 18:54 ` Riku Voipio
@ 2014-06-25 8:20 ` Michael Tokarev
0 siblings, 0 replies; 5+ messages in thread
From: Michael Tokarev @ 2014-06-25 8:20 UTC (permalink / raw)
To: Riku Voipio; +Cc: qemu-trivial, peter.maydell, Hunter Laux, qemu-devel
24.06.2014 22:54, Riku Voipio wrote:
> On Tue, Jun 24, 2014 at 07:58:36PM +0400, Michael Tokarev wrote:
>> 20.06.2014 15:13, Hunter Laux wrote:
>>> 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.
>
>> Applied to -trivial, despite the ugliness with the goto. Oh well.
>
> It was already in my yesterdays linux-user pull req ( which I need
> to resend with the name_to_handle_at/open_by_handle_at syscalls fixed ).
If it is the same patch, git should do the Right Thing when
pulling your branch, without causing conflicts.
You could notify me about you applying this patch to -linux-user
branch. I haven't noticed this patch in your pull req, -- I don't
always watch all pull requests.
Thanks,
/mjt
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-25 8:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-20 11:13 [Qemu-devel] [PATCH v2] Add support for the arm breakpoint syscall Hunter Laux
2014-06-20 11:16 ` Peter Maydell
2014-06-24 15:58 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-06-24 18:54 ` Riku Voipio
2014-06-25 8:20 ` Michael Tokarev
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).