kdb
[Top] [All Lists]

[PATCH 37/37] kgdbts,sh: Add in breakpoint pc offset for superh

To: linux-kernel@xxxxxxxxxxxxxxx
Subject: [PATCH 37/37] kgdbts,sh: Add in breakpoint pc offset for superh
From: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
Date: Wed, 23 Dec 2009 15:43:04 -0600
Cc: kgdb-bugreport@xxxxxxxxxxxxxxxxxxxxx, kdb@xxxxxxxxxxx, mingo@xxxxxxx, Jason Wessel <jason.wessel@xxxxxxxxxxxxx>, Paul Mundt <lethal@xxxxxxxxxxxx>
In-reply-to: <1261604584-5796-4-git-send-email-jason.wessel@xxxxxxxxxxxxx>
References: <1261603190-5036-33-git-send-email-jason.wessel@xxxxxxxxxxxxx> <1261604584-5796-1-git-send-email-jason.wessel@xxxxxxxxxxxxx> <1261604584-5796-2-git-send-email-jason.wessel@xxxxxxxxxxxxx> <1261604584-5796-3-git-send-email-jason.wessel@xxxxxxxxxxxxx> <1261604584-5796-4-git-send-email-jason.wessel@xxxxxxxxxxxxx>
The kgdb test suite mimics the behavior of gdb.  For the sh
architecture the pc must be decremented by 2 for software breakpoint.

CC: Paul Mundt <lethal@xxxxxxxxxxxx>
Signed-off-by: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
---
 drivers/misc/kgdbts.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c
index fcb6ec1..7245023 100644
--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -295,6 +295,10 @@ static int check_and_rewind_pc(char *put_str, char *arg)
        /* On x86 a breakpoint stop requires it to be decremented */
        if (addr + 1 == kgdbts_regs.ip)
                offset = -1;
+#elif defined(CONFIG_SUPERH)
+       /* On SUPERH a breakpoint stop requires it to be decremented */
+       if (addr + 2 == kgdbts_regs.pc)
+               offset = -2;
 #endif
        if (strcmp(arg, "silent") &&
                instruction_pointer(&kgdbts_regs) + offset != addr) {
@@ -305,6 +309,8 @@ static int check_and_rewind_pc(char *put_str, char *arg)
 #ifdef CONFIG_X86
        /* On x86 adjust the instruction pointer if needed */
        kgdbts_regs.ip += offset;
+#elif defined(CONFIG_SUPERH)
+       kgdbts_regs.pc += offset;
 #endif
        return 0;
 }
-- 
1.6.4.rc1

<Prev in Thread] Current Thread [Next in Thread>