mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
Cleanup
This commit is contained in:
parent
bd3686071d
commit
cc5427a7e9
3 changed files with 24 additions and 30 deletions
|
@ -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.
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue