Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 187326 Details for
Bug 237306
[multicore][multi-process] Support for Multi-Process debugging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Updated Prototype patch to create a new process for HEAD
zpatch.txt (text/plain), 22.30 KB, created by
Marc Khouzam
on 2011-01-21 15:43:43 EST
(
hide
)
Description:
Updated Prototype patch to create a new process for HEAD
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2011-01-21 15:43:43 EST
Size:
22.30 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java,v >retrieving revision 1.1 >diff -u -r1.1 GDBProcesses_7_2.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java 16 Dec 2010 03:13:31 -0000 1.1 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java 21 Jan 2011 20:42:56 -0000 >@@ -10,11 +10,22 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.gdb.service; > >+import java.util.Map; >+import java.util.Properties; >+ >+import org.eclipse.cdt.debug.core.CDebugUtils; >+import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; > import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; >+import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor; >+import org.eclipse.cdt.dsf.concurrent.ReflectionSequence; > import org.eclipse.cdt.dsf.concurrent.RequestMonitor; >+import org.eclipse.cdt.dsf.concurrent.Sequence; > import org.eclipse.cdt.dsf.datamodel.DMContexts; > import org.eclipse.cdt.dsf.datamodel.IDMContext; >+import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; >+import org.eclipse.cdt.dsf.debug.service.command.ICommand; > import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; >+import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; > import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; > import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; > import org.eclipse.cdt.dsf.mi.service.IMICommandControl; >@@ -22,20 +33,22 @@ > import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext; > import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; > import org.eclipse.cdt.dsf.mi.service.command.output.MIAddInferiorInfo; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakpoint; > import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; > import org.eclipse.cdt.dsf.service.DsfSession; >+import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; > > /** >- * Adding support for multi-process with GDB 7.2 >- * > * @since 4.0 > */ > public class GDBProcesses_7_2 extends GDBProcesses_7_1 { > > private CommandFactory fCommandFactory; > private IGDBControl fCommandControl; >+ private IGDBBackend fBackend; > > public GDBProcesses_7_2(DsfSession session) { > super(session); >@@ -62,6 +75,8 @@ > private void doInitialize(RequestMonitor requestMonitor) { > fCommandControl = getServicesTracker().getService(IGDBControl.class); > fCommandFactory = getServicesTracker().getService(IMICommandControl.class).getCommandFactory(); >+ fBackend = getServicesTracker().getService(IGDBBackend.class); >+ > requestMonitor.done(); > } > >@@ -69,6 +84,161 @@ > public void shutdown(RequestMonitor requestMonitor) { > super.shutdown(requestMonitor); > } >+ >+ >+ @Override >+ protected boolean doIsDebuggerAttachSupported() { >+ return true; >+ } >+ >+ >+ @Override >+ protected boolean doCanDetachDebuggerFromProcess() { >+ return true; >+ } >+ >+ protected class DebugNewProcessSequence extends ReflectionSequence { >+ >+ private String fBinaryName; >+ private Map<String, Object> fAttributes; >+ private IMIContainerDMContext fContainerCtx; >+ // Store the dataRM so that we can fill it with the container context that we will be creating >+ private DataRequestMonitor<IDMContext> fDataRequestMonitor; >+ >+ public DebugNewProcessSequence(IDMContext dmc, String file, Map<String, Object> attributes, final DataRequestMonitor<IDMContext> rm) { >+ super(GDBProcesses_7_2.this.getExecutor(), rm); >+ fBinaryName = file; >+ fAttributes = attributes; >+ fDataRequestMonitor = rm; >+ } >+ >+ @Override >+ protected String[] getExecutionOrder(String group) { >+ if (GROUP_TOP_LEVEL.equals(group)) { >+ return new String[] { >+ "stepAddInferior", //$NON-NLS-1$ >+ "stepSetEnvironmentVariables", //$NON-NLS-1$ >+ "stepSetExecutable", //$NON-NLS-1$ >+ "stepSetArguments", //$NON-NLS-1$ >+ "stepStartExecution", //$NON-NLS-1$ >+ }; >+ } >+ return null; >+ } >+ >+ /** >+ * Start executing the program. >+ */ >+ @Execute >+ public void stepAddInferior(final RequestMonitor rm) { >+ fCommandControl.queueCommand( >+ fCommandFactory.createMIAddInferior(fCommandControl.getContext()), >+ new DataRequestMonitor<MIAddInferiorInfo>(ImmediateExecutor.getInstance(), rm) { >+ @Override >+ protected void handleSuccess() { >+ final String groupId = getData().getGroupId(); >+ if (groupId == null || groupId.trim().length() == 0) { >+ rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid gdb group id.", null)); //$NON-NLS-1$ >+ rm.done(); >+ return; >+ } >+ >+ IProcessDMContext procCtx = createProcessContext(fCommandControl.getContext(), null); >+ fContainerCtx = createContainerContext(procCtx, groupId); >+ rm.done(); >+ } >+ }); >+ } >+ >+ /** >+ * Specify environment variables if needed >+ */ >+ @Execute >+ public void stepSetEnvironmentVariables(RequestMonitor rm) { >+ boolean clear = false; >+ Properties properties = new Properties(); >+ try { >+ // here we need to pass the proper container context >+ clear = fBackend.getClearEnvironment(); >+ properties = fBackend.getEnvironmentVariables(); >+ } catch (CoreException e) { >+ rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot get environment information", e)); //$NON-NLS-1$ >+ rm.done(); >+ return; >+ } >+ >+ if (clear == true || properties.size() > 0) { >+ // here we need to pass the proper container context >+ fCommandControl.setEnvironment(properties, clear, rm); >+ } else { >+ rm.done(); >+ } >+ } >+ >+ /** >+ * Specify the executable file to be debugged and read the symbol table. >+ */ >+ @Execute >+ public void stepSetExecutable(RequestMonitor rm) { >+ boolean noFileCommand = CDebugUtils.getAttribute(fAttributes, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP, >+ IGDBLaunchConfigurationConstants.DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP_DEFAULT); >+ >+ if (!noFileCommand && fBinaryName != null && fBinaryName.length() > 0) { >+ fCommandControl.queueCommand( >+ fCommandFactory.createMIFileExecAndSymbols(fContainerCtx, fBinaryName), >+ new DataRequestMonitor<MIInfo>(getExecutor(), rm)); >+ } else { >+ rm.done(); >+ } >+ } >+ >+ /** >+ * Specify the arguments to the executable file. >+ */ >+ @Execute >+ public void stepSetArguments(RequestMonitor rm) { >+ try { >+ String args = fBackend.getProgramArguments(); >+ >+ if (args != null) { >+ fCommandControl.queueCommand( >+ // here we need to pass the proper container context >+ fCommandFactory.createMIGDBSetArgs(fCommandControl.getContext(), args), >+ new DataRequestMonitor<MIInfo>(getExecutor(), rm)); >+ } else { >+ rm.done(); >+ } >+ } catch (CoreException e) { >+ rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot get inferior arguments", e)); //$NON-NLS-1$ >+ rm.done(); >+ } >+ } >+ >+ /** >+ * Start executing the program. >+ */ >+ @Execute >+ public void stepStartExecution(final RequestMonitor rm) { >+ startOrRestart(fContainerCtx, fAttributes, false, new DataRequestMonitor<IMIContainerDMContext>(ImmediateExecutor.getInstance(), rm) { >+ @Override >+ protected void handleSuccess() { >+ // Set the container that we created >+ fDataRequestMonitor.setData(getData()); >+ >+ // Don't call fDataRequestMonitor.done(), the sequence will >+ // automatically do that when we call rm.done(); >+ rm.done(); >+ } >+ }); >+ } >+ } >+ >+ @Override >+ public void debugNewProcess(IDMContext dmc, String file, >+ Map<String, Object> attributes, DataRequestMonitor<IDMContext> rm) { >+ Sequence debugNewProcess = new DebugNewProcessSequence(dmc, file, attributes, rm); >+ ImmediateExecutor.getInstance().execute(debugNewProcess); >+ } > > @Override > public void attachDebuggerToProcess(final IProcessDMContext procCtx, final DataRequestMonitor<IDMContext> rm) { >@@ -150,5 +320,225 @@ > rm.done(); > } > } >+ >+ protected class StartOrRestartProcessSequence extends ReflectionSequence { >+ >+ // This variable will be used to store the original container context, >+ // but once the new process is start (restarted), it will contain the new >+ // container context. This new container context has for parent the process >+ // context, which holds the new pid. >+ private IMIContainerDMContext fContainerDmc; >+ >+ private MIBreakpoint fUserBreakpoint = null; >+ private boolean fUserBreakpointIsOnMain = false; >+ private boolean fReverseEnabled; >+ private boolean fRestart; >+ private Map<String, Object> fAttributes; >+ // Store the dataRM so that we can fill it with the container context that we will be creating >+ private DataRequestMonitor<IMIContainerDMContext> fDataRequestMonitor; >+ >+ public StartOrRestartProcessSequence(IMIContainerDMContext containerDmc, Map<String, Object> attributes, >+ boolean restart, DataRequestMonitor<IMIContainerDMContext> rm) { >+ super(GDBProcesses_7_2.this.getExecutor(), rm); >+ fContainerDmc = containerDmc; >+ fAttributes = attributes; >+ fRestart = restart; >+ fDataRequestMonitor = rm; >+ fReverseEnabled = CDebugUtils.getAttribute(attributes, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE, >+ IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT); >+ } >+ >+ @Override >+ protected String[] getExecutionOrder(String group) { >+ if (GROUP_TOP_LEVEL.equals(group)) { >+ return new String[] { >+ "stepInsertStopOnMainBreakpoint", //$NON-NLS-1$ >+ "stepSetBreakpointForReverse", //$NON-NLS-1$ >+ "stepRunProgram", //$NON-NLS-1$ >+ "stepSetReverseOff", //$NON-NLS-1$ >+ "stepEnableReverse", //$NON-NLS-1$ >+ "stepContinue", //$NON-NLS-1$ >+ }; >+ } >+ return null; >+ } >+ >+ /** >+ * If the user requested a 'stopOnMain', let's set the temporary breakpoint >+ * where the user specified. >+ */ >+ @Execute >+ public void stepInsertStopOnMainBreakpoint(final RequestMonitor rm) { >+ boolean userRequestedStop = CDebugUtils.getAttribute(fAttributes, >+ ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, >+ false); >+ >+ if (userRequestedStop) { >+ String userStopSymbol = CDebugUtils.getAttribute(fAttributes, >+ ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, >+ ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT); >+ >+ fCommandControl.queueCommand( >+ fCommandFactory.createMIBreakInsert((IBreakpointsTargetDMContext)fCommandControl.getContext(), >+ true, false, null, 0, userStopSymbol, 0), >+ new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), rm) { >+ @Override >+ public void handleSuccess() { >+ if (getData() != null) { >+ MIBreakpoint[] breakpoints = getData().getMIBreakpoints(); >+ if (breakpoints.length > 0) { >+ fUserBreakpoint = breakpoints[0]; >+ } >+ } >+ rm.done(); >+ } >+ }); >+ } else { >+ rm.done(); >+ } >+ } >+ >+ /* >+ * If reverse debugging, set a breakpoint on main to be able to enable reverse >+ * as early as possible. >+ * If the user has requested a stop at the same point, we could skip this breakpoint >+ * however, we have to first set it to find out! So, we just leave it. >+ */ >+ @Execute >+ public void stepSetBreakpointForReverse(final RequestMonitor rm) { >+ if (fReverseEnabled) { >+ fCommandControl.queueCommand( >+ fCommandFactory.createMIBreakInsert((IBreakpointsTargetDMContext)fCommandControl.getContext(), >+ true, false, null, 0, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT, 0), >+ new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), rm) { >+ @Override >+ public void handleSuccess() { >+ if (getData() != null) { >+ MIBreakpoint[] breakpoints = getData().getMIBreakpoints(); >+ if (breakpoints.length > 0 && fUserBreakpoint != null) { >+ fUserBreakpointIsOnMain = breakpoints[0].getAddress().equals(fUserBreakpoint.getAddress()); >+ } >+ } >+ rm.done(); >+ } >+ }); >+ } else { >+ rm.done(); >+ } >+ } >+ /* >+ * Now, run the program. Use either -exec-run or -exec-continue depending >+ * on whether we have remote session or not. >+ */ >+ @Execute >+ public void stepRunProgram(final RequestMonitor rm) { >+ ICommand<MIInfo> command; >+ if (useContinueCommand(fAttributes, fRestart)) { >+ command = fCommandFactory.createMIExecContinue(fContainerDmc); >+ } else { >+ command = fCommandFactory.createMIExecRun(fContainerDmc); >+ } >+ fCommandControl.queueCommand(command, new DataRequestMonitor<MIInfo>(ImmediateExecutor.getInstance(), rm) { >+ @Override >+ protected void handleSuccess() { >+ // Now that the process is started, the pid has been allocated >+ // so we need to fetch the proper container context >+ // We replace our current context which does not have the pid, with one that has the pid. >+ fContainerDmc = createContainerContextFromGroupId(fCommandControl.getContext(), fContainerDmc.getGroupId()); >+ fDataRequestMonitor.setData(fContainerDmc); >+ rm.done(); >+ } >+ }); >+ >+ } >+ /* >+ * In case of a restart, reverse debugging should be marked as off here because >+ * GDB will have turned it off. We may turn it back on after. >+ */ >+ @Execute >+ public void stepSetReverseOff(RequestMonitor rm) { >+ // Although it only makes sense for a restart, it doesn't hurt >+ // do to it all the time. >+ GDBRunControl_7_0 reverseService = getServicesTracker().getService(GDBRunControl_7_0.class); >+ if (reverseService != null) { >+ reverseService.setReverseModeEnabled(false); >+ } >+ rm.done(); >+ } >+ /* >+ * Since we have started the program, we can turn on reverse debugging if needed >+ */ >+ @Execute >+ public void stepEnableReverse(RequestMonitor rm) { >+ if (fReverseEnabled) { >+ IReverseRunControl reverseService = getServicesTracker().getService(IReverseRunControl.class); >+ if (reverseService != null) { >+ reverseService.enableReverseMode(fCommandControl.getContext(), true, rm); >+ return; >+ } >+ } >+ rm.done(); >+ } >+ /* >+ * Finally, if we are enabling reverse, and the userSymbolStop is not on main, >+ * we should do a continue because we are currently stopped on main but that >+ * is not what the user requested >+ */ >+ @Execute >+ public void stepContinue(RequestMonitor rm) { >+ if (fReverseEnabled && !fUserBreakpointIsOnMain) { >+ fCommandControl.queueCommand(fCommandFactory.createMIExecContinue(fContainerDmc), >+ new DataRequestMonitor<MIInfo>(getExecutor(), rm)); >+ } else { >+ rm.done(); >+ } >+ } >+ }; >+ >+ /** >+ * Insert breakpoint at entry if set, and start or restart the program. >+ * Note that restart does not apply to remote or attach sessions. >+ * >+ * If we want to enable Reverse debugging from the start of the program we do the following: >+ * attachSession => enable reverse >+ * else => set temp bp on main, run, enable reverse, continue if bp on main was not requested by user >+ */ >+ protected void startOrRestart(IMIContainerDMContext containerDmc, Map<String, Object> attributes, boolean restart, DataRequestMonitor<IMIContainerDMContext> rm) { >+ final boolean reverseEnabled = CDebugUtils.getAttribute(attributes, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE, >+ IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT); >+ >+ if (fBackend.getIsAttachSession()) { >+ // Restart does not apply to attach sessions. >+ // >+ // When attaching to a running process, we do not need to set a breakpoint or >+ // start the program; it is left up to the user. >+ // We only need to turn on Reverse Debugging if requested. >+ if (reverseEnabled) { >+ IReverseRunControl reverseService = getServicesTracker().getService(IReverseRunControl.class); >+ if (reverseService != null) { >+ reverseService.enableReverseMode(fCommandControl.getContext(), true, rm); >+ return; >+ } >+ } >+ //TODO khouzam must set rm.setdata() >+ rm.done(); >+ return; >+ } >+ >+ // When it is not an attach session, it gets a little more complicated >+ // so let's use a sequence. >+ ImmediateExecutor.getInstance().execute(new StartOrRestartProcessSequence(containerDmc, attributes, restart, rm)); >+ } >+ >+ /** >+ * This method indicates if we should use the -exec-continue method >+ * instead of the -exec-run method. >+ * This can be overridden to allow for customization. >+ */ >+ protected boolean useContinueCommand(Map<String, Object> attributes, boolean restart) { >+ // When doing remote debugging, we use -exec-continue instead of -exec-run >+ // Restart does not apply to remote sessions >+ return fBackend.getSessionType() == SessionType.REMOTE; >+ } > } > >#P org.eclipse.cdt.dsf.gdb.ui >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbAdapterFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbAdapterFactory.java,v >retrieving revision 1.18 >diff -u -r1.18 GdbAdapterFactory.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbAdapterFactory.java 18 Jan 2011 18:57:44 -0000 1.18 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbAdapterFactory.java 21 Jan 2011 20:42:57 -0000 >@@ -161,7 +161,7 @@ > fResumeWithoutSignalCommand = new GdbResumeWithoutSignalCommand(session); > fRestartCommand = new GdbRestartCommand(session, fLaunch); > fTerminateCommand = new DsfTerminateCommand(session); >- fConnectCommand = new GdbConnectCommand(session); >+ fConnectCommand = new GdbConnectCommand(session, fLaunch); > fDisconnectCommand = new GdbDisconnectCommand(session); > fSuspendTrigger = new GdbSuspendTrigger(session, fLaunch); > fModelSelectionPolicyFactory = new DefaultDsfModelSelectionPolicyFactory(); >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java,v >retrieving revision 1.4 >diff -u -r1.4 GdbConnectCommand.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java 30 Jul 2010 17:45:37 -0000 1.4 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java 21 Jan 2011 20:42:57 -0000 >@@ -11,7 +11,9 @@ > package org.eclipse.cdt.dsf.gdb.internal.ui.actions; > > import java.util.ArrayList; >+import java.util.HashMap; > import java.util.List; >+import java.util.Map; > import java.util.concurrent.ExecutionException; > import java.util.concurrent.RejectedExecutionException; > >@@ -42,15 +44,23 @@ > import org.eclipse.core.runtime.jobs.Job; > import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.debug.core.IStatusHandler; >+import org.eclipse.debug.core.Launch; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.FileDialog; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.ui.PlatformUI; > > public class GdbConnectCommand implements IConnect { > > private final DsfExecutor fExecutor; > private final DsfServicesTracker fTracker; >+ private final Launch fLaunch; > >- public GdbConnectCommand(DsfSession session) { >+ public GdbConnectCommand(DsfSession session, Launch launch) { > fExecutor = session.getExecutor(); > fTracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId()); >+ fLaunch = launch; > } > > public void dispose() { >@@ -115,6 +125,12 @@ > } > > try { >+ // Add an entry to create a new process >+ IProcessExtendedInfo[] newArray = new IProcessExtendedInfo[fProcessList.length + 1]; >+ System.arraycopy(fProcessList, 0, newArray, 1, fProcessList.length); >+ newArray[0] = new ProcessInfo(-1, "! <Create new process> !"); >+ fProcessList = newArray; >+ > Object result = prompter.handleStatus(processPromptStatus, fProcessList); > if (result instanceof Integer) { > fRequestMonitor.setData((Integer)result); >@@ -172,9 +188,38 @@ > // New cycle, look for service again > final IMIProcesses procService = fTracker.getService(IMIProcesses.class); > if (procService != null) { >+ if (getData() == -1) { >+ // We want to create a new process instead >+ Map<String, Object> attributes = new HashMap<String, Object>(); >+ try { >+ attributes = fLaunch.getLaunchConfiguration().getAttributes(); >+ } catch (CoreException e) { >+ } >+ final String[] binaryPath = new String[1]; >+ >+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { >+ public void run() { >+ Shell shell = Display.getDefault().getActiveShell(); >+ if (shell == null) { >+ return; >+ } >+ >+ FileDialog fd = new FileDialog(shell, SWT.SAVE); >+ binaryPath[0] = fd.open(); >+ } >+ }); >+ procService.debugNewProcess(controlCtx, >+ binaryPath[0], >+ attributes, >+ new DataRequestMonitor<IDMContext>(fExecutor, rm)); >+ return; >+ } >+ > IProcessDMContext procDmc = procService.createProcessContext(controlCtx, > Integer.toString(getData())); > procService.attachDebuggerToProcess(procDmc, new DataRequestMonitor<IDMContext>(fExecutor, rm)); >+ } else { >+ rm.done(); > } > } > }).schedule();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
marc.khouzam
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 237306
:
166478
|
167440
|
168092
|
168093
|
168510
|
176501
|
178929
|
179595
|
179596
|
179913
|
182593
|
184318
|
185285
|
185617
|
185691
|
186266
| 187326 |
187357
|
190931
|
190997