Author Topic: [patch] Select Target dialog: select target based on virtual target on run/debug  (Read 6925 times)

Offline White-Tiger

  • Multiple posting newcomer
  • *
  • Posts: 83
Here's a small patch that improves debugging of virtual targets. It's just a basic one and should be further improved (I won't do that for now)

Basically it improves the Select Target dialog to select a target based on virtual target.
So when I debug a virtual target, I get an annoying dialog which wants to know which real target I want to debug but it lists targets for the entire project. So basically I can select virtual target "debug" but select and debug files from "release" so it doesn't work the way it should^^
It can also become a problem with many targets.. so please only show targets from virtual target if possible.

This patch requires some minor work.. such as it's only done for the debugger at the moment. So "Run" will offer to select a target from the entire project and not from the virtual target you tried to run... Didn't bother to search for the place to replace it, you are the developers so you'll know it better then me ;)
"Run" generally works worse then "Debug"... that's why I'm now used to abuse "Debug" to "Run" things :P Because "Debug" remembers the selected target while "Run" doesn't. That's why my focus was on "Debug"

Also it would be nice if you could extend it to also list only runnable targets.. for example:
I've got a virtual target named "release", it includes an App and a DLL, the DLL isn't setup to be run (no Host application set) so exclude that one from the select target dialog as you can't run it anyway if you try to and auto select App as it's the only one to actually run. That way you can use virtual targets straight ahead without any user interaction. (in case they are setup like that..)
Adding that should take you guys about 5-10 minutes only, so not a big deal ;)

P.S. the patch got some bugs included... TortoiseSVN didn't want to run the way it was supposed to... so there are some changes listed that didn't change anything in src/sdk/scripting/bindings/scriptbindings.cpp
Also the base dir for the patch is "src/" not "/".. don't ask me why...
Windoze 8.1 x86_64 16GiB RAM, wxWidgets-2.8x (latest,trunk), MinGW-builds (latest, posix-threads)
Code::Blocks (x86 , latest , selection length patch , build option fixes/additions , toggle comments)

Offline Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Yes, "Select Target" dialog popup when a virtual target is selected. In C::B source workspace, it's the case for "all" virtual target on main sources.
I've done other modification to have possibility to select a "default" target to run when using virtual target



The patch for this is not extracted for the time

Offline White-Tiger

  • Multiple posting newcomer
  • *
  • Posts: 83
Yours is the Create/View virtual targets dialog, isn't it?
Well.. being able to set a default target might also be nice.. though a automated way should also exist in case none was chosen...

Both should be possible though... manually defining one and having one automatically selected (as well as the possibility to manually select one on each run if there are more then one)
Windoze 8.1 x86_64 16GiB RAM, wxWidgets-2.8x (latest,trunk), MinGW-builds (latest, posix-threads)
Code::Blocks (x86 , latest , selection length patch , build option fixes/additions , toggle comments)

Offline Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Yes, it's the create/view virtual target dialog (called via project properties for example)

If "Select target to run" is not checked, standard "Choose target to run" dialog is shown, it's in this box that your patch get only really useful target to run instead of all project target ?

Offline White-Tiger

  • Multiple posting newcomer
  • *
  • Posts: 83
yes^^ "Select target" dialog... that's how it's named..

For example when I try to debug my virtual target "release" I'll get this screen:

But with patch it's this one: (and I just noticed the order is wrong... what does Code::Blocks internally do xD? At least virtual targets seem not to sort targets automatically.. I had to open the virtual targets configuration dialog and save settings again to force a resort..)
« Last Edit: October 15, 2014, 03:51:03 pm by White-Tiger »
Windoze 8.1 x86_64 16GiB RAM, wxWidgets-2.8x (latest,trunk), MinGW-builds (latest, posix-threads)
Code::Blocks (x86 , latest , selection length patch , build option fixes/additions , toggle comments)

Offline Bat

  • Multiple posting newcomer
  • *
  • Posts: 48
Here is the patch for automatic run target possibility.
https://sourceforge.net/p/codeblocks/tickets/81/