diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java index 31a2c068ea3..a2304679022 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java @@ -1197,6 +1197,11 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana int oldLine = ( delta != null ) ? delta.getAttribute( IMarker.LINE_NUMBER, 0 ) : 0; boolean basic = oldLine>0 && oldLine != line; + if (breakpoint instanceof ICBreakpointType) { + int oldType = ( delta != null ) ? delta.getAttribute( ICBreakpointType.TYPE, -1 ) : -1; + basic |= oldType != -1 && (oldType != ((ICBreakpointType) breakpoint).getType()); + } + if (basic) { final ICBreakpoint[] breakpoints = new ICBreakpoint[] {breakpoint}; breakpointsRemoved(breakpoints, null); diff --git a/debug/org.eclipse.cdt.debug.ui/icons/obj16/hwbrkp_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/obj16/hwbrkp_obj.gif new file mode 100644 index 00000000000..6a8f225f5f4 Binary files /dev/null and b/debug/org.eclipse.cdt.debug.ui/icons/obj16/hwbrkp_obj.gif differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/obj16/hwbrkpd_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/obj16/hwbrkpd_obj.gif new file mode 100644 index 00000000000..55604a43aaf Binary files /dev/null and b/debug/org.eclipse.cdt.debug.ui/icons/obj16/hwbrkpd_obj.gif differ diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index 676b9e8b738..db58b032469 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -1823,11 +1823,10 @@ - - + + diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java index 26c89c64e33..87f689ae6ad 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java @@ -65,6 +65,8 @@ public class CDebugImages { public static final String IMG_OVRS_GLOBAL = NAME_PREFIX + "global_ovr.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_BREAKPOINT_ENABLED = NAME_PREFIX + "brkp_obj.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_BREAKPOINT_DISABLED = NAME_PREFIX + "brkpd_obj.gif"; //$NON-NLS-1$ + public static final String IMG_OBJS_HWBREAKPOINT_ENABLED = NAME_PREFIX + "hwbrkp_obj.gif"; //$NON-NLS-1$ + public static final String IMG_OBJS_HWBREAKPOINT_DISABLED = NAME_PREFIX + "hwbrkpd_obj.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_ADDRESS_BREAKPOINT_ENABLED = NAME_PREFIX + "addrbrkp_obj.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_ADDRESS_BREAKPOINT_DISABLED = NAME_PREFIX + "addrbrkpd_obj.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_FUNCTION_BREAKPOINT_ENABLED = NAME_PREFIX + "funbrkp_obj.gif"; //$NON-NLS-1$ @@ -154,6 +156,8 @@ public class CDebugImages { public static final ImageDescriptor DESC_OVRS_GLOBAL = createManaged(T_OVR, IMG_OVRS_GLOBAL); public static final ImageDescriptor DESC_OBJS_BREAKPOINT_ENABLED = createManaged(T_OBJ, IMG_OBJS_BREAKPOINT_ENABLED); public static final ImageDescriptor DESC_OBJS_BREAKPOINT_DISABLED = createManaged(T_OBJ, IMG_OBJS_BREAKPOINT_DISABLED); + public static final ImageDescriptor DESC_OBJS_HWBREAKPOINT_ENABLED = createManaged(T_OBJ, IMG_OBJS_HWBREAKPOINT_ENABLED); + public static final ImageDescriptor DESC_OBJS_HWBREAKPOINT_DISABLED = createManaged(T_OBJ, IMG_OBJS_HWBREAKPOINT_DISABLED); public static final ImageDescriptor DESC_OBJS_TRACEPOINT_ENABLED = createManaged(T_ELCL, IMG_OBJS_TRACEPOINT_ENABLED); public static final ImageDescriptor DESC_OBJS_TRACEPOINT_DISABLED = createManaged(T_DLCL, IMG_OBJS_TRACEPOINT_DISABLED); public static final ImageDescriptor DESC_OBJS_WATCHPOINT_ENABLED = createManaged(T_OBJ, IMG_OBJS_WATCHPOINT_ENABLED); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java index b9904b6cd32..ac7b540a6ef 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java @@ -35,6 +35,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; import org.eclipse.cdt.debug.core.model.CDebugElementState; import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; import org.eclipse.cdt.debug.core.model.ICBreakpoint; +import org.eclipse.cdt.debug.core.model.ICBreakpointType; import org.eclipse.cdt.debug.core.model.ICDebugElement; import org.eclipse.cdt.debug.core.model.ICDebugElementStatus; import org.eclipse.cdt.debug.core.model.ICDebugTarget; @@ -356,6 +357,13 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode return getTracepointImage( (ICTracepoint)breakpoint ); } if ( breakpoint instanceof ICLineBreakpoint ) { + // checks if the breakpoint type is a hardware breakpoint, + // if so, return the hardware breakpoint image + if( breakpoint instanceof ICBreakpointType) { + ICBreakpointType breakpointType = (ICBreakpointType) breakpoint; + if( (breakpointType.getType() & ICBreakpointType.HARDWARE) != 0) + return getHWBreakpointImage( (ICLineBreakpoint) breakpoint); + } return getLineBreakpointImage( (ICLineBreakpoint)breakpoint ); } if ( breakpoint instanceof ICWatchpoint ) { @@ -371,6 +379,17 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode return null; } + protected Image getHWBreakpointImage(ICLineBreakpoint breakpoint) throws CoreException { + ImageDescriptor descriptor = null; + if ( breakpoint.isEnabled() ) { + descriptor = CDebugImages.DESC_OBJS_HWBREAKPOINT_ENABLED; + } + else { + descriptor = CDebugImages.DESC_OBJS_HWBREAKPOINT_DISABLED; + } + return getImageCache().getImageFor( new OverlayImageDescriptor( fDebugImageRegistry.get( descriptor ), computeOverlays( breakpoint ) ) ); + } + protected Image getTracepointImage( ICTracepoint tracepoint ) throws CoreException { ImageDescriptor descriptor = null; if ( tracepoint.isEnabled() ) { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/BreakpointComboFieldEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/BreakpointComboFieldEditor.java new file mode 100644 index 00000000000..1b8962d48e4 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/BreakpointComboFieldEditor.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (c) 2014 Freescale 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Freescale - initial API and implementation (Bug 427898) + *******************************************************************************/ +package org.eclipse.cdt.debug.internal.ui.breakpoints; + +import org.eclipse.cdt.debug.internal.ui.preferences.ComboFieldEditor; +import org.eclipse.cdt.debug.ui.breakpoints.ICBreakpointsUIContribution; +import org.eclipse.cdt.debug.ui.breakpoints.ICBreakpointsUIContributionUser; +import org.eclipse.swt.widgets.Composite; + +/** + * Extends combo field editor to load combo values from {@extensionPoint org.eclipse.cdt.debug.ui.breakpointContribution} extension + */ +public class BreakpointComboFieldEditor extends ComboFieldEditor implements + ICBreakpointsUIContributionUser { + + private ICBreakpointsUIContribution fContribution; + + /** + * Create combo field editor that would load choice values from {@link ICBreakpointsUIContribution} + * @param name - property name, must be the same as breakpoint attribute + * @param labelText - text in front of field + * @param parent + */ + public BreakpointComboFieldEditor(String name, String labelText, Composite parent) { + super(name, labelText, new String[0][0], parent); + } + + + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.ui.breakpoints.ICBreakpointsUIContributionUser#setContribution(org.eclipse.cdt.debug.ui.breakpoints.ICBreakpointsUIContribution) + */ + @Override + public void setContribution(ICBreakpointsUIContribution contribution) { + fContribution = contribution; + //load values from contribution + String[] possibleValues = fContribution.getPossibleValues(); + String[][] entryNamesAndValues = new String[possibleValues.length][2]; + for (int i=0; i See {@link ComboFieldEditor#ComboFieldEditor(String, String, String[][], Composite)} for names and values format + */ + protected void setEntries(String[][] entryNamesAndValues) { + fEntryNamesAndValues = entryNamesAndValues; + Combo combo = getComboBoxControl(); + // dispose old items. + if (combo.getItemCount() > 0) { + combo.removeAll(); + } + //load values from contribution + for (int i=0; i