int kgdb_arch_handle_exception(int exception_vector, int signo, int err_code, char *remcom_in_buffer, char *remcom_out_buffer, struct pt_regs *linux_regs)
{ int err;
switch (remcom_in_buffer[0]) { case'D': case'k': /* * Packet D (Detach), k (kill). No special handling * is required here. Handle same as c packet.
*/ case'c': /* * Packet c (Continue) to continue executing. * Set pc to required address. * Try to read optional parameter and set pc. * If this was a compiled breakpoint, we need to move * to the next instruction else we will just breakpoint * over and over again.
*/
kgdb_arch_update_addr(linux_regs, remcom_in_buffer);
atomic_set(&kgdb_cpu_doing_single_step, -1);
kgdb_single_step = 0;
/* * Received continue command, disable single step
*/ if (kernel_active_single_step())
kernel_disable_single_step();
err = 0; break; case's': /* * Update step address value with address passed * with step packet. * On debug exception return PC is copied to ELR * So just update PC. * If no step address is passed, resume from the address * pointed by PC. Do not update PC
*/
kgdb_arch_update_addr(linux_regs, remcom_in_buffer);
atomic_set(&kgdb_cpu_doing_single_step, raw_smp_processor_id());
kgdb_single_step = 1;
local_irq_save(flags);
ret = __kgdb_notify(ptr, cmd);
local_irq_restore(flags);
return ret;
}
staticstruct notifier_block kgdb_notifier = {
.notifier_call = kgdb_notify, /* * Want to be lowest priority
*/
.priority = -INT_MAX,
};
/* * kgdb_arch_init - Perform any architecture specific initialization. * This function will handle the initialization of any architecture * specific callbacks.
*/ int kgdb_arch_init(void)
{ return register_die_notifier(&kgdb_notifier);
}
/* * kgdb_arch_exit - Perform any architecture specific uninitalization. * This function will handle the uninitalization of any architecture * specific callbacks, for dynamic registration and unregistration.
*/ void kgdb_arch_exit(void)
{
unregister_die_notifier(&kgdb_notifier);
}
conststruct kgdb_arch arch_kgdb_ops;
int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
{ int err;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.