Eclipse(CDT). Build+Terminate Current debug + Run after load on debug button is possible? - eclipse

Is it possible to give any kind of directives/commands so that when I press "Debug" button in Eclipse IDE, it would terminate all active debug sessions, build changes and after program is loaded - run application without need for me to make any additional clicks/inputs?
Thanks!

As #howlger said "Window > Preferences: Run/Debug > Launching: Terminate and Relaunch while launching" for part 1.
To not have to press F8/resume, don't insert the breakpoint at main in the first place by disabling it in the Launch Configuration. From Run Menu -> Debug Configurations... -> Choose your launch -> Debug Tab, un check Stop on startup at.
You can change the default so newly created configurations have Stop on startup unchecked by going to Preferences -> C/C++ -> Debug -> GDB.

Related

Is it possible to set which file to run by default in eclipse?

I'm writing a python project in Eclipse with the PyDev plug-in, which contains multiple files.
However I'm used to using visual studio, where it'll automatically find the main function of a project and run the program from there.
Eclipse will always run the file I am currently editing (which usually is a file containing function that are called from the main function).
Is it possible to set which file should be run then clicking run? I've looked at the launch options under Project->Properties->PyDev, but didn't find what I was looking for.
When you press the Debug or Run button (Debug on the left) Eclipse tries to intelligently determine what to launch based on your current editor.
You can change the behaviour by editing Window -> Preferences -> Run/Debug -> Launching -> Launch Operation as pictured below.
The default of launching the current editor works well for some languages, but not as well for Python when every single file is itself a valid program to run. In your case I recommend changing to Always launch the previously launched application.
You can create a custom run configuration.
Right click on your project > run as > run configurations
From here is just a matter of choosing your project type on the left hand side and filling in the required information. You can click 'Run' to use your new configuration.
To get to this configuration again, you can click the 'Run' drop down button in the eclipse tool bar and see all of your run configurations.
Hope this helps!

How to open run configurations window in Eclipse with shortcut?

When I conduct multiple Java applications, I often need to open the
Run -> Run Configurations
to set the application input, or other parameters. So is there a way to open this window with shortcut ?
You can set a custom shortcut for the Run... command:
Window -> Preferences -> General -> Keys

Show dialog to choose workspace while it starts

I know its a silly question but i am stuck into it from 2 hours..Can any body tell me how should i enable the dialog which opens at the time we start eclipse and we choose workspace location from there.
See I want this window to be displayed first when eclipse starts
By mistake I have checked "Use this as the default and do not ask again".
Please guide me how to show up this dialog again
You can find it here :
Menu: Window -> Preferences -> General -> Startup and Shutdown -> Workspaces -> Prompt for workspace on startup
Eclipse preferences has a lot of options. You can search for specific options by typing in the filter text box at the top of the preferences dialog.
If you type in 'startup' for instance the list will be much shorter.
window > preferences > general > startup and shutdown > workspaces
then check 'Prompt for workspace on startup'
If your workspace is corrupted and Eclipse doesn't startup with your currently pre-selected workspace, you may edit SHOW_WORKSPACE_SELECTION_DIALOG=false to SHOW_WORKSPACE_SELECTION_DIALOG=true
which is located in file
C:\PathToEclipse\eclipse\configuration\.settings\org.eclipse.ui.ide.prefs
before you start the IDE.

How to change the order of options in "run as" menu in eclipse?

I mainly develop for Android in Eclipse. I used to run my app in with shortcut "CTRL+F11" which was the same as clicking "run as android application" in menu.
Then i installed some eclipse plugins for webservices and now when i press "CTRL+F11", it calls "run on server" because this is the first option in "run as" menu.
How can i change this so the default option for run as would be "run as android application"?
If you set the Preferences → Run/Debug → Launching to Always launch the previously launched application, CTRL+F11 should launch what you last launched.
Simply relaunch your app manually, then check that CTRL+F11 works like you want.
CTRL+F11 always launches your last launched configuration if the Preferences → Run/Debug → Launching to Always launch the previously launched application preference is set.
You can try to add a new shortcut for running android apps by customizing the key-shortcut preferences:
The answer is:
"Organize Favorites" Just below the run as menu.

Where is the set default launch configuration option for a project in Eclipse?

I'm running Eclipse 3.5 (Galileo) and I want to have the "Run" command always launch the same configuration, but instead I always get a dialog box that asks me to choose which way to run my project. How can I set a default?
Shouldn't matter, but this is for some Android development, so it's an Android project.
Do the following;
From the drop down menu select Window -> Preferences
Then from the Categories on the right side; Run/Debug -> Launching
Find a group box called "Launch Operation" at the bottom. If you change this to "Always launch the previously launched application" the F11/Ctrl+F11 shortcuts will debug/run whatever you debugged/ran before.
I don't understand why they changed the default behaviour for Eclipse 3.5, it is certainly one of the options I always change.