Skip to main content
summaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorMikhail Khodjaiants2003-11-10 18:20:06 +0000
committerMikhail Khodjaiants2003-11-10 18:20:06 +0000
commit6d9d51bfe99be251ab0d5307a4822c1491948f58 (patch)
treea19cec705b57b6eb8230d58a72ac942ac9922b6a /debug
parentb281e36768108b3b182411594c0c18aaa72c6ec8 (diff)
downloadorg.eclipse.cdt-6d9d51bfe99be251ab0d5307a4822c1491948f58.tar.gz
org.eclipse.cdt-6d9d51bfe99be251ab0d5307a4822c1491948f58.tar.xz
org.eclipse.cdt-6d9d51bfe99be251ab0d5307a4822c1491948f58.zip
Fix for PR 46358: NPE in the "setCurrentThread" method of "CDebugTarget".
Diffstat (limited to 'debug')
-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.java7
2 files changed, 8 insertions, 4 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog
index 8b9d1abf2b4..85ed6eb4f31 100644
--- a/debug/org.eclipse.cdt.debug.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.core/ChangeLog
@@ -1,3 +1,8 @@
+2003-11-07 Mikhail Khodjaiants
+ Fix for PR 46358: NPE in the "setCurrentThread" method of "CDebugTarget".
+ 'setCurrentThread': check if the old current thread is not null.
+ * CDebugTarget.java
+
2003-09-30 Mikhail Khodjaiants
Use the new 'equals' method of ICDIVaraiableObject to compare variables.
* CVariable.java
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 14b964173a4..497422ed4d7 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
@@ -2342,15 +2342,14 @@ public class CDebugTarget extends CDebugElement
public void setCurrentThread( IThread thread ) throws DebugException
{
if ( !isSuspended() || !isAvailable() || thread == null || !(thread instanceof CThread) )
- {
return;
- }
try
{
CThread oldThread = (CThread)getCurrentThread();
- if ( !oldThread.equals( thread ) )
+ if ( !thread.equals( oldThread ) )
{
- oldThread.setCurrent( false );
+ if ( oldThread != null )
+ oldThread.setCurrent( false );
getCDITarget().setCurrentThread( ((CThread)thread).getCDIThread() );
((CThread)thread).setCurrent( true );
}

Back to the top