Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] AbstractGDBCDIDebugger.createSession()

Hi Mikhail,

I am looking at the new ICDIDebugger2 implementation in AbstractGDBCDIDebugger.createSession():


public ICDISession createSession( ILaunch launch, File executable, IProgressMonitor monitor )
           throws CoreException {
       boolean failed = false;
       ...
       Session session = createGDBSession( launch, executable, monitor );
       if ( session != null ) {
           ICDITarget[] targets = session.getTargets();
           for( int i = 0; i < targets.length; i++ ) {
               ...
           }
       }
       try {
           doStartSession( launch, session, monitor );
       }
       catch( CoreException e ) {
           failed = true;
           throw e;
       }
       finally {
           try {
               if ( failed || monitor.isCanceled() )
                   session.terminate();
           }
           catch( CDIException e1 ) {
           }
       }
       return session;
   }

I would expect the try-catch-finally clause to appear within the if (session !=null) {} statement that precedes it because it assumes that session is not null. Am I missing something.

Cheers
Matthias

--
Matthias Spycher, Principal Engineer, CoWare, Inc.
tel:+1(408)392-8596, fax:+1(408)346-4740, http://www.coware.com

This transmission is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. You are hereby notified that any dissemination, distribution or duplication of this transmission by someone other than the intended addressee or its designated agent is strictly prohibited. If your receipt of this transmission is in error, please notify this company immediately by reply to this transmission and delete it from your computer. Thank You. CoWare



Back to the top