mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
Corrected position of the "try-catch-finally" clause in createSession.
This commit is contained in:
parent
ae43d3b681
commit
67a47ed1f9
2 changed files with 33 additions and 28 deletions
|
@ -1,3 +1,7 @@
|
|||
2006-03-31 Mikhail Khodjaiants
|
||||
Corrected position of the "try-catch-finally" clause in createSession.
|
||||
* AbstractGDBCDIDebugger.java
|
||||
|
||||
2006-03-31 Mikhail Khodjaiants
|
||||
Throw OperationCanceledException instead of IOException when getGDBprocess is canceled.
|
||||
* MIProcessAdapter.java
|
||||
|
|
|
@ -64,6 +64,7 @@ abstract public class AbstractGDBCDIDebugger implements ICDIDebugger2 {
|
|||
}
|
||||
Session session = createGDBSession( launch, executable, monitor );
|
||||
if ( session != null ) {
|
||||
try {
|
||||
ICDITarget[] targets = session.getTargets();
|
||||
for( int i = 0; i < targets.length; i++ ) {
|
||||
Process debugger = session.getSessionProcess( targets[i] );
|
||||
|
@ -71,46 +72,45 @@ abstract public class AbstractGDBCDIDebugger implements ICDIDebugger2 {
|
|||
IProcess debuggerProcess = DebugPlugin.newProcess( launch, debugger, renderDebuggerProcessLabel( launch ) );
|
||||
launch.addProcess( debuggerProcess );
|
||||
}
|
||||
try {
|
||||
((Target)targets[i]).getMISession().start();
|
||||
}
|
||||
doStartSession( launch, session, monitor );
|
||||
}
|
||||
catch( MIException e ) {
|
||||
failed = true;
|
||||
throw newCoreException( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
doStartSession( launch, session, monitor );
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
failed = true;
|
||||
throw e;
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
if ( failed || monitor.isCanceled() )
|
||||
if ( (failed || monitor.isCanceled()) && session != null )
|
||||
session.terminate();
|
||||
}
|
||||
catch( CDIException e1 ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
protected Session createGDBSession( ILaunch launch, File executable, IProgressMonitor monitor ) throws CoreException {
|
||||
Session session = null;
|
||||
IPath gdbPath = getGDBPath( launch );
|
||||
ILaunchConfiguration config = launch.getLaunchConfiguration();
|
||||
CommandFactory factory = getCommandFactory( config );
|
||||
String[] extraArgs = getExtraArguments( config );
|
||||
boolean usePty = config.getAttribute( ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, true );
|
||||
try {
|
||||
Session session = MIPlugin.getDefault().createSession( getSessionType( config ), gdbPath.toOSString(), factory, executable, extraArgs, usePty, monitor );
|
||||
session = MIPlugin.getDefault().createSession( getSessionType( config ), gdbPath.toOSString(), factory, executable, extraArgs, usePty, monitor );
|
||||
ICDISessionConfiguration sessionConfig = getSessionConfiguration( session );
|
||||
if ( sessionConfig != null ) {
|
||||
session.setConfiguration( sessionConfig );
|
||||
}
|
||||
return session;
|
||||
}
|
||||
catch( OperationCanceledException e ) {
|
||||
}
|
||||
catch( Exception e ) {
|
||||
// Catch all wrap them up and rethrow
|
||||
|
@ -119,6 +119,7 @@ abstract public class AbstractGDBCDIDebugger implements ICDIDebugger2 {
|
|||
}
|
||||
throw newCoreException( e );
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
protected int getSessionType( ILaunchConfiguration config ) throws CoreException {
|
||||
|
|
Loading…
Add table
Reference in a new issue