Author Topic: debugger-plugin choses wrong build-target  (Read 3672 times)

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
debugger-plugin choses wrong build-target
« on: May 04, 2008, 02:06:48 pm »
I just submitted a bug-report and a patch.

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.