Blackfin: kgdb: disable preempt schedule when running single step in kgdb
Otherwise, gdb continue operation after a breakpoint is hit may trap into endless breakpoint. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
900de05182
commit
b68233e7f0
|
@ -347,15 +347,20 @@ void kgdb_roundup_cpu(int cpu, unsigned long flags)
|
||||||
|
|
||||||
#ifdef CONFIG_IPIPE
|
#ifdef CONFIG_IPIPE
|
||||||
static unsigned long kgdb_arch_imask;
|
static unsigned long kgdb_arch_imask;
|
||||||
|
#endif
|
||||||
|
|
||||||
void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
|
void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
|
||||||
{
|
{
|
||||||
|
if (kgdb_single_step)
|
||||||
|
preempt_enable();
|
||||||
|
|
||||||
|
#ifdef CONFIG_IPIPE
|
||||||
if (kgdb_arch_imask) {
|
if (kgdb_arch_imask) {
|
||||||
cpu_pda[raw_smp_processor_id()].ex_imask = kgdb_arch_imask;
|
cpu_pda[raw_smp_processor_id()].ex_imask = kgdb_arch_imask;
|
||||||
kgdb_arch_imask = 0;
|
kgdb_arch_imask = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int kgdb_arch_handle_exception(int vector, int signo,
|
int kgdb_arch_handle_exception(int vector, int signo,
|
||||||
int err_code, char *remcom_in_buffer,
|
int err_code, char *remcom_in_buffer,
|
||||||
|
@ -401,6 +406,7 @@ int kgdb_arch_handle_exception(int vector, int signo,
|
||||||
*/
|
*/
|
||||||
kgdb_single_step = i + 1;
|
kgdb_single_step = i + 1;
|
||||||
|
|
||||||
|
preempt_disable();
|
||||||
#ifdef CONFIG_IPIPE
|
#ifdef CONFIG_IPIPE
|
||||||
kgdb_arch_imask = cpu_pda[raw_smp_processor_id()].ex_imask;
|
kgdb_arch_imask = cpu_pda[raw_smp_processor_id()].ex_imask;
|
||||||
cpu_pda[raw_smp_processor_id()].ex_imask = 0;
|
cpu_pda[raw_smp_processor_id()].ex_imask = 0;
|
||||||
|
|
Loading…
Reference in New Issue