示例#1
0
void
ProcessWindowsLive::OnExitProcess(uint32_t exit_code)
{
    // No need to acquire the lock since m_session_data isn't accessed.
    WINLOG_IFALL(WINDOWS_LOG_PROCESS, "Process %u exited with code %u", GetID(), exit_code);

    TargetSP target = m_target_sp.lock();
    if (target)
    {
        ModuleSP executable_module = target->GetExecutableModule();
        ModuleList unloaded_modules;
        unloaded_modules.Append(executable_module);
        target->ModulesDidUnload(unloaded_modules, true);
    }

    SetProcessExitStatus(nullptr, GetID(), true, 0, exit_code);
    SetPrivateState(eStateExited);
}
示例#2
0
ValueObjectSP
OperatingSystemGo::FindGlobal(TargetSP target, const char *name)
{
    VariableList variable_list;
    const bool append = true;

    Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OS));

    if (log)
    {
        log->Printf("exe: %s", target->GetExecutableModule()->GetSpecificationDescription().c_str());
        log->Printf("modules: %zu", target->GetImages().GetSize());
    }

    uint32_t match_count = target->GetImages().FindGlobalVariables(ConstString(name), append, 1, variable_list);
    if (match_count > 0)
    {
        ExecutionContextScope *exe_scope = target->GetProcessSP().get();
        if (exe_scope == NULL)
            exe_scope = target.get();
        return ValueObjectVariable::Create(exe_scope, variable_list.GetVariableAtIndex(0));
    }
    return ValueObjectSP();
}