mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Terminate debug session when it is disconnected from target.
This commit is contained in:
parent
170cc44681
commit
e17e87f30e
1 changed files with 9 additions and 14 deletions
|
@ -663,7 +663,7 @@ public class CDebugTarget extends CDebugElement
|
||||||
*/
|
*/
|
||||||
public boolean canDisconnect()
|
public boolean canDisconnect()
|
||||||
{
|
{
|
||||||
return supportsDisconnect() && !isDisconnected();
|
return supportsDisconnect() && !isDisconnected() && isSuspended();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -685,7 +685,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
getCDITarget().disconnect();
|
getCDITarget().disconnect();
|
||||||
disconnected();
|
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
|
@ -1005,6 +1004,14 @@ public class CDebugTarget extends CDebugElement
|
||||||
{
|
{
|
||||||
if ( !isDisconnected() )
|
if ( !isDisconnected() )
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getCDISession().terminate();
|
||||||
|
}
|
||||||
|
catch( CDIException e )
|
||||||
|
{
|
||||||
|
logError( e );
|
||||||
|
}
|
||||||
setDisconnected( true );
|
setDisconnected( true );
|
||||||
cleanup();
|
cleanup();
|
||||||
fireTerminateEvent();
|
fireTerminateEvent();
|
||||||
|
@ -1373,18 +1380,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
{
|
{
|
||||||
setCurrentStateId( IState.DISCONNECTED );
|
setCurrentStateId( IState.DISCONNECTED );
|
||||||
setCurrentStateInfo( null );
|
setCurrentStateInfo( null );
|
||||||
IProcess process = getProcess();
|
|
||||||
if ( process != null )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
process.terminate();
|
|
||||||
}
|
|
||||||
catch( DebugException e )
|
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( e.getStatus() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
disconnected();
|
disconnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue