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

Fix for bug 48682: IThread.getBreakpoints() stubbed out.

This commit is contained in:
Mikhail Khodjaiants 2004-01-15 22:09:35 +00:00
parent 2e53b260f0
commit 020ee8aeea
3 changed files with 48 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2004-01-15 Mikhail Khodjaiants
Fix for bug 48682: IThread.getBreakpoints() stubbed out.
* CDebugTarget.java
* CThread.java
2003-12-23 Mikhail Khodjaiants
Fix for bug 49294: Source file doesn't change when switching between stack frames.
Do not use the breakpoint's markers for source lookup.

View file

@ -249,6 +249,11 @@ public class CDebugTarget extends CDebugElement
*/
private boolean fIsDebuggerProcessDefault = false;
/**
* The suspension thread.
*/
private ICDIThread fSuspensionThread;
/**
* The executable file.
*/
@ -1227,6 +1232,7 @@ public class CDebugTarget extends CDebugElement
ICDISessionObject reason = event.getReason();
setCurrentStateInfo( reason );
setRunningInfo( null );
setSuspensionThread();
List newThreads = refreshThreads();
if ( event.getSource() instanceof ICDITarget )
{
@ -2232,4 +2238,40 @@ public class CDebugTarget extends CDebugElement
if ( getBreakpointManager() != null )
getBreakpointManager().dispose();
}
protected ICDIThread getSuspensionThread()
{
return fSuspensionThread;
}
private void setSuspensionThread()
{
fSuspensionThread = null;
try
{
fSuspensionThread = getCDITarget().getCurrentThread();
}
catch( CDIException e )
{
// ignore
}
}
protected IBreakpoint[] getThreadBreakpoints( CThread thread )
{
List list = new ArrayList( 1 );
if ( isSuspended() && thread != null &&
getSuspensionThread() != null &&
getSuspensionThread().equals( thread.getCDIThread() ) )
{
IBreakpoint bkpt = null;
if ( getCurrentStateInfo() instanceof ICDIBreakpointHit )
bkpt = getBreakpointManager().getBreakpoint( ((ICDIBreakpointHit)getCurrentStateInfo()).getBreakpoint() );
else if ( getCurrentStateInfo() instanceof ICDIWatchpointTrigger )
bkpt = getBreakpointManager().getBreakpoint( ((ICDIWatchpointTrigger)getCurrentStateInfo()).getWatchpoint() );
if ( bkpt != null )
list.add( bkpt );
}
return (IBreakpoint[])list.toArray( new IBreakpoint[list.size()]);
}
}

View file

@ -409,7 +409,7 @@ public class CThread extends CDebugElement
*/
public IBreakpoint[] getBreakpoints()
{
return null;
return ((CDebugTarget)getDebugTarget()).getThreadBreakpoints( this );
}
/* (non-Javadoc)