diff options
author | Alain Magloire | 2004-10-20 21:01:01 +0000 |
---|---|---|
committer | Alain Magloire | 2004-10-20 21:01:01 +0000 |
commit | cc5427a7e9ca59eaa78fbfc46c55c3b4ff205e0c (patch) | |
tree | c3e92891d09971d74c03eb9cb8984372819fec93 | |
parent | bd3686071d2e0d504046297462da413c17224bd5 (diff) | |
download | org.eclipse.cdt-cc5427a7e9ca59eaa78fbfc46c55c3b4ff205e0c.tar.gz org.eclipse.cdt-cc5427a7e9ca59eaa78fbfc46c55c3b4ff205e0c.tar.xz org.eclipse.cdt-cc5427a7e9ca59eaa78fbfc46c55c3b4ff205e0c.zip |
Cleanup
3 files changed, 24 insertions, 30 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MISession.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MISession.java index 66e1ae2f5f4..641c53bafc0 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MISession.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MISession.java @@ -393,18 +393,12 @@ public class MISession extends Observable { // Although we will close the pipe(). It is cleaner // to give a chance to gdb to cleanup. - // send the exit(-gdb-exit). + // send the exit(-gdb-exit). But we only wait a maximum of 2 sec. MIGDBExit exit = factory.createMIGDBExit(); - txQueue.addCommand(exit); - - // Wait for the response - synchronized (exit) { - // RxThread will set the MIOutput on the cmd - // when the response arrive. - try { - exit.wait(2000); - } catch (InterruptedException e) { - } + try { + postCommand0(exit, 2000); + } catch (MIException e) { + //ignore any exception at this point. } // Make sure gdb is killed. diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBCDIDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBCDIDebugger.java index 3cc8545bed9..dec6875add1 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBCDIDebugger.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBCDIDebugger.java @@ -36,7 +36,7 @@ public class CygwinGDBCDIDebugger extends GDBCDIDebugger { // the "search-solib-path" and "stop-on-solib-events" options are not supported in CygWin } - public ICDISession createLaunchSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { + public Session createLaunchSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { Session session = (Session) super.createLaunchSession(config, exe, monitor); ICDITarget[] targets = session.getTargets(); for (int i = 0; i < targets.length; ++i) { @@ -61,7 +61,7 @@ public class CygwinGDBCDIDebugger extends GDBCDIDebugger { return session; } - public ICDISession createAttachSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { + public Session createAttachSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { Session session = (Session) super.createAttachSession(config, exe, monitor); ICDITarget[] targets = session.getTargets(); for (int i = 0; i < targets.length; ++i) { @@ -72,7 +72,7 @@ public class CygwinGDBCDIDebugger extends GDBCDIDebugger { return session; } - public ICDISession createCoreSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { + public Session createCoreSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { Session session = (Session) super.createCoreSession(config, exe, monitor); ICDITarget[] targets = session.getTargets(); for (int i = 0; i < targets.length; ++i) { diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java index 47247057315..1729c176d7a 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger.java @@ -24,8 +24,10 @@ import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; +import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; +import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; @@ -43,10 +45,7 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.model.IProcess; /** - * @author User - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates + * Implementing cdebugger extension point */ public class GDBCDIDebugger implements ICDIDebugger { @@ -59,7 +58,7 @@ public class GDBCDIDebugger implements ICDIDebugger { throws CoreException { fLaunch = launch; ILaunchConfiguration config = launch.getLaunchConfiguration(); - ICDISession dsession = null; + Session dsession = null; String debugMode = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); @@ -78,22 +77,23 @@ public class GDBCDIDebugger implements ICDIDebugger { dsession = createCoreSession(config, exe, monitor); } if (dsession != null) { - Process debugger; - try { - debugger = dsession.getSessionProcess(); - if (debugger != null ) { - IProcess debuggerProcess = DebugPlugin.newProcess(launch, debugger, renderDebuggerProcessLabel()); - launch.addProcess(debuggerProcess); + ICDITarget[] dtargets = dsession.getTargets(); + for (int i = 0; i < dtargets.length; i++) { + if (dtargets[i] instanceof Target) { + Target target = (Target)dtargets[i]; + Process debugger = target.getMISession().getSessionProcess(); + if (debugger != null ) { + IProcess debuggerProcess = DebugPlugin.newProcess(launch, debugger, renderDebuggerProcessLabel()); + launch.addProcess(debuggerProcess); + } } - } catch (CDIException e) { - // Should we just ignore ? } } return dsession; } - public ICDISession createLaunchSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { + public Session createLaunchSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { Session session = null; boolean failed = false; try { @@ -123,7 +123,7 @@ public class GDBCDIDebugger implements ICDIDebugger { } } - public ICDISession createAttachSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { + public Session createAttachSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { Session session = null; boolean failed = false; try { @@ -154,7 +154,7 @@ public class GDBCDIDebugger implements ICDIDebugger { } } - public ICDISession createCoreSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { + public Session createCoreSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { Session session = null; boolean failed = false; try { |