Community
Participate
Working Groups
The "Toggle Watchpoint" option from the Run menu remains disabled, this happens at the location of the definition as well as within the program logic. The work around is to define them via the Breakpoints view (i.e. Drop down menu - Add Watch point (C/C++))
It would be nice to fix this because this is how it is explained in the help and I had to resort to searching bugzilla to figure out how to add a watchpoint ;) For your information, the first thing I looked for was a dedicated button (ToolItem/SWT.DROP_DOWN) in the Breakpoints view toolbar, such as "New" or "Add" then select what kind of breakpoint. Right now, it's all in the view drop-down menu which seems inconsistent with other views in Eclipse because this menu is used to configure how the view displays it's content (layout, filter, etc) which is why I never tried that.
This is related to Bug 246649. RetargetWatchpointAction is called for checking action enable state only on IStructuredSelection event not on text selection changes. The background is that when first time editor is activated, most likely selection is not on a variable but somewhere in a method. Hence it will be disabled. When you move cursor to a variable (aka text selection change event), action enable logic is not called any more. This does affect other actions based on RetargetAction as well, such as "Move To Line", "Run to Line" that will be active for non method lines. Including for Java JDT "Toggle Watchpoint". An workaround: after selecting the text with variable switch active parts to a different view/editor and back. This will enable "Toggle Watchpoint"