rem: while (1) { stop_after_trap = 1; wait_for_inferior ();     break; } stop_after_trap = 0;
add: TRACE(("haiku_child_attach() done\n"));
context: haiku_child_attach (char *args, int from_tty){	extern int stop_after_trap;	thread_id threadID;	thread_info threadInfo;	status_t result;	TRACE(("haiku_child_attach(`%s', %d)\n", args, from_tty));	if (!args)		error_no_arg ("thread-id to attach");	// get the thread ID	threadID = strtoul (args, 0, 0);	if (threadID <= 0)		error("The given thread-id %ld is invalid.", threadID);// TODO: When attaching to a crashed team, the crashed thread is continued!// Don't know yet where that happens, but it needs to be fixed! 	haiku_init_child_debugging(threadID, true);	while (1) {		stop_after_trap = 1;		wait_for_inferior ();// TODO: Catch deadly events, so that we won't block here.//		if (debugThread && stop_signal != TARGET_SIGNAL_TRAP)//			resume (0, stop_signal);//		else		break;	}	stop_after_trap = 0;}