Author Topic: Trunk executes wrong debugger  (Read 7405 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2809
Trunk executes wrong debugger
« on: April 11, 2012, 07:56:50 pm »
In DebuggerManager::FindTargetsDebugger
If attempting to debug a gcc virtual target (say codeblocks All target)
and the default compiler is set to Visual C++, FindTargetsDebugger will set the debugger to CDB because the virtual target address is returned as 0x0.

Something like the following may work.

Code
void DebuggerManager::FindTargetsDebugger()
    . . .
    if (project)
    {
        const wxString &targetName = project->GetActiveBuildTarget();
        if (project->BuildTargetValid(targetName))
            target = project->GetBuildTarget(targetName);
    }
    // The above fails to find actual target for virtual targets  //(pecan 2012/04/11)

    Compiler *compiler = nullptr;
    if (!target)
    {
        if (project)                                                             //(pecan 2012/04/11)
            compiler = CompilerFactory::GetCompiler(project->GetCompilerID());   //(pecan 2012/04/11)
        if (not compiler)                                                        //(pecan 2012/04/11)
        compiler = CompilerFactory::GetDefaultCompiler();
        if (!compiler)
  . . .


Would be better if we could find a way to identify the actual target.
But I couldn't find one.
« Last Edit: April 11, 2012, 07:59:19 pm by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Trunk executes wrong debugger
« Reply #1 on: April 11, 2012, 08:18:51 pm »
Would be better if we could find a way to identify the actual target.
But I couldn't find one.
Hm, as far as I know C::B ask you to choose the target at the start of the debugging session. What have you chosen in the Target select dialog?


p.s. using not instead of ! hurts my eyes pretty badly :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Trunk executes wrong debugger
« Reply #2 on: April 12, 2012, 09:34:59 am »
I've committed you patch (with little modifications), but I don't know how can we solve the real problem...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]