1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Second shot at the breakpoint service.

Fix for the shutdown sequence where a missing rm.done() in the MIBreakpoints shutdown() method was missing.
This commit is contained in:
Francois Chouinard 2007-11-30 16:14:54 +00:00
parent 0c476c0d38
commit ad27060ba1
2 changed files with 143 additions and 17 deletions

View file

@ -7,9 +7,13 @@
* *
* Contributors: * Contributors:
* Wind River Systems - initial API and implementation * Wind River Systems - initial API and implementation
* Ericsson - Revisited the API
*******************************************************************************/ *******************************************************************************/
package org.eclipse.dd.dsf.debug.service; package org.eclipse.dd.dsf.debug.service;
import java.util.Map;
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
import org.eclipse.dd.dsf.concurrent.RequestMonitor; import org.eclipse.dd.dsf.concurrent.RequestMonitor;
import org.eclipse.dd.dsf.datamodel.IDMContext; import org.eclipse.dd.dsf.datamodel.IDMContext;
import org.eclipse.dd.dsf.service.IDsfService; import org.eclipse.dd.dsf.service.IDsfService;
@ -17,32 +21,111 @@ import org.eclipse.dd.dsf.service.IDsfService;
/** /**
* Breakpoint service interface. The breakpoint service tracks platform breakpoint * Breakpoint service interface. The breakpoint service tracks platform breakpoint
* objects, and based on those, it manages breakpoints in the debugger back end. * objects, and based on those, it manages breakpoints in the debugger back end.
* The purpose of the service model interface is to allow UI clients to display
* breakpoint status in more detail and more dynamically than it it possible with
* just the marker-based breakpoint object.
*/ */
public interface IBreakpoints extends IDsfService { public interface IBreakpoints extends IDsfService {
/** /**
* Marker interface for a context for which breakpoints can be installed. * Marker interface for a context for which breakpoints can be installed
*/ */
public interface IBreakpointsDMContext extends IDMContext {}; public interface IBreakpointsTargetDMContext extends IDMContext {};
/** /**
* Install and begin tracking breakpoints for given context. The service * Specific breakpoint context
* will keep installing new breakpoints that appear in the IDE for this
* context until {@link #uninstallBreakpoints(IDMContext)} is called for that
* context.
* @param dmc Context to start tracking breakpoints for.
* @param rm Completion callback.
*/ */
public void installBreakpoints(IBreakpointsDMContext dmc, RequestMonitor rm); public interface IDsfBreakpointDMContext extends IDMContext {};
/** /**
* Uninstall and stop tracking breakpoints for the given context. * Breakpoint structure.
* @param dmc Context to start tracking breakpoints for. * Properties are stored in a map.
* @param rm Completion callback.
*/ */
public void uninstallBreakpoints(IBreakpointsDMContext dmc, RequestMonitor rm); public interface IDsfBreakpoint {
// Minimal breakpoint properties
public static final String DSFBREAKPOINT = "org.eclipse.dd.dsf.debug.service.breakpoint"; //$NON-NLS-1$
public static final String FILE_NAME = DSFBREAKPOINT + ".fileName"; //$NON-NLS-1$
public static final String LINE_NUMBER = DSFBREAKPOINT + ".lineNumber"; //$NON-NLS-1$
public static final String FUNCTION = DSFBREAKPOINT + ".function"; //$NON-NLS-1$
public static final String CONDITION = DSFBREAKPOINT + ".condition"; //$NON-NLS-1$
public static final String IGNORE_COUNT = DSFBREAKPOINT + ".ignoreCount"; //$NON-NLS-1$
public static final String IS_ENABLED = DSFBREAKPOINT + ".isEnabled"; //$NON-NLS-1$
public Object getReference();
public Map<String,Object> getProperties();
public Object getProperty(String key, Object defaultValue);
public Object setProperty(String key, Object value);
// public void setProperties(Map<String,Object> properties);
};
/**
* Refreshes the list of breakpoints from the [context] and returns the list
* of references.
*
* Use getBreakpoint() to retrieve individual breakpoints.
*
* @param context the execution context of the breakpoint
* @param drm the list of breakpoints in the execution context
*/
public void getBreakpointList(IBreakpointsTargetDMContext context,
DataRequestMonitor<IDsfBreakpointDMContext[]> drm);
/**
* Retrieves a specific breakpoint from the service.
*
* @param context the execution context of the breakpoint
* @param dmc the breakpoint reference
* @return IDsfBreakpoint
*/
public IDsfBreakpoint getBreakpoint(IBreakpointsTargetDMContext context,
IDsfBreakpointDMContext dmc);
/**
* Adds a breakpoint on the target.
*
* The breakpoint reference is returned in the DRM. The actual breakpoint
* object can be later be retrieved using getBreakpoint(reference).
*
* E.g.:
* IDsfBreakpointDMContext ref = addBreakpoint(...);
* IDsfBreakpoint bp = getBreakpoint(ref);
*
* If the breakpoint is a duplicate (already set previously), then it is up to
* the back-end to decide if it is an error or not.
*
* @param context the execution context of the breakpoint
* @param breakpoint the breakpoint to insert
* @param drm the DRM returning the breakpoint reference
*/
public void addBreakpoint(IBreakpointsTargetDMContext context, IDsfBreakpoint breakpoint,
DataRequestMonitor<IDsfBreakpointDMContext> drm);
/**
* Removes the breakpoint on the target.
*
* If the breakpoint doesn't exist, silently ignore it.
*
* @param context the execution context of the breakpoint
* @param dmc the reference of breakpoint to remove
* @param rm the asynchronous request monitor
*/
public void removeBreakpoint(IBreakpointsTargetDMContext context,
IDsfBreakpointDMContext dmc, RequestMonitor rm);
/**
* Updates the breakpoint properties on the target.
*
* To add/update/remove a property, simply create a map with
* the desired value(s) for the given key(s).
*
* A null value is used for removal of a property e.g.:
* properties.set(FUNCTION, null);
*
* @param context the execution context of the breakpoint
* @param dmc the reference of breakpoint to remove
* @param rm the asynchronous request monitor
*/
public void updateBreakpoint(IBreakpointsTargetDMContext context,
IDsfBreakpointDMContext dmc, Map<String,Object> properties,
DataRequestMonitor<IDsfBreakpointDMContext> drm);
} }

View file

@ -0,0 +1,43 @@
/*******************************************************************************
* Copyright (c) 2006 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.dd.dsf.debug.service;
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
import org.eclipse.dd.dsf.datamodel.IDMContext;
import org.eclipse.dd.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext;
import org.eclipse.dd.dsf.service.IDsfService;
/**
* Breakpoint service interface. The breakpoint service tracks platform breakpoint
* objects, and based on those, it manages breakpoints in the debugger back end.
* The purpose of the service model interface is to allow UI clients to display
* breakpoint status in more detail and more dynamically than it it possible with
* just the marker-based breakpoint object.
*/
public interface IBreakpointsManager extends IDsfService {
/**
* Install and begin tracking breakpoints for given context. The service
* will keep installing new breakpoints that appear in the IDE for this
* context until {@link #uninstallBreakpoints(IDMContext)} is called for that
* context.
* @param dmc Context to start tracking breakpoints for.
* @param rm Completion callback.
*/
public void startTrackingBreakpoints(IBreakpointsTargetDMContext dmc, RequestMonitor rm);
/**
* Uninstall and stop tracking breakpoints for the given context.
* @param dmc Context to start tracking breakpoints for.
* @param rm Completion callback.
*/
public void stopTrackingBreakpoints(IBreakpointsTargetDMContext dmc, RequestMonitor rm);
}