It turned out that if you have an invali_d compiler and then try to debug something, there is no error message shown as it should.
I'm talking about the debugger's branch of course.
I've debugged it a bit and the reason is that the exit code from the compiler is not set to != 0.
I've tried this patch and it works:
Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 7860)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -2387,6 +2387,7 @@
_T("Skipping..."),
prj->GetTitle().wx_str(), tlist[x].wx_str(), compilerName.wx_str(), compilerName2.wx_str());
Manager::Get()->GetLogManager()->LogWarning(msg, m_PageIndex);
+ m_LastExitCode = 1;
continue;
}
else if (!tgt->SupportsCurrentPlatform())
Index: src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 7860)
+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -2126,7 +2126,10 @@
bool DebuggerGDB::CompilerFinished(bool compilerFailed, StartType startType)
{
if (compilerFailed || startType == StartTypeUnknown)
+ {
+ m_Canceled = true;
return false;
+ }
if (DoDebug(startType == StartTypeStepInto) != 0)
return false;
return true;
Is it OK, to commit it? (The m_LastExitCode is going to be committed in trunk).
p.s. Morten can you add me to an exclude list, so I can post about invalid __ compilers?
Two corrections to the patch:
Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 7860)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -1152,6 +1152,7 @@
cmd = m_CommandQueue.Next();
if (!cmd && m_BuildState == bsNone && m_NextBuildState == bsNone)
{
+ m_LastExitCode = 0;
NotifyJobDone(true);
ResetBuildState();
if (m_RunAfterCompile)
@@ -2387,6 +2388,7 @@
_T("Skipping..."),
prj->GetTitle().wx_str(), tlist[x].wx_str(), compilerName.wx_str(), compilerName2.wx_str());
Manager::Get()->GetLogManager()->LogWarning(msg, m_PageIndex);
+ m_LastExitCode = 1;
continue;
}
else if (!tgt->SupportsCurrentPlatform())
@@ -2395,6 +2397,7 @@
msg.Printf(_T("\"%s - %s\" does not support the current platform. Skipping..."),
prj->GetTitle().wx_str(), tlist[x].wx_str());
Manager::Get()->GetLogManager()->LogWarning(msg, m_PageIndex);
+ m_LastExitCode = 1;
continue;
}
BuildJobTarget bjt;
Index: src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 7860)
+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -2126,7 +2126,10 @@
bool DebuggerGDB::CompilerFinished(bool compilerFailed, StartType startType)
{
if (compilerFailed || startType == StartTypeUnknown)
+ {
+ m_Canceled = true;
return false;
+ }
if (DoDebug(startType == StartTypeStepInto) != 0)
return false;
return true;
The "m_LastExitCode = 0;" part is needed, because if I have two target project and I try to build a failing target, then switch to the correct target and try to launch the debugger, it thinks that the build failed.
killerbot: You case seems to work and I think the reason is that the invalid_compiler message is printed at the beginning of the build, so if there is something that modifies the m_LastExitCode after I've set it, everything is OK.
Also m_LastExitCode it not used inside the compiler, it is meant for the outside world:)