mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
support form debugger console
This commit is contained in:
parent
ac5f2b72ce
commit
35da5932ef
3 changed files with 30 additions and 1 deletions
6
launch/org.eclipse.cdt.launch/ChangeLog
Normal file
6
launch/org.eclipse.cdt.launch/ChangeLog
Normal file
|
@ -0,0 +1,6 @@
|
|||
2002-10-23 David Inglis
|
||||
|
||||
* /src/.../launch/internal/CoreFileDelegate.java
|
||||
* /src/.../launch/internal/LocalCLaunchConfigurationDelegate.java
|
||||
create new IProcess for debug console from CDISession and pass
|
||||
to newDebugTarget methods
|
|
@ -17,8 +17,10 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
|||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.QualifiedName;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
import org.eclipse.debug.core.ILaunch;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
import org.eclipse.debug.core.model.IProcess;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
@ -52,16 +54,23 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
|
|||
if (corefile == null) {
|
||||
cancel("No Corefile selected", ICDTLaunchConfigurationConstants.ERR_NO_COREFILE);
|
||||
}
|
||||
Process debugger = null;
|
||||
IProcess debuggerProcess = null;
|
||||
try {
|
||||
dsession = debugConfig.getDebugger().createCoreSession(config, exe, corefile);
|
||||
debugger = dsession.getSessionProcess();
|
||||
} catch (CDIException e) {
|
||||
abort("Failed Launching CDI Debugger", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
if ( debugger != null ) {
|
||||
debuggerProcess = DebugPlugin.getDefault().newProcess(launch, debugger, "Debug Console");
|
||||
launch.removeProcess(debuggerProcess);
|
||||
}
|
||||
CDebugModel.newCoreFileDebugTarget(
|
||||
launch,
|
||||
dsession.getCurrentTarget(),
|
||||
renderTargetLabel(debugConfig),
|
||||
debuggerProcess,
|
||||
exe.getProject());
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,8 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
|
|||
String[] commandArray = (String[]) command.toArray(new String[command.size()]);
|
||||
|
||||
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
|
||||
IProcess debuggerProcess = null;
|
||||
Process debugger;
|
||||
ICDebugConfiguration debugConfig = getDebugConfig(config);
|
||||
IFile exe = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(projectPath);
|
||||
ICDISession dsession = null;
|
||||
|
@ -86,12 +88,18 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
|
|||
ICDITarget dtarget = dsession.getTargets()[0];
|
||||
Process process = dtarget.getProcess();
|
||||
IProcess iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0]));
|
||||
debugger = dsession.getSessionProcess();
|
||||
if ( debugger != null ) {
|
||||
debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console");
|
||||
launch.removeProcess(debuggerProcess);
|
||||
}
|
||||
boolean stopInMain = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false);
|
||||
CDebugModel.newDebugTarget(
|
||||
launch,
|
||||
dsession.getCurrentTarget(),
|
||||
renderTargetLabel(debugConfig),
|
||||
iprocess,
|
||||
debuggerProcess,
|
||||
exe.getProject(),
|
||||
true,
|
||||
false,
|
||||
|
@ -103,10 +111,16 @@ public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
|
|||
cancel("No Process ID selected", ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID);
|
||||
}
|
||||
dsession = debugConfig.getDebugger().createAttachSession(config, exe, pid);
|
||||
debugger = dsession.getSessionProcess();
|
||||
if ( debugger != null ) {
|
||||
debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console");
|
||||
launch.removeProcess(debuggerProcess);
|
||||
}
|
||||
CDebugModel.newAttachDebugTarget(
|
||||
launch,
|
||||
dsession.getCurrentTarget(),
|
||||
renderTargetLabel(debugConfig),
|
||||
debuggerProcess,
|
||||
exe.getProject());
|
||||
}
|
||||
} catch (CDIException e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue