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

Added the 'IRunToAddress' interface to support the 'Run To Line' action in disassembly.

This commit is contained in:
Mikhail Khodjaiants 2003-01-13 22:25:31 +00:00
parent 0f9429319e
commit a729d837b8
4 changed files with 68 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2003-01-13 Mikhail Khodjaiants
Added the 'IRunToAddress' interface to support the 'Run To Line' action in disassembly.
* ICDebugTarget.java: extends IRunToAddress
* IRunToAddress.java: new interface
* CDebugTarget.java: implementation
2003-01-13 Mikhail Khodjaiants 2003-01-13 Mikhail Khodjaiants
Fix in the thread created event handler: do nothing if thread has already created. Fix in the thread created event handler: do nothing if thread has already created.
* CDebugTarget.java * CDebugTarget.java

View file

@ -20,6 +20,7 @@ public interface ICDebugTarget extends IDebugTarget,
IExecFileInfo, IExecFileInfo,
IRestart, IRestart,
IRunToLine, IRunToLine,
IRunToAddress,
IState, IState,
ISwitchToThread, ISwitchToThread,
ICBreakpointManager ICBreakpointManager

View file

@ -0,0 +1,31 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.core.model;
import org.eclipse.debug.core.DebugException;
/**
*
* Provides the ability to run a debug target to the given address.
*
* @since Jan 13, 2003
*/
public interface IRunToAddress
{
/**
* Returns whether this operation is currently available for this element.
*
* @return whether this operation is currently available
*/
public boolean canRunToAddress( long address );
/**
* Causes this element to run to specified address.
*
* @exception DebugException on failure. Reasons include:
*/
public void runToAddress( long address ) throws DebugException;
}

View file

@ -62,6 +62,7 @@ import org.eclipse.cdt.debug.core.model.ICWatchpoint;
import org.eclipse.cdt.debug.core.model.IDebuggerProcessSupport; import org.eclipse.cdt.debug.core.model.IDebuggerProcessSupport;
import org.eclipse.cdt.debug.core.model.IExecFileInfo; import org.eclipse.cdt.debug.core.model.IExecFileInfo;
import org.eclipse.cdt.debug.core.model.IGlobalVariable; import org.eclipse.cdt.debug.core.model.IGlobalVariable;
import org.eclipse.cdt.debug.core.model.IRunToAddress;
import org.eclipse.cdt.debug.core.model.IRunToLine; import org.eclipse.cdt.debug.core.model.IRunToLine;
import org.eclipse.cdt.debug.core.model.IState; import org.eclipse.cdt.debug.core.model.IState;
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
@ -861,6 +862,8 @@ public class CDebugTarget extends CDebugElement
return this; return this;
if ( adapter.equals( IRunToLine.class ) ) if ( adapter.equals( IRunToLine.class ) )
return this; return this;
if ( adapter.equals( IRunToAddress.class ) )
return this;
if ( adapter.equals( ICBreakpointManager.class ) ) if ( adapter.equals( ICBreakpointManager.class ) )
return this; return this;
if ( adapter.equals( DisassemblyManager.class ) ) if ( adapter.equals( DisassemblyManager.class ) )
@ -2107,4 +2110,31 @@ public class CDebugTarget extends CDebugElement
} }
return 0; return 0;
} }
/**
* @see org.eclipse.cdt.debug.core.model.IRunToAddress#canRunToAddress(long)
*/
public boolean canRunToAddress( long address )
{
// for now
return canResume();
}
/**
* @see org.eclipse.cdt.debug.core.model.IRunToAddress#runToLine(long)
*/
public void runToAddress( long address ) throws DebugException
{
if ( !canRunToAddress( address ) )
return;
ICDILocation location = getCDISession().getBreakpointManager().createLocation( address );
try
{
getCDITarget().runUntil( location );
}
catch( CDIException e )
{
targetRequestFailed( e.toString(), e );
}
}
} }