mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
'exec-until' instead of temporary breakpoints for 'run to line'.
This commit is contained in:
parent
2df67f8279
commit
063ca7472b
3 changed files with 59 additions and 66 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-11-28 Mikhail Khodjaiants
|
||||||
|
'exec-until' instead of temporary breakpoints for 'run to line'.
|
||||||
|
* CDebugTarget.java
|
||||||
|
* CThread.java
|
||||||
|
|
||||||
2002-11-28 Mikhail Khodjaiants
|
2002-11-28 Mikhail Khodjaiants
|
||||||
Live editing of the memory view: removed support of the 'Save Changes' action.
|
Live editing of the memory view: removed support of the 'Save Changes' action.
|
||||||
* IFormattedMemoryBlock.java
|
* IFormattedMemoryBlock.java
|
||||||
|
|
|
@ -211,11 +211,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
*/
|
*/
|
||||||
private List fRegisterGroups;
|
private List fRegisterGroups;
|
||||||
|
|
||||||
/**
|
|
||||||
* Collection of temporary breakpoints set at this target. Values are of type <code>ICBreakpoint</code>.
|
|
||||||
*/
|
|
||||||
private List fTemporaryBreakpoints;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A memory manager for this target.
|
* A memory manager for this target.
|
||||||
*/
|
*/
|
||||||
|
@ -253,7 +248,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
setProcesses( debuggeeProcess, debuggerProcess );
|
setProcesses( debuggeeProcess, debuggerProcess );
|
||||||
setCDITarget( cdiTarget );
|
setCDITarget( cdiTarget );
|
||||||
setBreakpoints( new HashMap( 5 ) );
|
setBreakpoints( new HashMap( 5 ) );
|
||||||
setTemporaryBreakpoints( new ArrayList() );
|
|
||||||
setExecFile( file );
|
setExecFile( file );
|
||||||
if ( getExecFile() != null )
|
if ( getExecFile() != null )
|
||||||
{
|
{
|
||||||
|
@ -849,6 +843,8 @@ public class CDebugTarget extends CDebugElement
|
||||||
return this;
|
return this;
|
||||||
if ( adapter.equals( IExecFileInfo.class ) )
|
if ( adapter.equals( IExecFileInfo.class ) )
|
||||||
return this;
|
return this;
|
||||||
|
if ( adapter.equals( IRunToLine.class ) )
|
||||||
|
return this;
|
||||||
return super.getAdapter( adapter );
|
return super.getAdapter( adapter );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1197,28 +1193,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes all temporary breakpoints from this target.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
protected void removeAllTemporaryBreakpoints()
|
|
||||||
{
|
|
||||||
ICDIBreakpoint[] cdiBreakpoints = (ICDIBreakpoint[])getTemporaryBreakpoints().toArray( new ICDIBreakpoint[0] );
|
|
||||||
ICDIBreakpointManager bm = getCDISession().getBreakpointManager();
|
|
||||||
if ( cdiBreakpoints.length > 0 )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
bm.deleteBreakpoints( cdiBreakpoints );
|
|
||||||
getTemporaryBreakpoints().clear();
|
|
||||||
}
|
|
||||||
catch( CDIException e )
|
|
||||||
{
|
|
||||||
logError( e );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void changeBreakpointProperties( CBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException
|
protected void changeBreakpointProperties( CBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException
|
||||||
{
|
{
|
||||||
ICDIBreakpoint cdiBreakpoint = findCDIBreakpoint( breakpoint );
|
ICDIBreakpoint cdiBreakpoint = findCDIBreakpoint( breakpoint );
|
||||||
|
@ -1291,7 +1265,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
setCurrentStateId( IState.SUSPENDED );
|
setCurrentStateId( IState.SUSPENDED );
|
||||||
ICDISessionObject reason = event.getReason();
|
ICDISessionObject reason = event.getReason();
|
||||||
setCurrentStateInfo( reason );
|
setCurrentStateInfo( reason );
|
||||||
removeAllTemporaryBreakpoints();
|
|
||||||
List newThreads = refreshThreads();
|
List newThreads = refreshThreads();
|
||||||
if ( event.getSource() instanceof ICDITarget )
|
if ( event.getSource() instanceof ICDITarget )
|
||||||
{
|
{
|
||||||
|
@ -1577,24 +1550,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
return fBreakpoints;
|
return fBreakpoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the list of temporary breakpoints installed in this debug target.
|
|
||||||
*
|
|
||||||
* @return list of installed temporary breakpoints
|
|
||||||
*/
|
|
||||||
protected List getTemporaryBreakpoints()
|
|
||||||
{
|
|
||||||
return fTemporaryBreakpoints;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Uninstalles all temporary breakpoints installed in this debug target.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
protected void deleteTemporaryBreakpoints()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the map of breakpoints installed in this debug target.
|
* Sets the map of breakpoints installed in this debug target.
|
||||||
*
|
*
|
||||||
|
@ -1605,16 +1560,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
fBreakpoints = breakpoints;
|
fBreakpoints = breakpoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the list of temporary breakpoints installed in this debug target.
|
|
||||||
*
|
|
||||||
* @param breakpoints breakpoints list
|
|
||||||
*/
|
|
||||||
private void setTemporaryBreakpoints( List breakpoints )
|
|
||||||
{
|
|
||||||
fTemporaryBreakpoints = breakpoints;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the debug configuration of this target.
|
* Returns the debug configuration of this target.
|
||||||
*
|
*
|
||||||
|
@ -1805,12 +1750,10 @@ public class CDebugTarget extends CDebugElement
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ICDIBreakpoint bkpt = getCDISession().getBreakpointManager().
|
getCDISession().getBreakpointManager().setLocationBreakpoint( ICDIBreakpoint.TEMPORARY,
|
||||||
setLocationBreakpoint( ICDIBreakpoint.REGULAR, //ICDIBreakpoint.TEMPORARY,
|
location,
|
||||||
location,
|
null,
|
||||||
null,
|
null );
|
||||||
null );
|
|
||||||
getTemporaryBreakpoints().add( bkpt );
|
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
|
@ -1833,11 +1776,16 @@ public class CDebugTarget extends CDebugElement
|
||||||
public void runToLine( IResource resource, int lineNumber ) throws DebugException
|
public void runToLine( IResource resource, int lineNumber ) throws DebugException
|
||||||
{
|
{
|
||||||
if ( !canRunToLine( resource, lineNumber ) )
|
if ( !canRunToLine( resource, lineNumber ) )
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
|
ICDILocation location = getCDISession().getBreakpointManager().createLocation( resource.getLocation().lastSegment(), null, lineNumber );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getCDITarget().runUntil( location );
|
||||||
|
}
|
||||||
|
catch( CDIException e )
|
||||||
|
{
|
||||||
|
targetRequestFailed( e.toString(), e );
|
||||||
}
|
}
|
||||||
setInternalTemporaryBreakpoint( getCDISession().getBreakpointManager().createLocation( resource.getLocation().lastSegment(), null, lineNumber ) );
|
|
||||||
resume();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -13,11 +13,13 @@ import java.util.List;
|
||||||
import org.eclipse.cdt.debug.core.IDummyStackFrame;
|
import org.eclipse.cdt.debug.core.IDummyStackFrame;
|
||||||
import org.eclipse.cdt.debug.core.IInstructionStep;
|
import org.eclipse.cdt.debug.core.IInstructionStep;
|
||||||
import org.eclipse.cdt.debug.core.IRestart;
|
import org.eclipse.cdt.debug.core.IRestart;
|
||||||
|
import org.eclipse.cdt.debug.core.IRunToLine;
|
||||||
import org.eclipse.cdt.debug.core.IState;
|
import org.eclipse.cdt.debug.core.IState;
|
||||||
import org.eclipse.cdt.debug.core.ISwitchToFrame;
|
import org.eclipse.cdt.debug.core.ISwitchToFrame;
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
|
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange;
|
import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
|
import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDISignal;
|
import org.eclipse.cdt.debug.core.cdi.ICDISignal;
|
||||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent;
|
import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent;
|
||||||
|
@ -33,6 +35,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode;
|
import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode;
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.debug.core.DebugEvent;
|
import org.eclipse.debug.core.DebugEvent;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
|
@ -50,6 +53,7 @@ public class CThread extends CDebugElement
|
||||||
implements IThread,
|
implements IThread,
|
||||||
IState,
|
IState,
|
||||||
IRestart,
|
IRestart,
|
||||||
|
IRunToLine,
|
||||||
IInstructionStep,
|
IInstructionStep,
|
||||||
ISwitchToFrame,
|
ISwitchToFrame,
|
||||||
ICDIEventListener
|
ICDIEventListener
|
||||||
|
@ -1087,4 +1091,40 @@ public class CThread extends CDebugElement
|
||||||
{
|
{
|
||||||
return fLastStackDepth;
|
return fLastStackDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.IRunToLine#canRunToLine(IResource, int)
|
||||||
|
*/
|
||||||
|
public boolean canRunToLine( IResource resource, int lineNumber )
|
||||||
|
{
|
||||||
|
return canResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.IRunToLine#runToLine(IResource, int)
|
||||||
|
*/
|
||||||
|
public void runToLine( IResource resource, int lineNumber ) throws DebugException
|
||||||
|
{
|
||||||
|
if ( !canRunToLine( resource, lineNumber ) )
|
||||||
|
return;
|
||||||
|
ICDILocation location = getCDISession().getBreakpointManager().createLocation( resource.getLocation().lastSegment(), null, lineNumber );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getCDIThread().runUntil( location );
|
||||||
|
}
|
||||||
|
catch( CDIException e )
|
||||||
|
{
|
||||||
|
targetRequestFailed( e.toString(), e );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class)
|
||||||
|
*/
|
||||||
|
public Object getAdapter(Class adapter)
|
||||||
|
{
|
||||||
|
if ( adapter.equals( IRunToLine.class ) )
|
||||||
|
return this;
|
||||||
|
return super.getAdapter(adapter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue