Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2004-03-23 20:18:47 +0000
committerMikhail Khodjaiants2004-03-23 20:18:47 +0000
commit09bd3230f1a9bbe1df90fe55d1c0c462a2a2c9e6 (patch)
tree10c644ebdf175e17ba88605127bde0a77c8a8ec9
parent8022dcf572d4c5da1a53ca3217e9e11288150f9a (diff)
downloadorg.eclipse.cdt-09bd3230f1a9bbe1df90fe55d1c0c462a2a2c9e6.tar.gz
org.eclipse.cdt-09bd3230f1a9bbe1df90fe55d1c0c462a2a2c9e6.tar.xz
org.eclipse.cdt-09bd3230f1a9bbe1df90fe55d1c0c462a2a2c9e6.zip
Fix for bug 48682: IThread.getBreakpoints() stubbed out.CDT_1_1_branch
-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 2f408a9950c..9c2244649b9 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-04-25 Mikhail Khodjaiants
Fix for bug 36909
* DisassemblyManager.java: check if the address of a stack frame is not 0;
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 8fb06161182..6d0a9c0b767 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
@@ -241,6 +241,11 @@ public class CDebugTarget extends CDebugElement
private CRegisterManager fRegisterManager;
/**
+ * The suspension thread.
+ */
+ private ICDIThread fSuspensionThread;
+
+ /**
* Whether the debugger process is default.
*/
private boolean fIsDebuggerProcessDefault = false;
@@ -1365,6 +1370,7 @@ public class CDebugTarget extends CDebugElement
setCurrentStateId( IState.SUSPENDED );
ICDISessionObject reason = event.getReason();
setCurrentStateInfo( reason );
+ setSuspensionThread();
List newThreads = refreshThreads();
if ( event.getSource() instanceof ICDITarget )
{
@@ -2585,4 +2591,40 @@ public class CDebugTarget extends CDebugElement
{
return getRegisterManager().getRegisterGroups();
}
+
+ 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 = findBreakpoint( ((ICDIBreakpointHit)getCurrentStateInfo()).getBreakpoint() );
+ else if ( getCurrentStateInfo() instanceof ICDIWatchpointTrigger )
+ bkpt = findBreakpoint( ((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 b87ed9c4385..1dbc89c5afd 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
@@ -411,7 +411,7 @@ public class CThread extends CDebugElement
*/
public IBreakpoint[] getBreakpoints()
{
- return null;
+ return ((CDebugTarget)getDebugTarget()).getThreadBreakpoints( this );
}
/* (non-Javadoc)

Back to the top