kgdb,powerpc: Replace hardcoded offset by BREAK_INSTR_SIZE
authorMichal Simek <monstr@monstr.eu>
Thu, 5 Aug 2010 14:22:22 +0000 (09:22 -0500)
committerJason Wessel <jason.wessel@windriver.com>
Thu, 5 Aug 2010 14:22:22 +0000 (09:22 -0500)
kgdb_handle_breakpoint checks the first arch_kgdb_breakpoint
which is not known by gdb that's why is necessary jump over
it. The jump lenght is equal to BREAK_INSTR_SIZE that's
why is cleaner to use defined macro instead of hardcoded
non-described offset.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/kgdb.c

index 82a7b228c81a6e73f0a95a3d464a6a8abcf689c1..7f61a3ac787c9ae6f848939d311d8a8756733cfa 100644 (file)
@@ -129,7 +129,7 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs)
                return 0;
 
        if (*(u32 *) (regs->nip) == *(u32 *) (&arch_kgdb_ops.gdb_bpt_instr))
                return 0;
 
        if (*(u32 *) (regs->nip) == *(u32 *) (&arch_kgdb_ops.gdb_bpt_instr))
-               regs->nip += 4;
+               regs->nip += BREAK_INSTR_SIZE;
 
        return 1;
 }
 
        return 1;
 }