Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: jens on May 04, 2008, 02:06:48 pm

Title: debugger-plugin choses wrong build-target
Post by: jens on May 04, 2008, 02:06:48 pm
I just submitted a bug-report (https://developer.berlios.de/bugs/?func=detailbug&bug_id=13737&group_id=5358) and a patch (https://developer.berlios.de/patch/?func=detailpatch&patch_id=2455&group_id=5358).

Here's the text of the bug-report:
Quote
I have a workspace containing two projects: a host application and a dynamic library.
When I open the workspace and the active build targets are different, the one from the last parsed project is taken for debugging, even if it's not the active project.
The dropdownlist in toolbar is correct.
For example:
host application is active, build-target is "Debug" and libraries build-target is "WinRelease".
Then debuggergdb tries to debug "WinRelease" what of course does not work.

This happens because "m_ActivBuildTarget" is set always if "m_pProject" is "0". That can happen during loading the workspace.

I patched "debuggergdb.cpp" in  a way that "m_ActivBuildTarget" is only set if "m_pProject" is not "0".
Otherwise "m_ActivBuildTarget" stays empty and will be set in "Debug" or "DoDebug".

Please have a look at the patch and apply it or a similar one, if mine breaks anything at another place.