1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00
This commit is contained in:
Alain Magloire 2004-10-20 21:01:01 +00:00
parent bd3686071d
commit cc5427a7e9
3 changed files with 24 additions and 30 deletions

View file

@ -393,18 +393,12 @@ public class MISession extends Observable {
// Although we will close the pipe(). It is cleaner // Although we will close the pipe(). It is cleaner
// to give a chance to gdb to cleanup. // 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(); MIGDBExit exit = factory.createMIGDBExit();
txQueue.addCommand(exit); try {
postCommand0(exit, 2000);
// Wait for the response } catch (MIException e) {
synchronized (exit) { //ignore any exception at this point.
// RxThread will set the MIOutput on the cmd
// when the response arrive.
try {
exit.wait(2000);
} catch (InterruptedException e) {
}
} }
// Make sure gdb is killed. // Make sure gdb is killed.

View file

@ -36,7 +36,7 @@ public class CygwinGDBCDIDebugger extends GDBCDIDebugger {
// the "search-solib-path" and "stop-on-solib-events" options are not supported in CygWin // 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); Session session = (Session) super.createLaunchSession(config, exe, monitor);
ICDITarget[] targets = session.getTargets(); ICDITarget[] targets = session.getTargets();
for (int i = 0; i < targets.length; ++i) { for (int i = 0; i < targets.length; ++i) {
@ -61,7 +61,7 @@ public class CygwinGDBCDIDebugger extends GDBCDIDebugger {
return session; 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); Session session = (Session) super.createAttachSession(config, exe, monitor);
ICDITarget[] targets = session.getTargets(); ICDITarget[] targets = session.getTargets();
for (int i = 0; i < targets.length; ++i) { for (int i = 0; i < targets.length; ++i) {
@ -72,7 +72,7 @@ public class CygwinGDBCDIDebugger extends GDBCDIDebugger {
return session; 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); Session session = (Session) super.createCoreSession(config, exe, monitor);
ICDITarget[] targets = session.getTargets(); ICDITarget[] targets = session.getTargets();
for (int i = 0; i < targets.length; ++i) { for (int i = 0; i < targets.length; ++i) {

View file

@ -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.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; 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.Session;
import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; 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.IProject;
import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -43,10 +45,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.IProcess; import org.eclipse.debug.core.model.IProcess;
/** /**
* @author User * Implementing cdebugger extension point
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/ */
public class GDBCDIDebugger implements ICDIDebugger { public class GDBCDIDebugger implements ICDIDebugger {
@ -59,7 +58,7 @@ public class GDBCDIDebugger implements ICDIDebugger {
throws CoreException { throws CoreException {
fLaunch = launch; fLaunch = launch;
ILaunchConfiguration config = launch.getLaunchConfiguration(); ILaunchConfiguration config = launch.getLaunchConfiguration();
ICDISession dsession = null; Session dsession = null;
String debugMode = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, String debugMode = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
@ -78,22 +77,23 @@ public class GDBCDIDebugger implements ICDIDebugger {
dsession = createCoreSession(config, exe, monitor); dsession = createCoreSession(config, exe, monitor);
} }
if (dsession != null) { if (dsession != null) {
Process debugger; ICDITarget[] dtargets = dsession.getTargets();
try { for (int i = 0; i < dtargets.length; i++) {
debugger = dsession.getSessionProcess(); if (dtargets[i] instanceof Target) {
if (debugger != null ) { Target target = (Target)dtargets[i];
IProcess debuggerProcess = DebugPlugin.newProcess(launch, debugger, renderDebuggerProcessLabel()); Process debugger = target.getMISession().getSessionProcess();
launch.addProcess(debuggerProcess); if (debugger != null ) {
IProcess debuggerProcess = DebugPlugin.newProcess(launch, debugger, renderDebuggerProcessLabel());
launch.addProcess(debuggerProcess);
}
} }
} catch (CDIException e) {
// Should we just ignore ?
} }
} }
return dsession; 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; Session session = null;
boolean failed = false; boolean failed = false;
try { 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; Session session = null;
boolean failed = false; boolean failed = false;
try { 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; Session session = null;
boolean failed = false; boolean failed = false;
try { try {