blob: a55424a162707d9c46a57144e50e4d9e5596a663 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004 INRIA.
* 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:
* Freddy Allilaire (INRIA) - initial API and implementation
*******************************************************************************/
package org.eclipse.m2m.atl.debug.core;
import org.eclipse.core.resources.IMarkerDelta;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IThread;
/**
* The ATL run target.
*
* @author <a href="mailto:freddy.allilaire@obeo.fr">Freddy Allilaire</a>
*/
public class AtlRunTarget implements IDebugTarget {
boolean isTerminated;
private ILaunch launch;
/**
* Constructor.
*
* @param launch the configuration
*/
public AtlRunTarget(ILaunch launch) {
this.launch = launch;
this.isTerminated = false;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDebugTarget#getProcess()
*/
public IProcess getProcess() {
return null;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDebugTarget#getThreads()
*/
public IThread[] getThreads() throws DebugException {
return new IThread[0];
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDebugTarget#hasThreads()
*/
public boolean hasThreads() throws DebugException {
return false;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDebugTarget#getName()
*/
public String getName() throws DebugException {
return AtlDebugModelConstants.RUNTARGETNAME;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDebugTarget#supportsBreakpoint(org.eclipse.debug.core.model.IBreakpoint)
*/
public boolean supportsBreakpoint(IBreakpoint breakpoint) {
return false;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
public String getModelIdentifier() {
return AtlDebugModelConstants.ATL_DEBUG_MODEL_ID;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
public IDebugTarget getDebugTarget() {
return this;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
public ILaunch getLaunch() {
return launch;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.ITerminate#canTerminate()
*/
public boolean canTerminate() {
return !isTerminated;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.ITerminate#isTerminated()
*/
public boolean isTerminated() {
return isTerminated;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.ITerminate#terminate()
*/
public void terminate() throws DebugException {
isTerminated = true;
DebugEvent event = new DebugEvent(getDebugTarget(), DebugEvent.TERMINATE);
DebugEvent[] debugEvents = new DebugEvent[1];
debugEvents[0] = event;
DebugPlugin.getDefault().fireDebugEventSet(debugEvents);
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.ISuspendResume#canResume()
*/
public boolean canResume() {
return false;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
*/
public boolean canSuspend() {
return false;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
*/
public boolean isSuspended() {
return false;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.ISuspendResume#resume()
*/
public void resume() throws DebugException {
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.ISuspendResume#suspend()
*/
public void suspend() throws DebugException {
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.IBreakpointListener#breakpointAdded(org.eclipse.debug.core.model.IBreakpoint)
*/
public void breakpointAdded(IBreakpoint breakpoint) {
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint,
* org.eclipse.core.resources.IMarkerDelta)
*/
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint,
* org.eclipse.core.resources.IMarkerDelta)
*/
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDisconnect#canDisconnect()
*/
public boolean canDisconnect() {
return false;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDisconnect#disconnect()
*/
public void disconnect() throws DebugException {
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IDisconnect#isDisconnected()
*/
public boolean isDisconnected() {
return false;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#supportsStorageRetrieval()
*/
public boolean supportsStorageRetrieval() {
return false;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long)
*/
public IMemoryBlock getMemoryBlock(long startAddress, long length) throws DebugException {
return null;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
public <T> T getAdapter(Class<T> adapter) {
return null;
}
}