Re: [PATCH 09/37] kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin

Mike Frysinger <[email protected]> Sat, 26 Dec 2009 16:12:13 -0500
Newsgroups gmane.linux.kernel,gmane.linux.kernel.debugging.kgdb.bugs,gmane.linux.kernel.debugging
Message-ID <[email protected]>
On Wed, Dec 23, 2009 at 16:19, Jason Wessel wrote:
> The new debug core api requires all architectures that use to debug
> core to implement a function to set the program counter.
>
> CC: Mike Frysinger <[email protected]>
> Signed-off-by: Jason Wessel <[email protected]>
> ---
> =C2=A0arch/blackfin/kernel/kgdb.c | =C2=A0 =C2=A05 +++++
> =C2=A01 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.=
c
> index f1036b6..5965188 100644
> --- a/arch/blackfin/kernel/kgdb.c
> +++ b/arch/blackfin/kernel/kgdb.c
> @@ -644,6 +644,11 @@ int kgdb_arch_remove_breakpoint(unsigned long ad=
dr, char *bundle)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0return bfin_probe_kernel_write((char *)add=
r, bundle, BREAK_INSTR_SIZE);
> =C2=A0}
>
> +void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
> +{
> + =C2=A0 =C2=A0 =C2=A0 regs->retx =3D ip;
> +}
> +
> =C2=A0int kgdb_arch_init(void)
> =C2=A0{
> =C2=A0 =C2=A0 =C2=A0 =C2=A0kgdb_single_step =3D 0;

Sonic should be able to check this.  our pc handling seems a little won=
ky atm:

arch/blackfin/kernel/kgdb.c:
void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
{
=2E..
    gdb_regs[BFIN_RETI] =3D regs->pc;
    gdb_regs[BFIN_RETX] =3D regs->retx;
    gdb_regs[BFIN_PC] =3D regs->pc;
=2E..
}
=2E..
void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
{
=2E..
    regs->pc =3D gdb_regs[BFIN_PC];
    regs->retx =3D gdb_regs[BFIN_PC];
    /* nothing for BFIN_RETI */
=2E..
}
-mike