From 92363450a3fe18ae8d03af7883a52127cc50218f Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Wed, 21 Oct 2009 12:46:47 +0000 Subject: [PATCH] [285225] Only enable disassembly toggle breakpoint target for the DSF disassembly view. Also remove enablement condition of plugin.xml since we are checking this in the code. --- dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml | 4 ---- .../ToggleBreakpointsTargetFactory.java | 14 +++++++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml index d429b80ae25..88a533aa029 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml @@ -708,10 +708,6 @@ - - - - diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleBreakpointsTargetFactory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleBreakpointsTargetFactory.java index e0f44950975..2c791ea6803 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleBreakpointsTargetFactory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/ToggleBreakpointsTargetFactory.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.dsf.gdb.internal.ui.breakpoints; +import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -30,6 +31,14 @@ public class ToggleBreakpointsTargetFactory implements IToggleBreakpointsTargetF /** * Toggle breakpoint target-id for normal C breakpoints. * Note: The id must be the same as in ToggleCBreakpointsTargetFactory + * which is used for the editor. We need the id to be the same so that when + * the user goes from editor to DSF disassembly view, the choice of breakpoint + * targets looks the same and is remembered. + * To use the same id though, we must be careful not to have the two factories + * return the same id for the same part, or else it may confuse things. + * This is why this factory only returns this id for the DSF disassembly part, + * leaving ToggleCBreakpointsTargetFactory to return the same id + * for the editor. */ public static final String TOGGLE_C_BREAKPOINT_TARGET_ID = CDebugUIPlugin.PLUGIN_ID + ".toggleCBreakpointTarget"; //$NON-NLS-1$ // public static final String TOGGLE_C_TRACEPOINT_TARGET_ID = CDebugUIPlugin.PLUGIN_ID + ".toggleCTracepointTarget"; //$NON-NLS-1$ @@ -68,7 +77,10 @@ public class ToggleBreakpointsTargetFactory implements IToggleBreakpointsTargetF } public Set getToggleTargets(IWorkbenchPart part, ISelection selection) { - return TOGGLE_TARGET_IDS; + if (part instanceof IDisassemblyPart) { + return TOGGLE_TARGET_IDS; + } + return Collections.emptySet(); } }