Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2004-01-15 16:07:36 -0500
committerMikhail Khodjaiants2004-01-15 16:07:36 -0500
commit53733e8522b03834e35a4482ab79d359641f7f09 (patch)
tree5a45246db8b4987a381fad6cc2ae6bb56911ce28
parent04ea9e6ee11a6c6ef7413c79022c4015fdb67ebb (diff)
downloadorg.eclipse.cdt-53733e8522b03834e35a4482ab79d359641f7f09.tar.gz
org.eclipse.cdt-53733e8522b03834e35a4482ab79d359641f7f09.tar.xz
org.eclipse.cdt-53733e8522b03834e35a4482ab79d359641f7f09.zip
Fix for bug 48682: IThread.getBreakpoints() stubbed out.
-rw-r--r--debug/org.eclipse.cdt.debug.core/ChangeLog5
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java42
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java2
3 files changed, 48 insertions, 1 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog
index f49365506ac..1e9c087863f 100644
--- a/debug/org.eclipse.cdt.debug.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.core/ChangeLog
@@ -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.
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java
index 2e6015cdd06..a5243a9fc79 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java
@@ -260,6 +260,11 @@ public class CDebugTarget extends CDebugElement
private boolean fIsDebuggerProcessDefault = false;
/**
+ * The suspension thread.
+ */
+ private ICDIThread fSuspensionThread;
+
+ /**
* The executable file.
*/
private IFile fExecFile;
@@ -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()]);
+ }
}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java
index 6ddaf5bd635..373aaaf1750 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java
@@ -409,7 +409,7 @@ public class CThread extends CDebugElement
*/
public IBreakpoint[] getBreakpoints()
{
- return null;
+ return ((CDebugTarget)getDebugTarget()).getThreadBreakpoints( this );
}
/* (non-Javadoc)

Back to the top