diff options
author | Marc Khouzam | 2014-04-10 14:24:49 +0000 |
---|---|---|
committer | Marc Khouzam | 2014-04-17 17:04:46 +0000 |
commit | d199768e6407c2d7921bb03103fbd0e7a70c39b2 (patch) | |
tree | 9e9d40b95df3b467ef543c5c8f07fab6fc9dcfdd /debug | |
parent | 839905a802e6d6562b08cfb9ec5d0513764c1ccd (diff) | |
download | org.eclipse.cdt-d199768e6407c2d7921bb03103fbd0e7a70c39b2.tar.gz org.eclipse.cdt-d199768e6407c2d7921bb03103fbd0e7a70c39b2.tar.xz org.eclipse.cdt-d199768e6407c2d7921bb03103fbd0e7a70c39b2.zip |
Bug 432503: Should not create two bps at same line with "Add breakpoint"
Change-Id: I30d70c5500687f5169e6dcb738bde9b4e60a5ff0
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/24851
Tested-by: Hudson CI
Reviewed-by: Teodor Madan <teodor.madan@freescale.com>
Tested-by: Teodor Madan <teodor.madan@freescale.com>
Diffstat (limited to 'debug')
-rw-r--r-- | debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java index 2cf55254f6d..8ca7acd4264 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Mentor Graphics and others. + * Copyright (c) 2011, 2014 Mentor Graphics 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 @@ -7,6 +7,7 @@ * * Contributors: * Mentor Graphics - Initial API and implementation + * Marc Khouzam (Ericsson) - Don't allow to set two bps at same line (bug 432503) *******************************************************************************/ package org.eclipse.cdt.debug.ui.breakpoints; @@ -172,7 +173,7 @@ abstract public class AbstractToggleBreakpointAdapter @Override public boolean canCreateLineBreakpointsInteractive(IWorkbenchPart part, ISelection selection) { - return canToggleLineBreakpoints( part, selection ); + return canToggleLineBreakpoints( part, selection ) && !hasBreakpoint( part ); } @Override @@ -244,6 +245,16 @@ abstract public class AbstractToggleBreakpointAdapter } } + private boolean hasBreakpoint(IWorkbenchPart part) { + if (part instanceof ITextEditor) { + ITextEditor textEditor = (ITextEditor) part; + IVerticalRulerInfo rulerInfo = (IVerticalRulerInfo) textEditor.getAdapter(IVerticalRulerInfo.class); + IBreakpoint breakpoint = CDebugUIUtils.getBreakpointFromEditor(textEditor, rulerInfo); + return breakpoint != null; + } + return false; + } + /** * Updates the breakpoint for given part and selection. * Depending on the flags and on whether a breakpoint exists, this method |