This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270192 - Project Launchers - extend to Debug
Summary: Project Launchers - extend to Debug
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: Dev
Hardware: All All
: P2 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-24 16:17 UTC by mariusz_m
Modified: 2017-03-30 13:28 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mariusz_m 2017-03-24 16:17:36 UTC
Hi,
in latest version of NB appeared new project property called Launchers.
When using CMake project that build more than one binary, it is very helpful feature.

But what about Debugging? The same situation.
Even more - I build target for PC, PC-tests, and for Target platform. 
Three different binaries I want to debug, but now only one debugger config to set. I can create more profiles, but switching between them is so slow (Parsing..., Parsing... More parsing).

Beside - the toolbar Run Project button dropdown menu is not updating until I select Projects tab -> Run -> <Launcher name>

I'm using C++ dev build from 2017-03-24

Regards,
Mariusz
Comment 1 soldatov 2017-03-24 17:09:14 UTC
Using C or C++ Project Launchers (F1 key)
================================
You can create launchers so you can easily run your project from the project context menu with different arguments, for example, or launch it from a script. Normally when you run your application from the IDE, the executable specified in the project properties as the Run command is executed. If you create launchers, you can specify multiple commands to run. Right-click the project and select Run As > launcher-name to run them.
You can use the same launchers for debugging by right-clicking the project and selecting Debug As > launcher-name.
To create a launcher:
Open the project and go to the Files window (Ctrl-2).
Open the folder nbproject/private and double-click the file launcher.properties to open it in the Source Editor.
Edit the file to specify commands to run and display names to show in the IDE for running those commands. See the comments in the launcher.properties file that explain the macros you can use with the launchers.
Save the file and go back to the Projects window.
Right-click the project and select Run As to run the project using the launchers you specified.
Launchers Example
For the IDE's C/C++ sample application called Arguments, you could add the following to your launcher.properties file:
launcher1.runCommand="${OUTPUT_PATH}" "arg 1" "arg 2" "arg 3" "arg 4"
launcher1.displayName=Four Args

launcher2.runCommand=../dist/Debug/OracleSolarisStudio-Solaris-x86/arguments_1 "arg 1"
launcher2.displayName=One Arg

launcher3.runCommand=/bin/sh runMyProgram.sh
With this launcher.properties file, you would then be able to run the project using Run As > Four Args and Run As > One Arg or Run As > /bin/sh runMyProgram.sh.
The file runMyProgram.sh might be a script that sets environment variables for example, or does anything you want.
If you want to debug your application using a launcher that runs a script, you must also specify the option symbolFiles for that launcher so the debugger can debug the application instead of the shell used to run the script. For the launcher3 example above, this option could be added as follows:
launcher3.runCommand=/bin/sh runMyProgram.sh
launcher3.symbolFiles=${LINKER_OUTPUT}
Comment 2 soldatov 2017-03-24 17:13:45 UTC
(In reply to mariusz_m from comment #0)
> Beside - the toolbar Run Project button dropdown menu is not updating until
> I select Projects tab -> Run -> <Launcher name>
Because it is not a launcher. It is a history (issue 193872).
Comment 3 Vladimir Voskresensky 2017-03-30 13:28:23 UTC
So, the short answer is - "debug works". You need to use launcher3.symbolFiles=${LINKER_OUTPUT}
to fill the name of debugged artifact