mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
[302629] - [breakpoints][cdi] Add support for filtering of breakpoints based on selected debug target in DSF-GDB debugger
This commit is contained in:
parent
fd02b90e42
commit
dc5ab47300
2 changed files with 53 additions and 3 deletions
|
@ -13,11 +13,11 @@ package org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel;
|
|||
import org.eclipse.cdt.dsf.concurrent.ThreadSafe;
|
||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.AbstractDebugVMAdapter;
|
||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.SteppingController;
|
||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.breakpoints.BreakpointVMProvider;
|
||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.expression.ExpressionVMProvider;
|
||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.modules.ModulesVMProvider;
|
||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.register.RegisterVMProvider;
|
||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.variable.VariableVMProvider;
|
||||
import org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.breakpoints.GdbBreakpointVMProvider;
|
||||
import org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.launch.LaunchVMProvider;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
import org.eclipse.cdt.dsf.ui.viewmodel.IVMProvider;
|
||||
|
@ -29,7 +29,6 @@ import org.eclipse.debug.ui.IDebugUIConstants;
|
|||
*
|
||||
*/
|
||||
@ThreadSafe
|
||||
@SuppressWarnings("restriction")
|
||||
public class GdbViewModelAdapter extends AbstractDebugVMAdapter
|
||||
{
|
||||
public GdbViewModelAdapter(DsfSession session, SteppingController controller) {
|
||||
|
@ -56,7 +55,7 @@ public class GdbViewModelAdapter extends AbstractDebugVMAdapter
|
|||
} else if (IDebugUIConstants.ID_MODULE_VIEW.equals(context.getId()) ) {
|
||||
return new ModulesVMProvider(this, context, getSession());
|
||||
} else if (IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(context.getId()) ) {
|
||||
return new BreakpointVMProvider(this, context);
|
||||
return new GdbBreakpointVMProvider(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems 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:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.breakpoints;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.breakpoints.BreakpointVMProvider;
|
||||
import org.eclipse.cdt.dsf.ui.viewmodel.AbstractVMAdapter;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
import org.eclipse.debug.core.model.IBreakpoint;
|
||||
import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointUIConstants;
|
||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
|
||||
|
||||
/**
|
||||
* @since 3.0
|
||||
*/
|
||||
public class GdbBreakpointVMProvider extends BreakpointVMProvider {
|
||||
|
||||
public GdbBreakpointVMProvider(AbstractVMAdapter adapter, IPresentationContext presentationContext) {
|
||||
super(adapter, presentationContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void calcFileteredBreakpoints(DataRequestMonitor<IBreakpoint[]> rm) {
|
||||
if (getPresentationContext().getProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_FILTER_SELECTION) != null) {
|
||||
IBreakpoint[] allBreakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints();
|
||||
List<IBreakpoint> filteredBPs = new ArrayList<IBreakpoint>(allBreakpoints.length);
|
||||
for (IBreakpoint bp : allBreakpoints) {
|
||||
if (bp instanceof ICBreakpoint && bp.getModelIdentifier().equals(CDebugCorePlugin.PLUGIN_ID)) {
|
||||
filteredBPs.add(bp);
|
||||
}
|
||||
}
|
||||
rm.setData( filteredBPs.toArray(new IBreakpoint[filteredBPs.size()]) );
|
||||
rm.done();
|
||||
} else {
|
||||
super.calcFileteredBreakpoints(rm);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue