News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Trunk executes wrong debugger

Started by Pecan, April 11, 2012, 07:56:50 PM

Previous topic - Next topic

Pecan

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.


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.

oBFusCATed

Quote from: Pecan on April 11, 2012, 07:56:50 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!]

oBFusCATed

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!]