Example #1
0
void CoreEngine::timerEvent(QTimerEvent* te)
{
    // Fetch away the debug events and notify if debuggee
    // stops. Note that IDebugEventCallback does not
    // cover all cases of a debuggee stopping execution
    // (such as step over,etc).
    if (te->timerId() != m_watchTimer)
        return;
    switch (waitForEvent(1)) {
        case S_OK:
            killWatchTimer();
            emit watchTimerDebugEvent();
            break;
        case S_FALSE:
            // Detect startup (all modules loaded) if the module
            // count no longer changes in a time-out.
            if (!m_modulesLoadedEmitted) {
                const int newModuleCount = moduleCount();
                if (newModuleCount && newModuleCount == m_lastTimerModuleCount) {
                    m_modulesLoadedEmitted = true;
                    emit modulesLoaded();
                } else {
                    m_lastTimerModuleCount = newModuleCount;
                }
            }
            break;
        case E_PENDING:
        case E_FAIL:
            break;
        case E_UNEXPECTED: // Occurs on ExitProcess.
            killWatchTimer();
            break;
    }
}
Example #2
0
CoreEngine::DebugEventCallbackBasePtr
        CoreEngine::setDebugEventCallback(const DebugEventCallbackBasePtr &e)
{
    // Keep the module count.
    const unsigned oldModuleCount = moduleCount();
    const CoreEngine::DebugEventCallbackBasePtr old = m_debugEventCallback;
    m_debugEventCallback = e;
    m_cif.debugClient->SetEventCallbacksWide(m_debugEventCallback.data());
    setModuleCount(oldModuleCount);
    return old;
}
Example #3
0
/* ENVINFO command */
static int do_envinfo(User * u, int ac, char **av)
{
    int uptime;

    if (denora->protocoldebug) {
        protocol_debug(NULL, ac, av);
    }

    uptime = time(NULL) - denora->start_time;

    notice_lang(s_StatServ, u, STAT_ENVINFO_HEADER);
    /* version, protocol, uplink */
    notice_lang(s_StatServ, u, STAT_ENVINFO_VERSION,
                denora->versiondotted);
    notice_lang(s_StatServ, u, STAT_ENVINFO_PROTOCOL,
                denora->version_protocol);
    notice_lang(s_StatServ, u, STAT_ENVINFO_UPLINK, denora->uplink);
    /* Yes/No responses */
    notice_lang(s_StatServ, u, STAT_ENVINFO_SQL,
                denora->do_sql ? langstring(SAY_YES) : langstring(SAY_NO));
    notice_lang(s_StatServ, u, STAT_ENVINFO_HTML,
                denora->do_html ? langstring(SAY_YES) :
                langstring(SAY_NO));
    notice_lang(s_StatServ, u, STAT_ENVINFO_DEBUG,
                denora->debug ? langstring(SAY_YES) : langstring(SAY_NO));
    /* How many modules loaded */
    notice_lang(s_StatServ, u, STAT_ENVINFO_MODULESLOADED, moduleCount(0));
    /* Language in use */
    notice_lang(s_StatServ, u, STAT_ENVINFO_LANGUAGE,
                langstring(LANG_NAME));
    /* Stats uptime information */
    if (uptime / 86400 == 1)
        notice_lang(s_StatServ, u, STATS_UPTIME_1DHMS, uptime / 86400,
                    (uptime / 3600) % 24, (uptime / 60) % 60, uptime % 60);
    else
        notice_lang(s_StatServ, u, STATS_UPTIME_DHMS, uptime / 86400,
                    (uptime / 3600) % 24, (uptime / 60) % 60, uptime % 60);
    /* End of ENVINFO */
    notice_lang(s_StatServ, u, STAT_ENVINFO_FOOTER);

    return MOD_CONT;
}