1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 22:25:25 +02:00

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

This commit is contained in:
Mikhail Khodjaiants 2004-01-15 21:07:36 +00:00
parent 04ea9e6ee1
commit 53733e8522
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

@ -259,6 +259,11 @@ public class CDebugTarget extends CDebugElement
*/
private boolean fIsDebuggerProcessDefault = false;
/**
* The suspension thread.
*/
private ICDIThread fSuspensionThread;
/**
* The executable file.
*/
@ -1239,6 +1244,7 @@ public class CDebugTarget extends CDebugElement
ICDISessionObject reason = event.getReason();
setCurrentStateInfo( reason );
setRunningInfo( null );
setSuspensionThread();
List newThreads = refreshThreads();
if ( event.getSource() instanceof ICDITarget )
{
@ -2244,4 +2250,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)