Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Aborting compilation seems to be broken

<< < (5/6) > >>

thomas:
Never mind that patch... I've modified the PipedProcess class to suck everything proper, this avoids all the data being piped through the message queue again (committed already). This should now be at least twice as fast.

tiwag:
one little "cosmetic" change would be fine ...

we should display the "Aborting process ..." before discarding all further messages from the pipeline,
so that the user knows that the Abort-button is processed actually.



--- Code: ---Be patient!
This process will be aborted soon...
--- End code ---

tiwag:
under windoze, the

--- Code: ---wxProcess::Kill(m_Pid[i], wxSIGTERM);

--- End code ---
obviously does nothing and does not return, until the signalled process finishes normally.

Therefore it is necessary under windoze, to send the Buildlog message before wxProcess::Kill() is called.

i did a test with the following patch and it works under windoze ok.

plugins\compilergcc\compilergcc.cpp:2273...


--- Code: ---int CompilerGCC::KillProcess()
{
    ResetBuildState();
    m_RunAfterCompile = false;
    if (!IsProcessRunning())
        return 0;
    wxKillError ret = wxKILL_OK;

    m_CommandQueue.Clear();

    for (size_t i = 0; i < m_ParallelProcessCount; ++i)
    {
        if (!m_Processes[i])
            continue;

    #ifdef __WXMSW__
        Manager::Get()->GetMessageManager()->Log(m_PageIndex, _("Aborting process %d ... Be patient!"), i);
    #endif // __WXMSW__

        // Close input pipe
        m_Processes[i]->CloseOutput();
        ((PipedProcess*) m_Processes[i])->ForfeitStreams();

        ret = wxProcess::Kill(m_Pid[i], wxSIGTERM);

    #ifndef __WXMSW__
        if(ret != wxKILL_OK)
        {
            // No need to tell the user about the errors - just keep him waiting.
            Manager::Get()->GetMessageManager()->Log(m_PageIndex, _("Aborting process %d ..."), i);
        }
        else switch (ret)
        {
//            case wxKILL_ACCESS_DENIED: cbMessageBox(_("Access denied")); break;
//            case wxKILL_NO_PROCESS: cbMessageBox(_("No process")); break;
//            case wxKILL_BAD_SIGNAL: cbMessageBox(_("Bad signal")); break;
//            case wxKILL_ERROR: cbMessageBox(_("Unspecified error")); break;
            case wxKILL_OK:
            default: break;//Manager::Get()->GetMessageManager()->Log(m_PageIndex, _("Process killed..."));
        }
    #endif // __WXMSW__
    }
    return ret;
}

--- End code ---


how does this work under linux ?
is the linux case necessary or could it be thrown completely ?
and maybe simplified to


--- Code: ---int CompilerGCC::KillProcess()
{
    ResetBuildState();
    m_RunAfterCompile = false;
    if (!IsProcessRunning())
        return 0;
    wxKillError ret = wxKILL_OK;

    m_CommandQueue.Clear();

    for (size_t i = 0; i < m_ParallelProcessCount; ++i)
    {
        if (!m_Processes[i])
            continue;

    #ifdef __WXMSW__
        Manager::Get()->GetMessageManager()->Log(m_PageIndex, _("Aborting process %d ... Be patient!"), i);
    #else
        Manager::Get()->GetMessageManager()->Log(m_PageIndex, _("Aborting process %d ..."), i);
    #endif // __WXMSW__

        // Close input pipe
        m_Processes[i]->CloseOutput();
        ((PipedProcess*) m_Processes[i])->ForfeitStreams();

        ret = wxProcess::Kill(m_Pid[i], wxSIGTERM);
    }
    return ret;
}

--- End code ---

tiwag:
@Yiannis & Pecan - any comments ?

the actual svn version needs to be updated anyways,
because actually there is no message displayed when one presses the Abort button
and then it can take a long while under windoze OS until gcc returns ... ... zzz ... ... zz ... ... z ... ...

i tested the above versions with windows and it works ok there,
i'm not shure with linux and MAC OS X ...

mandrav:
Forgot about this. I 'll run some tests and if it works ok...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version