Example #1
0
File: debugger.c Project: Disar/Kha
bool hl_module_debug( hl_module *m, int port, bool wait ) {
	hl_socket *s;
	hl_socket_init();
	s = hl_socket_new(false);
	if( s == NULL ) return false;
	if( !hl_socket_bind(s,0x0100007F/*127.0.0.1*/,port) || !hl_socket_listen(s, 10) ) {
		hl_socket_close(s);
		return false;
	}
	debug_socket = s;
#	ifdef HL_THREADS
	hl_add_root(&debug_socket);
	hl_add_root(&client_socket);
	if( !hl_thread_start(hl_debug_loop, m, true) ) {
		hl_socket_close(s);
		return false;
	}
	if( wait ) {
		while( !debugger_connected )
			hl_sys_sleep(0.01);
	}
#	else
	// imply --debug-wait
	hl_debug_loop(m);
	hl_socket_close(debug_socket);
#	endif
	return true;
}
Example #2
0
	ValuePointer::ValuePointer (vdynamic* handle) {

		hlValue = (vobj*)handle;
		hl_add_root (&hlValue);

		cffiRoot = 0;
		cffiValue = 0;

	}
Example #3
0
	ValuePointer::ValuePointer (vclosure* callback) {

		hlValue = (vobj*)callback;
		hl_add_root (&hlValue);

		cffiRoot = 0;
		cffiValue = 0;

	}
Example #4
0
	ValuePointer::ValuePointer (vobj* handle) {

		hlValue = handle;
		hl_add_root (&hlValue);

		cffiRoot = 0;
		cffiValue = 0;

	}