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

Fix for PR 46358: NPE in the "setCurrentThread" method of "CDebugTarget".

This commit is contained in:
Mikhail Khodjaiants 2003-11-10 18:06:48 +00:00
parent 1c2bf651f9
commit 3c191ee1d6
2 changed files with 8 additions and 4 deletions

View file

@ -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-11-07 Mikhail Khodjaiants 2003-11-07 Mikhail Khodjaiants
Use the corresponding methods of 'ICBreakpoint' to set breakpoint properties. Use the corresponding methods of 'ICBreakpoint' to set breakpoint properties.
* CBreakpointManager.java * CBreakpointManager.java

View file

@ -1788,15 +1788,14 @@ public class CDebugTarget extends CDebugElement
public void setCurrentThread( IThread thread ) throws DebugException public void setCurrentThread( IThread thread ) throws DebugException
{ {
if ( !isSuspended() || !isAvailable() || thread == null || !(thread instanceof CThread) ) if ( !isSuspended() || !isAvailable() || thread == null || !(thread instanceof CThread) )
{
return; return;
}
try try
{ {
CThread oldThread = (CThread)getCurrentThread(); 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() ); getCDITarget().setCurrentThread( ((CThread)thread).getCDIThread() );
((CThread)thread).setCurrent( true ); ((CThread)thread).setCurrent( true );
} }