subsys/debug/gdb_server.c
/**
 * @brief handle a system stop request
 *
 * The purpose of this routine is to handle a stop request issued by remote
 * debug client. It is called when receiving a break char.
 *
 * It indicates that a GDB event is pending (the answer to stop request) and
 * transfer control from the runtime system to the stop mode agent. The event
 * will be posted by this control loop.
 *
 * @return n/a
 */
@brief handle a system stop request
The purpose of this routine is to handle a stop request issued by remote
debug client. It is called when receiving a break char.

It indicates that a GDB event is pending (the answer to stop request) and
transfer control from the runtime system to the stop mode agent. The event
will be posted by this control loop.

@return n/a
@brief handle a system stop request The purpose of this routine is to handle a stop request issued by remote debug client . It is called when receiving a break char . It indicates that a GDB event is pending ( the answer to stop request ) and transfer control from the runtime system to the stop mode agent . The event will be posted by this control loop . @return n / a
static void handle_system_stop(NANO_ISF *regs, int signal)
{
	int key = irq_lock();
	gdb_debug_status = DEBUGGING;
	if (signal != 0) {
		cpu_stop_signal = signal;
	} else {
		cpu_stop_signal = GDB_SIG_INT;  
	}
	if (regs == GDB_INVALID_REG_SET) {
		valid_registers = 0;
	} else {
		if (!regs) {
			regs = sys_debug_current_isf_get();
		}
		gdb_arch_regs_from_isf(&gdb_regs, regs);
		valid_registers = 1;
	}
	event_is_pending = 1;
	control_loop();
	if (valid_registers) {
		gdb_arch_regs_to_isf(&gdb_regs, regs);
	}
	RESUME_SYSTEM();
	irq_unlock(key);
}
static void handle_system_stop ( NANO_ISF * regs , int signal ) { int key = irq_lock ( ) ; gdb_debug_status = DEBUGGING ; if ( signal != 0 ) { cpu_stop_signal = signal ; } else { cpu_stop_signal = GDB_SIG_INT ; } if ( regs == GDB_INVALID_REG_SET ) { valid_registers = 0 ; } else { if ( ! regs ) { regs = sys_debug_current_isf_get ( ) ; } gdb_arch_regs_from_isf ( & gdb_regs , regs ) ; valid_registers = 1 ; } event_is_pending = 1 ; control_loop ( ) ; if ( valid_registers ) { gdb_arch_regs_to_isf ( & gdb_regs , regs ) ; } RESUME_SYSTEM ( ) ; irq_unlock ( key ) ; }
@brief handle a system stop request
 The purpose of this routine is to handle a stop request issued by remote
 debug client.
@brief handle a system stop request The purpose of this routine is to handle a stop request issued by remote debug client .
/* Stopped by a command */ /* Save registers */ /* A GDB event is pending */ /* Transfer control to the control loop */ /* Load registers */ /* Resume system if not a single step request */