Chuong, Patrick wrote:
Hi,
I am trying to understand
the purpose of
IToggleBreakpointsTargetFactory class in the platform debug plugin.
This
interface is meant to allow client to override the default toggle
breakpoint
action in the workbench. What I am not sure about this interface is why
there
is a need to have different “active” toggle breakpoint target for a
workbench part? For example, if I have a CDebugger and my own debugger,
than
there are two toggle breakpoint adapters per workbench part. But the
active target
breakpoint adapter is independent per workbench part. i.e a CEditor can
have a
CDebugger breakpoint adapter active, while a disassembly view can have
my
breakpoint adapter active. Having be able to do this, which is
flexible, but it
required the user to known what is the active toggle breakpoint adapter
per
workbench part. Would it make thing easier if the active toggle adapter
is
global, rather than workbench part dependent? Am I doing something not
correct
here that causes the active toggle selection tied to the workbench part?
The purpose of the interface is to allow a debugger to override the
default breakpoint that is being created in a given editor/view. This
feature works off of the active part because different parts can create
different kinds of breakpoints (i.e. Java editor vs. CDT Editor).
I agree that the selection of the active toggle target is tricky once
user overrides the default and it is a short-coming of this feature.
In my experience your best chance to avoid confusion for your users is
to implement good default selection. For example, you can use the
active debug context to determine whether your breakpoints should be
created instead of the standard ones. You can also use the active
project, active file, etc.
Also, why not the have
the active debug session provides the
target breakpoint adapter, this will eliminate user interaction. But if
there
is no debug session, than it should default to the current
implementation.
Would you want a Java editor to create C breakpoints when the C
debugger is active? Seriously though, I think you can achieve this by
having proper logic in your
IToggleBreakpoinsTargetFactory.getDefaultToggleTarget(). For an
example, look at the one for CDT breakpoints: it only returns a default
if the CDT Debugger is active. However, once user starts overriding
the default the selection of breakpoint type becomes more blunt.
Cheers,
Pawel
_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-debug-dev
|