mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Use the regular breakpoints instead of temporary because of the mi problems.
This commit is contained in:
parent
f428107d13
commit
118c87d65c
2 changed files with 72 additions and 12 deletions
|
@ -131,18 +131,7 @@ public class CDebugModel
|
||||||
if ( stopInMain )
|
if ( stopInMain )
|
||||||
{
|
{
|
||||||
ICDILocation location = cdiTarget.getSession().getBreakpointManager().createLocation( "", "main", 0 );
|
ICDILocation location = cdiTarget.getSession().getBreakpointManager().createLocation( "", "main", 0 );
|
||||||
try
|
((CDebugTarget)target[0]).setInternalTemporaryBreakpoint( location );
|
||||||
{
|
|
||||||
ICDIBreakpoint bkpt = cdiTarget.getSession().getBreakpointManager().
|
|
||||||
setLocationBreakpoint( ICDIBreakpoint.REGULAR, //ICDIBreakpoint.TEMPORARY,
|
|
||||||
location,
|
|
||||||
null,
|
|
||||||
null );
|
|
||||||
}
|
|
||||||
catch( CDIException e )
|
|
||||||
{
|
|
||||||
((CDebugElement)target[0]).targetRequestFailed( MessageFormat.format( "{0} occurred setting temporary breakpoint.", new String[] { e.toString() } ), e );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
target[0].resume();
|
target[0].resume();
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,11 @@ 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for CDebugTarget.
|
* Constructor for CDebugTarget.
|
||||||
* @param target
|
* @param target
|
||||||
|
@ -204,6 +209,7 @@ public class CDebugTarget extends CDebugElement
|
||||||
setProcess( process );
|
setProcess( process );
|
||||||
setCDITarget( cdiTarget );
|
setCDITarget( cdiTarget );
|
||||||
setBreakpoints( new HashMap( 5 ) );
|
setBreakpoints( new HashMap( 5 ) );
|
||||||
|
setTemporaryBreakpoints( new ArrayList() );
|
||||||
setConfiguration( cdiTarget.getSession().getConfiguration() );
|
setConfiguration( cdiTarget.getSession().getConfiguration() );
|
||||||
fSupportsTerminate = allowsTerminate & getConfiguration().supportsTerminate();
|
fSupportsTerminate = allowsTerminate & getConfiguration().supportsTerminate();
|
||||||
fSupportsDisconnect = allowsDisconnect & getConfiguration().supportsDisconnect();
|
fSupportsDisconnect = allowsDisconnect & getConfiguration().supportsDisconnect();
|
||||||
|
@ -1095,6 +1101,25 @@ 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();
|
||||||
|
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 );
|
||||||
|
@ -1187,6 +1212,7 @@ 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 )
|
||||||
{
|
{
|
||||||
|
@ -1512,6 +1538,24 @@ 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.
|
||||||
*
|
*
|
||||||
|
@ -1522,6 +1566,16 @@ 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.
|
||||||
*
|
*
|
||||||
|
@ -1716,4 +1770,21 @@ public class CDebugTarget extends CDebugElement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setInternalTemporaryBreakpoint( ICDILocation location ) throws DebugException
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ICDIBreakpoint bkpt = getCDISession().getBreakpointManager().
|
||||||
|
setLocationBreakpoint( ICDIBreakpoint.REGULAR, //ICDIBreakpoint.TEMPORARY,
|
||||||
|
location,
|
||||||
|
null,
|
||||||
|
null );
|
||||||
|
getTemporaryBreakpoints().add( bkpt );
|
||||||
|
}
|
||||||
|
catch( CDIException e )
|
||||||
|
{
|
||||||
|
targetRequestFailed( e.getMessage(), null );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue