eclipse-cdt / cdt

Eclipse CDT™ C/C++ Development Tools
http://eclipse.org/cdt
Eclipse Public License 2.0
299 stars 197 forks source link

Show C/C++ debug actions only when C/C++ launch configuration is added to Debug View #865

Open raghucssit opened 1 month ago

raghucssit commented 1 month ago

Problem: Some of the C/C++ contributed actions to Debug related to views have no visibility control. They are always shown up irrespective of C/C++ launch configuration available in Debug View. This distracts the developers who have JDT and CDT both and use them independently. Example: Instruction Stepping Mode InstructionSteppingMode We need to restrict their visibility only when there is an active C/C++ application being run/debug.

Analysis: Instruction Stepping Mode is contributed to org.eclipse.debug.ui.DebugView using extension point <extension point="org.eclipse.ui.viewActions">. This extension point does not support <visibleWhen> expression. Also this extension point is deprecated.

Solution: Replace the <extension point="org.eclipse.ui.viewActions"> with the <menuContribution locationURI="toolbar:org.eclipse.debug.ui.DebugView?after=additions"> and migrate <action id="org.eclipse.cdt.debug.internal.ui.actions.ToggleInstructionStepModeActionDelegate" /> to <command commandId="org.eclipse.cdt.debug.internal.ui.actions.ToggleInstructionStepModeCommand"/>.

We can migrate one action at time. We can start with Instruction Stepping Mode

raghucssit commented 1 month ago

This bug/enhancement was also reported earlier https://bugs.eclipse.org/bugs/show_bug.cgi?id=527190.

raghucssit commented 1 month ago

@iloveeclipse FYI