mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
[266599] For remote attach launches, we no longer force the user to attach right away.
This commit is contained in:
parent
29521b9edc
commit
6240b802f4
4 changed files with 33 additions and 7 deletions
|
@ -388,7 +388,16 @@ public class FinalLaunchSequence extends Sequence {
|
|||
new Step() {
|
||||
@Override
|
||||
public void execute(final RequestMonitor requestMonitor) {
|
||||
if (fAttach) {
|
||||
// A local attach can figure out the binary from the attach
|
||||
// command. This allows the user not to specify the binary
|
||||
// in the launch. But for breakpoints to work, we must do the
|
||||
// attach before we set the breakpoints, i.e., here.
|
||||
// On the other hand, for a remote attach, we need to specify
|
||||
// the binary anyway, or use the solib command. In both cases,
|
||||
// breakpoints can be set before we attach. Therefore, we don't
|
||||
// force an attach here, but wait for the user to decide to connect
|
||||
// using the connect action.
|
||||
if (fAttach && fSessionType != SessionType.REMOTE) {
|
||||
// If we are attaching, get the process id.
|
||||
int pid = -1;
|
||||
try {
|
||||
|
|
|
@ -543,6 +543,14 @@ public class GDBProcesses_7_0 extends AbstractDsfService
|
|||
}
|
||||
|
||||
public void isDebuggerAttachSupported(IDMContext dmc, DataRequestMonitor<Boolean> rm) {
|
||||
// Until bug 256798 is fixed, the service tracker could be null
|
||||
if (getServicesTracker() == null) {
|
||||
// service is shutdown
|
||||
rm.setData(false);
|
||||
rm.done();
|
||||
return;
|
||||
}
|
||||
|
||||
IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class);
|
||||
rm.setData(backend.getIsAttachSession());
|
||||
rm.done();
|
||||
|
@ -570,6 +578,14 @@ public class GDBProcesses_7_0 extends AbstractDsfService
|
|||
}
|
||||
|
||||
public void canDetachDebuggerFromProcess(IDMContext dmc, DataRequestMonitor<Boolean> rm) {
|
||||
// Until bug 256798 is fixed, the service tracker could be null
|
||||
if (getServicesTracker() == null) {
|
||||
// service is shutdown
|
||||
rm.setData(false);
|
||||
rm.done();
|
||||
return;
|
||||
}
|
||||
|
||||
IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class);
|
||||
rm.setData(backend.getIsAttachSession() && fCommandControl.isConnected());
|
||||
rm.done();
|
||||
|
|
|
@ -126,7 +126,7 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
|
|||
// Multi-process is not part of GDB HEAD yet,
|
||||
// but is part of this very specific build.
|
||||
// We'll need to change this when 7.0 is ready
|
||||
if (fVersion.startsWith("6.8.50.20081118")) { //$NON-NLS-1$
|
||||
if (fVersion.startsWith("6.8.50.20090218")) { //$NON-NLS-1$
|
||||
return new GDBProcesses_7_0(session);
|
||||
}
|
||||
return new GDBProcesses(session);
|
||||
|
|
|
@ -99,7 +99,7 @@ public class GDBControl extends AbstractMIControl implements IGDBControl {
|
|||
|
||||
private IGDBBackend fMIBackend;
|
||||
|
||||
private boolean fConnected = true;
|
||||
private boolean fConnected = false;
|
||||
|
||||
private MIRunControlEventProcessor fMIEventProcessor;
|
||||
private CLIEventProcessor fCLICommandProcessor;
|
||||
|
@ -354,11 +354,12 @@ public class GDBControl extends AbstractMIControl implements IGDBControl {
|
|||
fInferiorProcess = new GDBInferiorProcess(GDBControl.this, fMIBackend, fPty);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
return fInferiorProcess.getState() != MIInferiorProcess.State.TERMINATED && fConnected;
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
return fInferiorProcess.getState() != MIInferiorProcess.State.TERMINATED &&
|
||||
(!fMIBackend.getIsAttachSession() || fConnected);
|
||||
}
|
||||
|
||||
public void setConnected(boolean connected) {
|
||||
fConnected = connected;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue