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

Wrong messages in "Build messages"

(1/3) > >>

iw2nhl:
Hi,
I noticed that if compilation stop because of a missing file, in "Build messages" you get:
=== Build finished: 0 errors, 0 warnings ===
The same message is shown if you stop the compilation with the "Abort" button.
This is confusing, it should write something like:
=== Build stopped because of errors
and
=== Build aborted by user

If there are missing files, "Build log" shows:
Process terminated with status 1
so this info could be used to change the message in "Build messages".
While for an abort, "Build log" shows:
Process terminated with status 0
but the abort is caused by a user request (button click), so it is a well known condition.

iw2nhl:
In "plugins\compilergcc\compilergcc.cpp", function "CompilerGCC::OnJobEnd()", starting at line 2974:

--- Code: (cpp) ---        if (!m_CommandQueue.LastCommandWasRun())
        {
            m_Log->GetTextControl()->SetDefaultStyle(wxTextAttr(COLOUR_NAVY));
            wxString msg = wxString::Format(_("%d errors, %d warnings"), m_Errors.GetCount(cltError), m_Errors.GetCount(cltWarning));
            Manager::Get()->GetMessageManager()->Log(m_PageIndex, msg);
            Manager::Get()->GetMessageManager()->LogToStdOut(msg + _T('\n'));
            LogWarningOrError(cltNormal, 0, wxEmptyString, wxEmptyString, wxString::Format(_("=== Build finished: %s ==="), msg.c_str()));
        }

--- End code ---

This is a possible solution for the "file not found" error:

--- Code: (cpp) ---        if (!m_CommandQueue.LastCommandWasRun())
        {
            m_Log->GetTextControl()->SetDefaultStyle(wxTextAttr(COLOUR_NAVY));
            // --> New code
            int errors = m_Errors.GetCount(cltError);
            int warnings = m_Errors.GetCount(cltWarning);
            if (exitCode != 0 && errors == 0 && warnings == 0)
                wxString msg = wxString::Format(_("errors found"));
            else
                wxString msg = wxString::Format(_("%d errors, %d warnings"), errors, warnings);
            // --> End of new code
            Manager::Get()->GetMessageManager()->Log(m_PageIndex, msg);
            Manager::Get()->GetMessageManager()->LogToStdOut(msg + _T('\n'));
            LogWarningOrError(cltNormal, 0, wxEmptyString, wxEmptyString, wxString::Format(_("=== Build finished: %s ==="), msg.c_str()));
        }

--- End code ---

For the "Abort" button I have to investigate more.

[EDIT]
The "Abort" button, calls "CompilerGCC::KillProcess()", same file as before, line 2273; I don't know if something in that function is useful for the "OnJobEnd()" function to know that we are in the "Aborting status". Else we could add a bool for that (both functions are in same class, so it needs only a member variable).

iw2nhl:
No one interested in this change?
Is there something wrong with it?

killerbot:
I hadn't seen this post yet. I'll try to have a closer look at it soon. Best thing to do is, provide a patch for this on berlios project page. Changes things get lost in the forum are not that small ;-)

thanks for the help and effort though !!!

[EDIT] : couldn't resist, just checked the first part, looks ok, will test myself first in case of missing file and if ok will adjust the code like you suggested.

iw2nhl:
Ok, next time I'll add a patch in BerliOS!
Then I have to add a post in the "List of community Patches" thread?

For now, I could post a message to that thread with a link to this thread. (Can I do that?)

Navigation

[0] Message Index

[#] Next page

Go to full version