示例#1
0
void VSManager::addListener(VSListener* listener)
{
    if (!lock) initEarly();

    if (listener)
        ConfigurationManager::addListener(new VSConfigurationListener(listener));
}
示例#2
0
文件: init.cpp 项目: Eltamih/uvudec
/*
file: data file to target
architecture: hint about what we are trying to disassemble
*/
uv_err_t UVD::initFromFileName(const std::string &file, const UVDRuntimeHints &hints)
{
	uv_err_t rcTemp = UV_ERR_GENERAL;
	UVDData *data = NULL;
	
	uv_assert_err_ret(initEarly());
		
	rcTemp = UVDDataFile::getUVDDataFile(&data, file);
	if( UV_FAILED(rcTemp) || !data )
	{
		printf_error("could not open file: %s\n", file.c_str());
		return UV_DEBUG(UV_ERR_GENERAL);
	}
	uv_assert_err(initFromData(data, hints));
	return UV_ERR_OK;

error:
	delete data;
	return UV_DEBUG(UV_ERR_GENERAL);
}
示例#3
0
文件: init.cpp 项目: Eltamih/uvudec
uv_err_t UVD::initFromData(UVDData *data, const UVDRuntimeHints &hints)
{
	UVDObject *object = NULL;
	UVDArchitecture *architecture = NULL;
	
	uv_assert_err_ret(initEarly());

	//Object wraps data and architectures, so it seems reasonable to instantiate first
	uv_assert_err(initObject(data, hints, &object));
	uv_assert_err(initArchitecture(object, hints, &architecture));
	return UV_DEBUG(init(object, architecture));	

error:
	if( object )
	{
		object->m_data = NULL;
		delete object;
	}
	delete architecture;
	return UV_DEBUG(UV_ERR_GENERAL);
}
示例#4
0
int VSManager::allocSlot()
{
    if (!lock) initEarly();

    // We should only be called during late init (i.e. first configuration) or
    // initVS processing
    if ((countConfigured > 1) && !inInitVS) {
        ereport(LOG_WARN, "Attempt to allocate per-VirtualServer* slot outside of init processing");
        return -1;
    }

    int slot = -1;

    lock->acquire();

    VirtualServer* vs = 0;
    if (configuration) {
        // Add another slot to every VS.  The default value at each slot is 0.
        int count = configuration->getVSCount();
        int i;
        for (i = 0; i < count; i++) {
            vs = configuration->getVS(i);
            if (vs->enabled) {
                PR_ASSERT(countSlots == vs->getUserVector().length());
                vs->getUserVector().append(0);
            }
        }
    }

    // Track the number of slots allocated
    slot = countSlots;
    countSlots++;

    lock->release();

    return slot;
}
示例#5
0
文件: init.cpp 项目: Eltamih/uvudec
//int init_count = 0;
uv_err_t UVD::init(UVDObject *object, UVDArchitecture *architecture)
{
	UVDBenchmark engineInitBenchmark;

	if( !m_config->m_argv )
	{
		printf_warn("initializing UVD without parsing main\n");
	}
	uv_assert_err(initEarly());

	printf_debug_level(UVD_DEBUG_PASSES, "UVD::init(): initializing runtime...\n");
	//We might want to make this more dynamic just in case
	m_runtime = new UVDRuntime();
	uv_assert(m_runtime);
	uv_assert_err(m_runtime->init(object, architecture));

	printf_debug_level(UVD_DEBUG_PASSES, "UVD::init(): initializing engine...\n");
	engineInitBenchmark.start();

	uv_assert(m_config);
		
	m_config->m_verbose = m_config->m_verbose_init;

	/*
	m_CPU = new UVDCPU();
	uv_assert(m_CPU);
	uv_assert_err(m_CPU->init());
	*/

	m_analyzer = new UVDAnalyzer();
	uv_assert(m_analyzer);
	uv_assert_err(m_analyzer->init(this));
	m_format = new UVDFormat();
	uv_assert(m_format);
	m_eventEngine = new UVDEventEngine();
	uv_assert(m_eventEngine);
	uv_assert_err(m_eventEngine->init());
	/*
	Read file
	This is raw dat, NOT null terminated string
	*/

	uv_assert_err(m_config->m_plugin.m_pluginEngine.onUVDInit());

	printFormatting();
	printf_debug("UVD: init OK!\n\n\n");

	m_config->m_verbose = m_config->m_verbose_processing;
	
	engineInitBenchmark.stop();
	printf_debug_level(UVD_DEBUG_PASSES, "engine init time: %s\n", engineInitBenchmark.toString().c_str());

	//printf("Address spaces: %d\n", m_runtime->m_addressSpaces.m_addressSpaces.size());
	

	return UV_ERR_OK;
	
error:
	//If we fail, we do not own its subobjects
	if( m_runtime )
	{
		m_runtime->m_object = NULL;
		m_runtime->m_architecture = NULL;
		delete m_runtime;
		m_runtime = NULL;
	}
	return UV_DEBUG(UV_ERR_GENERAL);
}
示例#6
0
void VSManager::init()
{
    initEarly();
}