--- codeblocks-1.0svn.work/src/plugins/debuggergdb/debuggergdb.cpp 2008-05-01 22:17:23.000000000 +0200
+++ codeblocks-1.0svn.orig/src/plugins/debuggergdb/debuggergdb.cpp 2008-05-04 13:28:38.000000000 +0200
@@ -1052,6 +1052,8 @@
return 2;
m_pProject = project;
+ if (m_ActiveBuildTarget.IsEmpty())
+ m_ActiveBuildTarget = m_pProject->GetActiveBuildTarget();
// should we build to make sure project is up-to-date?
if (Manager::Get()->GetConfigManager(_T("debugger"))->ReadBool(_T("auto_build"), true))
@@ -2795,8 +2797,8 @@
void DebuggerGDB::OnBuildTargetSelected(CodeBlocksEvent& event)
{
// Manager::Get()->GetLogManager()->DebugLog(F(_T("DebuggerGDB::OnBuildTargetSelected: target=%s"), event.GetBuildTargetName().c_str()));
-
// verify that the project that sent it, is the one we 're debugging
- if (!m_pProject || event.GetProject() == m_pProject)
+ // and that a project is loaded
+ if (m_pProject && event.GetProject() == m_pProject)
m_ActiveBuildTarget = event.GetBuildTargetName();
}