mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 342351: Process consoles are not named properly for multi-process
This commit is contained in:
parent
b4c146eeed
commit
d825a579ce
2 changed files with 18 additions and 2 deletions
|
@ -14,6 +14,7 @@ import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.CDebugUtils;
|
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.DataRequestMonitor;
|
||||||
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
|
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
|
||||||
import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants;
|
import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants;
|
||||||
|
@ -268,6 +269,11 @@ public class DebugNewProcessSequence extends ReflectionSequence {
|
||||||
@Execute
|
@Execute
|
||||||
public void stepStartExecution(final RequestMonitor rm) {
|
public void stepStartExecution(final RequestMonitor rm) {
|
||||||
if (fBackend.getSessionType() != SessionType.CORE) {
|
if (fBackend.getSessionType() != SessionType.CORE) {
|
||||||
|
// Overwrite the program name to use the binary name that was specified.
|
||||||
|
// This is important for multi-process
|
||||||
|
// Bug 342351
|
||||||
|
fAttributes.put(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fBinaryName);
|
||||||
|
|
||||||
fProcService.start(getContainerContext(), fAttributes, new DataRequestMonitor<IContainerDMContext>(ImmediateExecutor.getInstance(), rm) {
|
fProcService.start(getContainerContext(), fAttributes, new DataRequestMonitor<IContainerDMContext>(ImmediateExecutor.getInstance(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
|
|
@ -41,6 +41,7 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||||
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
||||||
import org.eclipse.cdt.utils.pty.PTY;
|
import org.eclipse.cdt.utils.pty.PTY;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.debug.core.DebugPlugin;
|
import org.eclipse.debug.core.DebugPlugin;
|
||||||
import org.eclipse.debug.core.ILaunch;
|
import org.eclipse.debug.core.ILaunch;
|
||||||
|
@ -321,8 +322,17 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
||||||
final ILaunch launch = (ILaunch)getContainerContext().getAdapter(ILaunch.class);
|
final ILaunch launch = (ILaunch)getContainerContext().getAdapter(ILaunch.class);
|
||||||
final String groupId = ((IMIContainerDMContext)getContainerContext()).getGroupId();
|
final String groupId = ((IMIContainerDMContext)getContainerContext()).getGroupId();
|
||||||
|
|
||||||
|
// For multi-process, we cannot simply use the name given by the backend service
|
||||||
|
// because we may not be starting that process, but another one.
|
||||||
|
// Instead, we can look in the attributes for the binary name, which we stored
|
||||||
|
// there for this case, specifically.
|
||||||
|
// Bug 342351
|
||||||
IGDBBackend backend = fTracker.getService(IGDBBackend.class);
|
IGDBBackend backend = fTracker.getService(IGDBBackend.class);
|
||||||
final String pathLabel = backend.getProgramPath().lastSegment();
|
String progPathName =
|
||||||
|
CDebugUtils.getAttribute(fAttributes,
|
||||||
|
ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
|
||||||
|
backend.getProgramPath().lastSegment());
|
||||||
|
final String pathLabel = new Path(progPathName).lastSegment();
|
||||||
|
|
||||||
// Add the inferior to the launch.
|
// Add the inferior to the launch.
|
||||||
// This cannot be done on the executor or things deadlock.
|
// This cannot be done on the executor or things deadlock.
|
||||||
|
|
Loading…
Add table
Reference in a new issue