mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-17 22:15:23 +02:00
Bug 242114
Make the new MIProcessDMC, MIThreadDMC, MIExecutionDMCNS and IMIProcessDMContext private.
This commit is contained in:
parent
0db5876d62
commit
1c0440682f
3 changed files with 13 additions and 11 deletions
|
@ -29,6 +29,7 @@ import org.eclipse.dd.dsf.service.DsfSession;
|
||||||
import org.eclipse.dd.gdb.internal.GdbPlugin;
|
import org.eclipse.dd.gdb.internal.GdbPlugin;
|
||||||
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl;
|
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl;
|
||||||
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl.SessionType;
|
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl.SessionType;
|
||||||
|
import org.eclipse.dd.mi.service.IMIProcessDMContext;
|
||||||
import org.eclipse.dd.mi.service.MIProcesses;
|
import org.eclipse.dd.mi.service.MIProcesses;
|
||||||
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||||
import org.eclipse.dd.mi.service.command.MIInferiorProcess;
|
import org.eclipse.dd.mi.service.command.MIInferiorProcess;
|
||||||
|
@ -98,8 +99,8 @@ public class GDBProcesses extends MIProcesses {
|
||||||
@Override
|
@Override
|
||||||
public void getExecutionData(IThreadDMContext dmc, DataRequestMonitor<IThreadDMData> rm) {
|
public void getExecutionData(IThreadDMContext dmc, DataRequestMonitor<IThreadDMData> rm) {
|
||||||
// We must first check for GdbProcessDMC because it is also a GdbThreadDMC
|
// We must first check for GdbProcessDMC because it is also a GdbThreadDMC
|
||||||
if (dmc instanceof MIProcessDMC) {
|
if (dmc instanceof IMIProcessDMContext) {
|
||||||
String pidStr = ((MIProcessDMC)dmc).getProcId();
|
String pidStr = ((IMIProcessDMContext)dmc).getProcId();
|
||||||
int pid = -1;
|
int pid = -1;
|
||||||
try {
|
try {
|
||||||
pid = Integer.parseInt(pidStr);
|
pid = Integer.parseInt(pidStr);
|
||||||
|
@ -174,7 +175,7 @@ public class GDBProcesses extends MIProcesses {
|
||||||
}
|
}
|
||||||
|
|
||||||
private IProcessDMContext[] makeProcessDMCs(MIControlDMContext controlDmc, IProcessInfo[] processes) {
|
private IProcessDMContext[] makeProcessDMCs(MIControlDMContext controlDmc, IProcessInfo[] processes) {
|
||||||
IProcessDMContext[] procDmcs = new MIProcessDMC[processes.length];
|
IProcessDMContext[] procDmcs = new IMIProcessDMContext[processes.length];
|
||||||
for (int i=0; i<procDmcs.length; i++) {
|
for (int i=0; i<procDmcs.length; i++) {
|
||||||
procDmcs[i] = createProcessContext(controlDmc, Integer.toString(processes[i].getPid()));
|
procDmcs[i] = createProcessContext(controlDmc, Integer.toString(processes[i].getPid()));
|
||||||
}
|
}
|
||||||
|
@ -183,7 +184,7 @@ public class GDBProcesses extends MIProcesses {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void terminate(IThreadDMContext thread, RequestMonitor rm) {
|
public void terminate(IThreadDMContext thread, RequestMonitor rm) {
|
||||||
if (thread instanceof MIProcessDMC) {
|
if (thread instanceof IMIProcessDMContext) {
|
||||||
fGdb.terminate(rm);
|
fGdb.terminate(rm);
|
||||||
} else {
|
} else {
|
||||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid process context.", null)); //$NON-NLS-1$
|
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid process context.", null)); //$NON-NLS-1$
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class MIProcesses extends AbstractDsfService implements IProcesses {
|
||||||
* Context representing a thread group of GDB/MI.
|
* Context representing a thread group of GDB/MI.
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
protected class MIExecutionGroupDMC extends AbstractDMContext
|
private static class MIExecutionGroupDMC extends AbstractDMContext
|
||||||
implements IMIExecutionGroupDMContext
|
implements IMIExecutionGroupDMContext
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -74,7 +74,7 @@ public class MIProcesses extends AbstractDsfService implements IProcesses {
|
||||||
* @param processDmc The process context that is the parent of this context.
|
* @param processDmc The process context that is the parent of this context.
|
||||||
* @param groupId GDB/MI thread group identifier.
|
* @param groupId GDB/MI thread group identifier.
|
||||||
*/
|
*/
|
||||||
protected MIExecutionGroupDMC(String sessionId, IProcessDMContext processDmc, String groupId) {
|
public MIExecutionGroupDMC(String sessionId, IProcessDMContext processDmc, String groupId) {
|
||||||
super(sessionId, processDmc == null ? new IDMContext[0] : new IDMContext[] { processDmc });
|
super(sessionId, processDmc == null ? new IDMContext[0] : new IDMContext[] { processDmc });
|
||||||
fId = groupId;
|
fId = groupId;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ public class MIProcesses extends AbstractDsfService implements IProcesses {
|
||||||
* Context representing a thread.
|
* Context representing a thread.
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
protected class MIThreadDMC extends AbstractDMContext
|
private static class MIThreadDMC extends AbstractDMContext
|
||||||
implements IThreadDMContext
|
implements IThreadDMContext
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -119,7 +119,7 @@ public class MIProcesses extends AbstractDsfService implements IProcesses {
|
||||||
* @param processDmc The process that this thread belongs to.
|
* @param processDmc The process that this thread belongs to.
|
||||||
* @param id thread identifier.
|
* @param id thread identifier.
|
||||||
*/
|
*/
|
||||||
protected MIThreadDMC(String sessionId, IProcessDMContext processDmc, String id) {
|
public MIThreadDMC(String sessionId, IProcessDMContext processDmc, String id) {
|
||||||
super(sessionId, processDmc == null ? new IDMContext[0] : new IDMContext[] { processDmc });
|
super(sessionId, processDmc == null ? new IDMContext[0] : new IDMContext[] { processDmc });
|
||||||
fId = id;
|
fId = id;
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ public class MIProcesses extends AbstractDsfService implements IProcesses {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
protected class MIProcessDMC extends AbstractDMContext
|
private static class MIProcessDMC extends AbstractDMContext
|
||||||
implements IMIProcessDMContext
|
implements IMIProcessDMContext
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -162,7 +162,7 @@ public class MIProcesses extends AbstractDsfService implements IProcesses {
|
||||||
* @param controlDmc The control context parent of this process.
|
* @param controlDmc The control context parent of this process.
|
||||||
* @param id process identifier.
|
* @param id process identifier.
|
||||||
*/
|
*/
|
||||||
protected MIProcessDMC(String sessionId, MIControlDMContext controlDmc, String id) {
|
public MIProcessDMC(String sessionId, MIControlDMContext controlDmc, String id) {
|
||||||
super(sessionId, controlDmc == null ? new IDMContext[0] : new IDMContext[] { controlDmc });
|
super(sessionId, controlDmc == null ? new IDMContext[0] : new IDMContext[] { controlDmc });
|
||||||
fId = id;
|
fId = id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,8 @@ public class MIRunControlNS extends AbstractDsfService implements IMIRunControl
|
||||||
// it would be declared only once in IMIRunControl but this is real life and
|
// it would be declared only once in IMIRunControl but this is real life and
|
||||||
// it has to be duplicated for the sake of backward compatibility.
|
// it has to be duplicated for the sake of backward compatibility.
|
||||||
// It sucks and leads to bloated, error-prone code but that's the way it is.
|
// It sucks and leads to bloated, error-prone code but that's the way it is.
|
||||||
class MIExecutionDMCNS extends AbstractDMContext implements IMIExecutionDMContext
|
@Immutable
|
||||||
|
private static class MIExecutionDMCNS extends AbstractDMContext implements IMIExecutionDMContext
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Integer ID that is used to identify the thread in the GDB/MI protocol.
|
* Integer ID that is used to identify the thread in the GDB/MI protocol.
|
||||||
|
|
Loading…
Add table
Reference in a new issue