kgdb_nmicallback expects valid register state, so just fetch the register
state with get_irq_regs() as on other platforms.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Presently we're using a pretty dumbed-down implementation that copies
over register state visible from the thread info, leaving the bulk of the
switch_to state uncopied.
Given that we're also depending on register bank toggling for switch_to
optimization we ought to also explicitly zero out the GP regs that reside
in an alternate bank in order to prevent handing back garbage.
There are a few extra registers that we have state for in switch_to, so
copy those over while we're at it.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This updates sh following the generic kgdb changes adding support
for individual register get/set for kgdb/kdb use.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
kgdb needs a kgdb_roundup_cpus() definition in the architecture backend,
so just copy over the MIPS version, which already does what we want.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Implement kgdb_arch_pc() which adjusts the pc if it needs to be
adjusted after a software breakpoint trap.
Implement kgdb_arch_set_pc() which is a new required function in the
kgdb debug core.
When processing a single step return zero in the error exception field
so that the debug core can distinguish between a single step trap and
a breakpoint trap generically.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
The kgdb stub has traditionally tied in to the NMI slot, and manually
handled debounce. Now that we have a generic way to do this instead, all
of the stub-specific debounce silliness can be killed off.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Save the VBR allowing GDB to dump full registers set but do not reload it
as soon as the kgdb_handle_exception is invoked.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This migrates from the old bitrotted kgdb stub implementation and moves
to the generic stub. In the process support for SH-2/SH-2A is also added,
which the old stub never provided.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>