rem: port_id nubPort; status_t error = ensure_debugger_installed(B_CURRENT_TEAM, &nubPort); if (error != B_OK) { dprintf("user_debug_stop_thread(): Failed to install debugger: " "thread: %ld: %s\n", thread_get_current_thread()->id, strerror(error)); return; }  struct thread *thread = thread_get_current_thread();   debug_thread_stopped message; message.thread = thread->id; message.team = thread->team->id; message.why = B_THREAD_NOT_RUNNING; message.nub_port = nubPort;   thread_hit_debug_event(B_DEBUGGER_MESSAGE_THREAD_STOPPED, &message, sizeof(message));
add: stop_thread(B_THREAD_NOT_RUNNING, NULL);
context: user_debug_stop_thread(){	// ensure that a debugger is installed for this team	port_id nubPort;	status_t error = ensure_debugger_installed(B_CURRENT_TEAM, &nubPort);	if (error != B_OK) {		dprintf("user_debug_stop_thread(): Failed to install debugger: "			"thread: %ld: %s\n", thread_get_current_thread()->id,			strerror(error));		return;	}	struct thread *thread = thread_get_current_thread();	// prepare the message	debug_thread_stopped message;	message.thread = thread->id;	message.team = thread->team->id;	message.why = B_THREAD_NOT_RUNNING;	message.nub_port = nubPort;	// TODO: Remaining message fields.	thread_hit_debug_event(B_DEBUGGER_MESSAGE_THREAD_STOPPED, &message,		sizeof(message));}