Bug 183291 - ToggleBreakpointRulerAction should use the IToggleBreakpointTarget adapter based on editor file
Summary: ToggleBreakpointRulerAction should use the IToggleBreakpointTarget adapter ba...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.0 M7   Edit
Assignee: Ken Ryall CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-04-19 17:46 EDT by Pawel Piech CLA
Modified: 2008-06-20 11:26 EDT (History)
1 user (show)

See Also:


Attachments
Patch to ToggleBreakpointRulerAction. (1.72 KB, patch)
2007-04-19 17:48 EDT, Pawel Piech CLA
no flags Details | Diff
Proposed fix (12.76 KB, patch)
2007-04-20 07:39 EDT, Anton Leherbauer CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Piech CLA 2007-04-19 17:46:20 EDT
Currently the ToggleBreakpointRulerAction is fixed to always use the org.eclipse.cdt.debug.internal.ui.actions.ToggleBreakpointAdapter, which always creates the standard CDT breakpoints.

This limits the flexibility for debuggers that need to use non-standard breakpoints. 

The solution is to have the toggle breakpoint action retrieve the correct toggle breakpoint adapter based on the resource being edited.  Other debuggers could contribute a different breakpoint adapter that is returned based on the project that the user is editing.

Also, please see the corresponding bug for retargetable toggle breakpoint actions found in the main menu: bug 166102.
Comment 1 Pawel Piech CLA 2007-04-19 17:48:45 EDT
Created attachment 64362 [details]
Patch to ToggleBreakpointRulerAction.

Patch to ToggleBreakpointRulerAction.
Comment 2 Anton Leherbauer CLA 2007-04-20 06:22:24 EDT
I think the patch is not quite complete for what you would like to achieve.
It tries to adapt the IWorkbenchPart to IToggleBreakpointTarget, but not the underlying IResource (as in Platform/Debug RetargetAction).
Furthermore, the same or similar strategy should also be applied to other occurrences of the ToggleBreakpointAdapter, namely:
ManageFunctionBreakpointActionDelegate
ToggleWatchpointActionDelegate

I'll attach a patch.
Comment 3 Anton Leherbauer CLA 2007-04-20 07:39:21 EDT
Created attachment 64415 [details]
Proposed fix

This patches also the CDT clone of the Platform/Debug RetargetAction to behave in the same way as the original.
Comment 4 Pawel Piech CLA 2007-04-20 12:07:58 EDT
You're absolutely right Toni,
Thanks
Comment 5 Ken Ryall CLA 2007-04-25 11:21:28 EDT
Committed patch to HEAD.
Comment 6 Pawel Piech CLA 2007-04-25 11:39:38 EDT
Thank you Ken!
Is there any chance you'll have time to look at bug 183397 in 4.0?  It relates to the same problem as this bug, i.e. allowing CDT editor to work with alternative breakpoint implementations.