mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 239050
Use the generic IDMContext instead of IContainerDMContext because some debuggers may not have a run control service Replace IThreadDMData.getDebuggingContext() with method getDebuggingContext()
This commit is contained in:
parent
169508e98e
commit
9af6a7b237
3 changed files with 36 additions and 29 deletions
|
@ -17,7 +17,6 @@ import org.eclipse.dd.dsf.datamodel.IDMContext;
|
|||
import org.eclipse.dd.dsf.datamodel.IDMData;
|
||||
import org.eclipse.dd.dsf.datamodel.IDMEvent;
|
||||
import org.eclipse.dd.dsf.datamodel.IDMService;
|
||||
import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||
|
||||
/**
|
||||
* This interface provides access to the OS's process
|
||||
|
@ -52,7 +51,6 @@ public interface IProcesses extends IDMService {
|
|||
String getName();
|
||||
String getId();
|
||||
boolean isDebuggerAttached();
|
||||
IDMContext getDebuggingContext();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,22 +65,31 @@ public interface IProcesses extends IDMService {
|
|||
*/
|
||||
public void getExecutionData(IThreadDMContext dmc, DataRequestMonitor<IThreadDMData> rm);
|
||||
|
||||
/**
|
||||
* Retrieves the debugging context that characterizes the specified thread
|
||||
* or process context.
|
||||
*
|
||||
* @param dmc The thread or process dmc for which we want the debugging context
|
||||
* @param rm The request monitor that will contain the debugging context.
|
||||
* null if no such context exists
|
||||
*/
|
||||
public void getDebuggingContext(IThreadDMContext dmc, DataRequestMonitor<IDMContext> rm);
|
||||
|
||||
/**
|
||||
* Retrieves the current list of processes running on target.
|
||||
* @param containerDmc The processor or core for which to list all processes
|
||||
* @param dmc The processor or core for which to list all processes
|
||||
* @param rm Request completion monitor, to be filled in with array of process contexts.
|
||||
*/
|
||||
void getRunningProcesses(IContainerDMContext containerDmc, DataRequestMonitor<IProcessDMContext[]> rm);
|
||||
void getRunningProcesses(IDMContext dmc, DataRequestMonitor<IProcessDMContext[]> rm);
|
||||
|
||||
/**
|
||||
* Attaches debugger to the given process.
|
||||
* When attaching to a process, a container context can now be used to characterize the process.
|
||||
* IContainerDMContext has IProcessDMContext as a parent. This method can optionally choose
|
||||
* to return the IContainerDMContext inside the DataRequestMonitor. This can be useful for
|
||||
* backends that do not have the ability to obtain the different IContainerDMContexts through
|
||||
* {@link getProcessesBeingDebugged}
|
||||
* When attaching to a process, a debugging context can now be used to characterize the process.
|
||||
* This method can optionally choose to return this IDMContext inside the DataRequestMonitor.
|
||||
* This can be useful for backends that do not have the ability to obtain the different
|
||||
* debugging IDMContexts through {@link #getProcessesBeingDebugged(IDMContext, DataRequestMonitor)
|
||||
*/
|
||||
void attachDebuggerToProcess(IProcessDMContext procCtx, DataRequestMonitor<IContainerDMContext> rm);
|
||||
void attachDebuggerToProcess(IProcessDMContext procCtx, DataRequestMonitor<IDMContext> rm);
|
||||
|
||||
/**
|
||||
* Detaches debugger from the given process.
|
||||
|
@ -106,12 +113,12 @@ public interface IProcesses extends IDMService {
|
|||
/**
|
||||
* Retrieves the list of processes which are currently under
|
||||
* debugger control.
|
||||
* @param containerDmc The processor or core for which to list processes being debugged
|
||||
* @param rm Request completion monitor which contains all container contexts representing
|
||||
* the processes being debugged. Note that each of these containers also has
|
||||
* @param dmc The processor or core for which to list processes being debugged
|
||||
* @param rm Request completion monitor which contains all debugging contexts representing
|
||||
* the processes being debugged. Note that each of these contexts should also have
|
||||
* IProcessDMContext as a parent.
|
||||
*/
|
||||
void getProcessesBeingDebugged(IContainerDMContext containerDmc, DataRequestMonitor<IContainerDMContext[]> rm);
|
||||
void getProcessesBeingDebugged(IDMContext dmc, DataRequestMonitor<IDMContext[]> rm);
|
||||
|
||||
/**
|
||||
* Checks whether the given process or thread can be terminated.
|
||||
|
|
|
@ -37,8 +37,8 @@ import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
|||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.Sequence;
|
||||
import org.eclipse.dd.dsf.datamodel.IDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.IProcesses.IProcessDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||
import org.eclipse.dd.dsf.service.DsfServicesTracker;
|
||||
import org.eclipse.dd.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.dd.gdb.internal.provisional.IGDBLaunchConfigurationConstants;
|
||||
|
@ -445,7 +445,7 @@ public class FinalLaunchSequence extends Sequence {
|
|||
|
||||
fProcService.attachDebuggerToProcess(
|
||||
procDmc,
|
||||
new DataRequestMonitor<IContainerDMContext>(getExecutor(), requestMonitor));
|
||||
new DataRequestMonitor<IDMContext>(getExecutor(), requestMonitor));
|
||||
} else {
|
||||
promptForProcessID(fLaunch.getLaunchConfiguration(),
|
||||
new DataRequestMonitor<Integer>(getExecutor(), requestMonitor) {
|
||||
|
@ -456,7 +456,7 @@ public class FinalLaunchSequence extends Sequence {
|
|||
|
||||
fProcService.attachDebuggerToProcess(
|
||||
procDmc,
|
||||
new DataRequestMonitor<IContainerDMContext>(getExecutor(), requestMonitor));
|
||||
new DataRequestMonitor<IDMContext>(getExecutor(), requestMonitor));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
|||
import org.eclipse.dd.dsf.datamodel.AbstractDMContext;
|
||||
import org.eclipse.dd.dsf.datamodel.IDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.IProcesses;
|
||||
import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||
import org.eclipse.dd.dsf.service.AbstractDsfService;
|
||||
import org.eclipse.dd.dsf.service.DsfSession;
|
||||
import org.eclipse.dd.gdb.internal.GdbPlugin;
|
||||
|
@ -118,10 +117,7 @@ public class GDBProcesses extends AbstractDsfService implements IProcesses {
|
|||
fName = name;
|
||||
fId = id;
|
||||
}
|
||||
|
||||
public IDMContext getDebuggingContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getId() { return fId; }
|
||||
public String getName() { return fName; }
|
||||
public boolean isDebuggerAttached() {
|
||||
|
@ -247,7 +243,13 @@ public class GDBProcesses extends AbstractDsfService implements IProcesses {
|
|||
}
|
||||
}
|
||||
|
||||
public void attachDebuggerToProcess(IProcessDMContext procCtx, final DataRequestMonitor<IContainerDMContext> rm) {
|
||||
public void getDebuggingContext(IThreadDMContext dmc, DataRequestMonitor<IDMContext> rm) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
|
||||
NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$
|
||||
rm.done();
|
||||
}
|
||||
|
||||
public void attachDebuggerToProcess(IProcessDMContext procCtx, final DataRequestMonitor<IDMContext> rm) {
|
||||
if (procCtx instanceof GdbProcessDMC) {
|
||||
int pid;
|
||||
try {
|
||||
|
@ -263,7 +265,7 @@ public class GDBProcesses extends AbstractDsfService implements IProcesses {
|
|||
new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
rm.setData(null);
|
||||
rm.setData(fCommandControl.getGDBDMContext());
|
||||
rm.done();
|
||||
}
|
||||
});
|
||||
|
@ -308,19 +310,17 @@ public class GDBProcesses extends AbstractDsfService implements IProcesses {
|
|||
rm.done();
|
||||
}
|
||||
|
||||
public void getProcessesBeingDebugged(IContainerDMContext containerDmc, DataRequestMonitor<IContainerDMContext[]> rm) {
|
||||
public void getProcessesBeingDebugged(IDMContext dmc, DataRequestMonitor<IDMContext[]> rm) {
|
||||
// use -list-thread-groups
|
||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
|
||||
NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$
|
||||
rm.done();
|
||||
}
|
||||
|
||||
public void getRunningProcesses(IContainerDMContext containerDmc, DataRequestMonitor<IProcessDMContext[]> rm) {
|
||||
// use -list-thread-groups for local session
|
||||
|
||||
public void getRunningProcesses(IDMContext dmc, DataRequestMonitor<IProcessDMContext[]> rm) {
|
||||
// monitor list processes is only for remote session
|
||||
fCommandControl.queueCommand(
|
||||
new CLIMonitorListProcesses(containerDmc),
|
||||
new CLIMonitorListProcesses(dmc),
|
||||
new DataRequestMonitor<CLIMonitorListProcessesInfo>(getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
|
|
Loading…
Add table
Reference in a new issue