From 01bc5a5c1fa8ae731a11bab5beb09535dd07d9bf Mon Sep 17 00:00:00 2001 From: Patrick Chuong Date: Mon, 2 Apr 2012 15:25:47 -0400 Subject: [PATCH] Bug 375871 - Missing disassembly editor toggle breakpoint tester --- debug/org.eclipse.cdt.debug.ui/plugin.xml | 7 +++---- .../ui/breakpoints/ToggleCBreakpointTester.java | 14 ++++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index 76eee9c0b5e..86a272813ed 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -1828,9 +1828,7 @@ - - + @@ -1849,7 +1847,8 @@ - + + diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ToggleCBreakpointTester.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ToggleCBreakpointTester.java index d4b161db193..dd5d7eaeccb 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ToggleCBreakpointTester.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ToggleCBreakpointTester.java @@ -1,5 +1,5 @@ /***************************************************************** - * Copyright (c) 2011 Texas Instruments and others + * Copyright (c) 2011, 2012 Texas Instruments and others * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,6 +8,7 @@ * Contributors: * Patrick Chuong (Texas Instruments) - * Update CDT ToggleBreakpointTargetFactory enablement (340177) + * Patrick Chuong (Texas Instruments) - Bug 375871 *****************************************************************/ package org.eclipse.cdt.debug.internal.ui.breakpoints; @@ -20,6 +21,7 @@ import org.eclipse.cdt.core.model.IFunctionDeclaration; import org.eclipse.cdt.core.model.IMethodDeclaration; import org.eclipse.cdt.core.model.IVariableDeclaration; import org.eclipse.cdt.debug.core.CDebugUtils; +import org.eclipse.cdt.debug.internal.ui.disassembly.editor.DisassemblyEditor; import org.eclipse.cdt.internal.ui.editor.CEditor; import org.eclipse.cdt.internal.ui.editor.asm.AsmTextEditor; import org.eclipse.core.expressions.PropertyTester; @@ -87,12 +89,13 @@ public class ToggleCBreakpointTester extends PropertyTester { return true; // can't figure the associated project, enable it by default. } } + } else if ("isDisassemblyEditorSupportsCBreakpoint".equals(property) && (receiver instanceof DisassemblyEditor)) { //$NON-NLS-1$ + if (!CDebugUtils.isCustomToggleBreakpointFactory()) + return true; + // No additional check is required, the check for the receiver is enough. // test for IVariableDeclaration, IFunctionDeclaration, IMethodDeclaration } else if ("isCDeclarationSupportsCBreakpoint".equals(property) && (receiver instanceof List)) { //$NON-NLS-1$ - if (!CDebugUtils.isCustomToggleBreakpointFactory()) - return true; - List list = (List) receiver; if (list.size() == 1) { Object element = list.get(0); @@ -100,6 +103,9 @@ public class ToggleCBreakpointTester extends PropertyTester { (element instanceof IVariableDeclaration || element instanceof IFunctionDeclaration || element instanceof IMethodDeclaration)) { + + if (!CDebugUtils.isCustomToggleBreakpointFactory()) + return true; IDeclaration cElement = (IDeclaration) element;