1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

Bug 489777 - [API] Replace thread id type from int to String

in preparation for the introduction of thread groups syntax in GDB,
thread id needs to be handled as a String.

Change-Id: I379a92de9755ba0532265519ee70d1e199de811b
This commit is contained in:
Alvaro Sanchez-Leon 2016-03-15 20:50:13 -04:00 committed by Marc Khouzam
parent a56abb4783
commit ba6eb9e0f0
29 changed files with 218 additions and 162 deletions

View file

@ -86,6 +86,8 @@ import org.eclipse.cdt.visualizer.ui.util.GUIUtils;
import org.eclipse.cdt.visualizer.ui.util.SelectionUtils;
import org.eclipse.cdt.visualizer.ui.util.Timer;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.internal.ui.commands.actions.DropToFrameCommandAction;
import org.eclipse.debug.internal.ui.commands.actions.ResumeCommandAction;
@ -120,7 +122,9 @@ import org.eclipse.swt.widgets.Composite;
public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPinnable {
// --- constants ---
/** Eclipse ID for this view */
private static final String THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER = "The thread id does not convert to an integer: "; //$NON-NLS-1$
/** Eclipse ID for this view */
public static final String ECLIPSE_ID = "org.eclipse.cdt.dsf.gdb.multicorevisualizer.visualizer"; //$NON-NLS-1$
// --- members ---
@ -999,7 +1003,16 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
IMIExecutionDMContext execContext =
DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
int tid = (execContext == null) ? 0 : execContext.getThreadId();
int tid = 0;
if (execContext != null) {
try {
tid = Integer.parseInt(execContext.getThreadId());
} catch (NumberFormatException e) {
// continue tid=0
assert false : THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER + execContext.getThreadId();
}
}
if (tid == 0) { // process
List<VisualizerThread> threads = model.getThreadsForProcess(pid);
@ -1406,7 +1419,17 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
IMIProcessDMContext processContext =
DMContexts.getAncestorOfType(execContext, IMIProcessDMContext.class);
int pid = Integer.parseInt(processContext.getProcId());
int tid = execContext.getThreadId();
int tid;
try {
tid = Integer.parseInt(execContext.getThreadId());
} catch (NumberFormatException e) {
rm.setStatus(new Status(IStatus.ERROR, MulticoreVisualizerUIPlugin.PLUGIN_ID, IStatus.ERROR,
"Unxepected thread id format:" + execContext.getThreadId(), e)); //$NON-NLS-1$
rm.done();
assert false : THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER + execContext.getThreadId();
return;
}
String osTIDValue = threadData.getId();
// If we can't get the real Linux OS tid, fallback to using the gdb thread id

View file

@ -61,7 +61,8 @@ import org.eclipse.cdt.dsf.service.DsfServicesTracker;
*/
public class MulticoreVisualizerEventListener {
// --- members ---
private static final String THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER = "The thread id does not convert to an integer: "; //$NON-NLS-1$
// --- members ---
/** Visualizer we're managing events for. */
protected MulticoreVisualizer fVisualizer;
@ -130,11 +131,19 @@ public class MulticoreVisualizerEventListener {
int coreId = Integer.parseInt(cores[0]);
final VisualizerCore vCore = model.getCore(coreId);
int tid = execDmc.getThreadId();
final VisualizerThread thread = model.getThread(tid);
int tid;
VisualizerThread threadTmp = null;
try {
tid = Integer.parseInt(execDmc.getThreadId());
threadTmp = model.getThread(tid);
} catch (NumberFormatException e) {
// unable to resolve thread
assert false : THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER + execDmc.getThreadId();
return;
}
if (thread != null) {
if (threadTmp != null) {
final VisualizerThread thread = threadTmp;
assert thread.getState() == VisualizerExecutionState.RUNNING;
VisualizerExecutionState _newState = VisualizerExecutionState.SUSPENDED;
@ -224,11 +233,19 @@ public class MulticoreVisualizerEventListener {
// We don't deal with processes
} else if (context instanceof IMIExecutionDMContext) {
// Thread resumed
int tid = ((IMIExecutionDMContext)context).getThreadId();
int tid;
VisualizerThread thread = null;
String strThreadId = ((IMIExecutionDMContext) context).getThreadId();
try {
tid = Integer.parseInt(strThreadId);
thread = model.getThread(tid);
} catch (NumberFormatException e) {
// unable to resolve thread
assert false : THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER + strThreadId;
return;
}
VisualizerThread thread = model.getThread(tid);
if (thread != null) {
if (thread != null) {
assert thread.getState() == VisualizerExecutionState.SUSPENDED ||
thread.getState() == VisualizerExecutionState.CRASHED;
@ -267,7 +284,15 @@ public class MulticoreVisualizerEventListener {
if (vCore == null) return;
int pid = Integer.parseInt(processContext.getProcId());
int tid = execDmc.getThreadId();
int tid;
try {
tid = Integer.parseInt(execDmc.getThreadId());
} catch (NumberFormatException e) {
// unable to resolve thread
assert false : THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER + execDmc.getThreadId();
return;
}
int osTid = 0;
@ -321,7 +346,14 @@ public class MulticoreVisualizerEventListener {
return;
int pid = Integer.parseInt(processContext.getProcId());
int tid = execDmc.getThreadId();
int tid;
try {
tid = Integer.parseInt(execDmc.getThreadId());
} catch (NumberFormatException e) {
// Unable to resolve thread information
assert false : THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER + execDmc.getThreadId();
return;
}
int osTid = 0;
try {
@ -382,7 +414,16 @@ public class MulticoreVisualizerEventListener {
IDMContext[] contexts = getData();
for (IDMContext c : contexts) {
if (c instanceof IMIExecutionDMContext) {
int tid = ((IMIExecutionDMContext)c).getThreadId();
int tid;
String strThreadId = ((IMIExecutionDMContext) c).getThreadId();
try {
tid = Integer.parseInt(strThreadId);
} catch (NumberFormatException e) {
// unable to resolve the thread id
assert false : THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER + strThreadId;
continue;
}
model.markThreadExited(tid);
}
}
@ -401,10 +442,15 @@ public class MulticoreVisualizerEventListener {
} else if (context instanceof IMIExecutionDMContext) {
// Thread exited
int tid = ((IMIExecutionDMContext)context).getThreadId();
int tid;
String strThreadId = ((IMIExecutionDMContext) context).getThreadId();
try {
tid = Integer.parseInt(strThreadId);
model.markThreadExited(tid);
} catch (NumberFormatException e) {
assert false : THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER + strThreadId;
}
model.markThreadExited(tid);
if (canvas != null) {
canvas.requestUpdate();
}

View file

@ -140,8 +140,16 @@ public class MulticoreVisualizerSelectionFinder
{
IMIExecutionDMContext execContext =
DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
int tid = (execContext == null) ? 0 :
execContext.getThreadId();
int tid = 0;
if (execContext != null) {
try {
tid = Integer.parseInt(execContext.getThreadId());
} catch (NumberFormatException e) {
// Unable to resolve thread id
assert false : "The thread id does not convert to an integer: " + execContext.getThreadId(); //$NON-NLS-1$
}
}
return tid;
}

View file

@ -33,7 +33,7 @@ public class TestMIBreakInsertCommand {
@Test
public void pathWithSlashesShouldNotBeSubstituted() {
MIBreakInsert target = new MIBreakInsert(new TestContext(), false,
false, null, 1, "/test/this/path:14", 4, false);
false, null, 1, "/test/this/path:14", "4", false);
assertEquals("Wrong syntax for command",
"-break-insert -i 1 -p 4 /test/this/path:14\n", target

View file

@ -183,9 +183,9 @@ public class GdbPinProvider implements IPinProvider {
// get the execution (thread) context label
if (execDmc != null) {
int threadId = execDmc.getThreadId();
String threadId = execDmc.getThreadId();
label += !label.isEmpty() ? ": " : ""; //$NON-NLS-1$//$NON-NLS-2$
label += "Thread [" + Integer.toString(threadId) + "]"; //$NON-NLS-1$//$NON-NLS-2$
label += "Thread [" + threadId + "]"; //$NON-NLS-1$//$NON-NLS-2$
}
return label;
}

View file

@ -359,27 +359,17 @@ public class GdbBreakpointVMProvider extends BreakpointVMProvider {
IMIExecutionDMContext threadContext = DMContexts.getAncestorOfType( execContext, IMIExecutionDMContext.class );
if ( threadContext != null ) {
// A thread is selected. Now make sure this breakpoint is assigned to this thread.
if ( data.getThreadId() != null && data.getThreadId().length() > 0 ) {
try {
int bpThreadId = Integer.parseInt( data.getThreadId() );
// A threadId of 0 means all threads of this process. We therefore will have to check
// if this breakpoint applies to the process that is selected. But if the threadId is not 0
// we simply make sure we have the right thread selected.
if ( bpThreadId != 0 ) {
rm.done( threadContext.getThreadId() == bpThreadId );
return;
}
}
catch( NumberFormatException e ) {
assert false;
GdbUIPlugin.getDefault().getLog().log( new Status(
IStatus.ERROR,
GdbUIPlugin.getUniqueIdentifier(),
"Invalid breakpoint thread id" ) ); //$NON-NLS-1$
rm.done( true );
return;
}
}
if (data.getThreadId() != null && data.getThreadId().length() > 0) {
String bpThreadId = data.getThreadId().trim();
// A threadId of 0 means all threads of this process. We therefore will have to check
// if this breakpoint applies to the process that is selected. But if the threadId is not 0
// we simply make sure we have the right thread selected.
if (!bpThreadId.equals("0")) { //$NON-NLS-1$
String ctxThreadId = threadContext.getThreadId();
rm.done(ctxThreadId.equals(bpThreadId));
return;
}
}
}
// If we get here it is that the breakpoint is not assigned to a single thread.

View file

@ -297,7 +297,7 @@ public class ThreadVMNode extends AbstractThreadVMNode
IMIExecutionDMContext execDmc = findDmcInPath(
update.getViewerInput(), update.getElementPath(), IMIExecutionDMContext.class);
if (execDmc != null) {
update.setProperty(ILaunchVMConstants.PROP_ID, Integer.toString(execDmc.getThreadId()));
update.setProperty(ILaunchVMConstants.PROP_ID, execDmc.getThreadId());
// set pin properties
IPinElementColorDescriptor colorDesc = PinCloneUtils.getPinElementColorDescriptor(GdbPinProvider.getPinnedHandles(), execDmc);

View file

@ -128,15 +128,14 @@ public class GDBBreakpoints_7_0 extends MIBreakpoints
final Boolean isHardware = (Boolean) getProperty(attributes, MIBreakpointDMData.IS_HARDWARE, false);
final String condition = (String) getProperty(attributes, MIBreakpoints.CONDITION, NULL_STRING);
final Integer ignoreCount = (Integer) getProperty(attributes, MIBreakpoints.IGNORE_COUNT, 0);
String threadId = (String) getProperty(attributes, MIBreakpointDMData.THREAD_ID, "0"); //$NON-NLS-1$
final int tid = Integer.parseInt(threadId);
String threadId = (String) getProperty(attributes, MIBreakpointDMData.THREAD_ID, "0"); //$NON-NLS-1$
final Step insertBreakpointStep = new Step() {
@Override
public void execute(final RequestMonitor rm) {
// Execute the command
fConnection.queueCommand(
fCommandFactory.createMIBreakInsert(context, isTemporary, isHardware, condition, ignoreCount, location, tid, !enabled, false),
fCommandFactory.createMIBreakInsert(context, isTemporary, isHardware, condition, ignoreCount, location, threadId, !enabled, false),
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), rm) {
@Override
protected void handleSuccess() {

View file

@ -210,7 +210,7 @@ public class GDBBreakpoints_7_2 extends GDBBreakpoints_7_0
final String condition = (String) getProperty(attributes, MIBreakpoints.CONDITION, NULL_STRING);
fConnection.queueCommand(
fConnection.getCommandFactory().createMIBreakInsert(context, false, isFastTracepoint, condition, 0, location, 0, !enabled, true),
fConnection.getCommandFactory().createMIBreakInsert(context, false, isFastTracepoint, condition, 0, location, "0", !enabled, true), //$NON-NLS-1$
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), drm) {
@Override
protected void handleSuccess() {

View file

@ -643,7 +643,7 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
// Insert a breakpoint at the requested stop symbol.
IBreakpointsTargetDMContext bpTarget = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class);
fGdb.queueCommand(
fCommandFactory.createMIBreakInsert(bpTarget, true, false, null, 0, stopSymbol, 0),
fCommandFactory.createMIBreakInsert(bpTarget, true, false, null, 0, stopSymbol, "0"), //$NON-NLS-1$
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), requestMonitor) {
@Override
protected void handleSuccess() {

View file

@ -169,14 +169,9 @@ public class GDBProcesses_7_0 extends AbstractDsfService
* @return
*/
@Override
public int getThreadId(){
try {
return Integer.parseInt(fThreadId);
} catch (NumberFormatException e) {
}
return 0;
}
public String getThreadId() {
return fThreadId;
}
/* Unused; reintroduce if needed
public String getId(){

View file

@ -147,16 +147,16 @@ public class GDBRunControl extends MIRunControl {
}
@Override
public IMIExecutionDMContext createMIExecutionContext(IContainerDMContext container, int threadId) {
public IMIExecutionDMContext createMIExecutionContext(IContainerDMContext container, String threadId) {
IProcessDMContext procDmc = DMContexts.getAncestorOfType(container, IProcessDMContext.class);
IThreadDMContext threadDmc = null;
if (procDmc != null) {
// For now, reuse the threadId as the OSThreadId
threadDmc = fProcService.createThreadContext(procDmc, Integer.toString(threadId));
threadDmc = fProcService.createThreadContext(procDmc, threadId);
}
return fProcService.createExecutionContext(container, threadDmc, Integer.toString(threadId));
return fProcService.createExecutionContext(container, threadDmc, threadId);
}
@Override
@ -236,7 +236,7 @@ public class GDBRunControl extends MIRunControl {
IExecutionDMContext ctxt = iterator.next();
if(! list.contains(ctxt)){
IContainerDMContext containerDmc = DMContexts.getAncestorOfType(ctxt, IContainerDMContext.class);
MIEvent<?> e = new MIThreadExitEvent(containerDmc, Integer.toString(((IMIExecutionDMContext)ctxt).getThreadId()));
MIEvent<?> e = new MIThreadExitEvent(containerDmc, ((IMIExecutionDMContext)ctxt).getThreadId());
// Dispatch DsfMIThreadExitEvent
getSession().dispatchEvent(e, getProperties());
}

View file

@ -2189,7 +2189,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo
attr.put(MIBreakpoints.FILE_NAME, debuggerPath);
attr.put(MIBreakpoints.LINE_NUMBER, lineNumber);
attr.put(MIBreakpointDMData.IS_TEMPORARY, true);
attr.put(MIBreakpointDMData.THREAD_ID, Integer.toString(threadExecDmc.getThreadId()));
attr.put(MIBreakpointDMData.THREAD_ID, threadExecDmc.getThreadId());
// Now do the operation
moveToLocation(context, location, attr, rm);
@ -2235,7 +2235,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo
attr.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT);
attr.put(MIBreakpoints.ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$
attr.put(MIBreakpointDMData.IS_TEMPORARY, true);
attr.put(MIBreakpointDMData.THREAD_ID, Integer.toString(threadExecDmc.getThreadId()));
attr.put(MIBreakpointDMData.THREAD_ID, threadExecDmc.getThreadId());
// Now do the operation
moveToLocation(context, location, attr, rm);

View file

@ -210,7 +210,7 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
IBreakpointsTargetDMContext.class);
fCommandControl.queueCommand(
fCommandFactory.createMIBreakInsert(bpTargetDmc, true, false, null, 0, userStopSymbol, 0),
fCommandFactory.createMIBreakInsert(bpTargetDmc, true, false, null, 0, userStopSymbol, "0"), //$NON-NLS-1$
new ImmediateDataRequestMonitor<MIBreakInsertInfo>(rm) {
@Override
public void handleSuccess() {
@ -241,7 +241,7 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
fCommandControl.queueCommand(
fCommandFactory.createMIBreakInsert(bpTargetDmc, true, false, null, 0,
ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT, 0),
ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT, "0"), //$NON-NLS-1$
new ImmediateDataRequestMonitor<MIBreakInsertInfo>(rm) {
@Override
public void handleSuccess() {

View file

@ -28,13 +28,13 @@ public class CommandFactory_6_8 extends CommandFactory {
@Override
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
boolean isHardware, String condition, int ignoreCount, String line, int tid) {
boolean isHardware, String condition, int ignoreCount, String line, String tid) {
return new MIBreakInsert(ctx, isTemporary, isHardware, condition, ignoreCount, line, tid, true);
}
@Override
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
boolean isHardware, String condition, int ignoreCount, String location, int tid, boolean disabled, boolean isTracepoint) {
boolean isHardware, String condition, int ignoreCount, String location, String tid, boolean disabled, boolean isTracepoint) {
return new MIBreakInsert(ctx, isTemporary, isHardware, condition, ignoreCount, location, tid, disabled, isTracepoint, true);
}
}

View file

@ -22,6 +22,7 @@ public interface IMIExecutionDMContext extends IExecutionDMContext
/**
* Returns the GDB/MI thread identifier of this context.
* @return
* @since 5.0
*/
public int getThreadId();
public String getThreadId();
}

View file

@ -661,13 +661,12 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints, I
final String condition = (String) getProperty(attributes, CONDITION, NULL_STRING);
final Integer ignoreCount = (Integer) getProperty(attributes, IGNORE_COUNT, 0 );
final String threadId = (String) getProperty(attributes, MIBreakpointDMData.THREAD_ID, "0"); //$NON-NLS-1$
final int tid = Integer.parseInt(threadId);
final Step insertBreakpointStep = new Step() {
@Override
public void execute(final RequestMonitor rm) {
fConnection.queueCommand(
fCommandFactory.createMIBreakInsert(context, isTemporary, isHardware, condition, ignoreCount, location, tid),
fCommandFactory.createMIBreakInsert(context, isTemporary, isHardware, condition, ignoreCount, location, threadId),
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), rm) {
@Override
protected void handleSuccess() {

View file

@ -1971,7 +1971,7 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
if (targetThreads != null) {
for (IExecutionDMContext thread : targetThreads) {
if (thread instanceof IMIExecutionDMContext) {
results.add(Integer.toString(((IMIExecutionDMContext)thread).getThreadId()));
results.add(((IMIExecutionDMContext)thread).getThreadId());
} else {
// If any of the threads is not an IMIExecutionDMContext,
// we don't support thread filters at all.

View file

@ -333,8 +333,8 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI
set.add(id);
try {
int threadId = Integer.parseInt(data.getThreadId());
if (threadId > 0) {
String threadId = data.getThreadId();
if (!threadId.equals("0")) { //$NON-NLS-1$
IDsfBreakpointExtension bpExtension =
(IDsfBreakpointExtension)((ICBreakpoint)plBpt).getExtension(
MIBreakpointsManager.GDB_DEBUG_MODEL_ID, ICBreakpointExtension.class);
@ -353,7 +353,7 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI
List<IExecutionDMContext> list = new ArrayList<IExecutionDMContext>(execDMCs.length);
for (IExecutionDMContext c : execDMCs) {
if (c instanceof IMIExecutionDMContext
&& ((IMIExecutionDMContext)c).getThreadId() != threadId) {
&& !((IMIExecutionDMContext)c).getThreadId().equals(threadId)) {
list.add(c);
}
}
@ -371,9 +371,6 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI
catch(CoreException e) {
GdbPlugin.log(e.getStatus());
}
catch(NumberFormatException e) {
GdbPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Invalid thread id")); //$NON-NLS-1$
}
}
}
});
@ -515,13 +512,12 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI
if (execDMCs == null) {
execDMCs = new IExecutionDMContext[0];
}
int threadNum = Integer.parseInt(threadId);
for (IExecutionDMContext execDMC : execDMCs) {
if (execDMC instanceof IMIExecutionDMContext
&& ((IMIExecutionDMContext)execDMC).getThreadId() == threadNum) {
// The platform breakpoint is already restricted to the given thread.
return;
}
String ctxThreadId = ((IMIExecutionDMContext)execDMC).getThreadId();
if (execDMC instanceof IMIExecutionDMContext && ctxThreadId.equals(threadId)) {
// The platform breakpoint is already restricted to the given thread.
return;
}
}
IExecutionDMContext[] newExecDMCs = new IExecutionDMContext[execDMCs.length + 1];
System.arraycopy(execDMCs, 0, newExecDMCs, 0, execDMCs.length);
@ -531,9 +527,6 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI
threadId);
bpExtension.setThreadFilters(newExecDMCs);
}
catch(NumberFormatException e) {
GdbPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Invalid thread id")); //$NON-NLS-1$
}
catch(CoreException e) {
GdbPlugin.log(e);
}

View file

@ -109,20 +109,10 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICa
* @return
*/
@Override
public int getThreadId(){
try {
return Integer.parseInt(fThreadId);
} catch (NumberFormatException e) {
}
return 0;
public String getThreadId(){
return fThreadId;
}
// Enable if need arises
// public String getId(){
// return fThreadId;
// }
@Override
public String toString() { return baseToString() + ".thread[" + fThreadId + "]"; } //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -108,7 +108,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
/**
* Integer ID that is used to identify the thread in the GDB/MI protocol.
*/
private final int fThreadId;
private final String fThreadId;
/**
* Constructor for the context. It should not be called directly by clients.
@ -122,7 +122,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
* @param containerDmc The container that this context belongs to.
* @param threadId GDB/MI thread identifier.
*/
protected MIExecutionDMC(String sessionId, IContainerDMContext containerDmc, int threadId) {
protected MIExecutionDMC(String sessionId, IContainerDMContext containerDmc, String threadId) {
super(sessionId, containerDmc != null ? new IDMContext[] { containerDmc } : new IDMContext[0]);
fThreadId = threadId;
}
@ -132,7 +132,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
* @return
*/
@Override
public int getThreadId(){
public String getThreadId(){
return fThreadId;
}
@ -141,11 +141,11 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
@Override
public boolean equals(Object obj) {
return super.baseEquals(obj) && ((MIExecutionDMC)obj).fThreadId == fThreadId;
return super.baseEquals(obj) && ((MIExecutionDMC)obj).fThreadId.equals(fThreadId);
}
@Override
public int hashCode() { return super.baseHashCode() ^ fThreadId; }
public int hashCode() { return super.baseHashCode() + fThreadId.hashCode(); }
}
@Immutable
@ -417,7 +417,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
*/
protected MIStoppedEvent fSilencedSignalEvent;
private static final int FAKE_THREAD_ID = 0;
private static final String FAKE_THREAD_ID = "0"; //$NON-NLS-1$
public MIRunControl(DsfSession session) {
super(session);
@ -474,7 +474,10 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
/** @since 2.0 */
protected ICommandControlService getConnection() { return fConnection; }
public IMIExecutionDMContext createMIExecutionContext(IContainerDMContext container, int threadId) {
/**
* @since 5.0
*/
public IMIExecutionDMContext createMIExecutionContext(IContainerDMContext container, String threadId) {
return new MIExecutionDMC(getSession().getId(), container, threadId);
}
@ -583,7 +586,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
@DsfServiceEventHandler
public void eventDispatched(final MIThreadCreatedEvent e) {
IContainerDMContext containerDmc = e.getDMContext();
IMIExecutionDMContext executionCtx = e.getStrId() != null ? createMIExecutionContext(containerDmc, e.getId()) : null;
IMIExecutionDMContext executionCtx = e.getStrId() != null ? createMIExecutionContext(containerDmc, e.getStrId()) : null;
getSession().dispatchEvent(new StartedDMEvent(executionCtx, e), getProperties());
}
@ -596,7 +599,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
@DsfServiceEventHandler
public void eventDispatched(final MIThreadExitEvent e) {
IContainerDMContext containerDmc = e.getDMContext();
IMIExecutionDMContext executionCtx = e.getStrId() != null ? createMIExecutionContext(containerDmc, e.getId()) : null;
IMIExecutionDMContext executionCtx = e.getStrId() != null ? createMIExecutionContext(containerDmc, e.getStrId()) : null;
getSession().dispatchEvent(new ExitedDMEvent(executionCtx, e), getProperties());
}
@ -903,7 +906,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
} else {
IExecutionDMContext[] executionDmcs = new IMIExecutionDMContext[info.getThreadIds().length];
for (int i = 0; i < info.getThreadIds().length; i++) {
executionDmcs[i] = createMIExecutionContext(containerCtx, info.getThreadIds()[i]);
executionDmcs[i] = createMIExecutionContext(containerCtx, info.getStrThreadIds()[i]);
}
return executionDmcs;
}
@ -1562,7 +1565,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
attr.put(MIBreakpoints.FILE_NAME, debuggerPath);
attr.put(MIBreakpoints.LINE_NUMBER, lineNumber);
attr.put(MIBreakpointDMData.IS_TEMPORARY, true);
attr.put(MIBreakpointDMData.THREAD_ID, Integer.toString(threadExecDmc.getThreadId()));
attr.put(MIBreakpointDMData.THREAD_ID, threadExecDmc.getThreadId());
// Now do the operation
moveToLocation(context, location, attr, rm);
@ -1609,7 +1612,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
attr.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT);
attr.put(MIBreakpoints.ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$
attr.put(MIBreakpointDMData.IS_TEMPORARY, true);
attr.put(MIBreakpointDMData.THREAD_ID, Integer.toString(threadExecDmc.getThreadId()));
attr.put(MIBreakpointDMData.THREAD_ID, threadExecDmc.getThreadId());
// Now do the operation
moveToLocation(context, location, attr, rm);

View file

@ -285,7 +285,7 @@ implements IStack, ICachingService {
it will eliminate the issue with invalid data on subsequent invocations. We don't cache errors.
*/
@SuppressWarnings("serial")
private class FramesCache extends HashMap<Integer, FramesCacheInfo> {
private class FramesCache extends HashMap<String, FramesCacheInfo> {
public void clear(IDMContext context) {
final IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
if (execDmc != null) {
@ -295,7 +295,7 @@ implements IStack, ICachingService {
};
}
public FramesCacheInfo getThreadFramesCache(int threadId) {
public FramesCacheInfo getThreadFramesCache(String threadId) {
FramesCacheInfo info = get(threadId);
if (info == null) {
put(threadId, info = new FramesCacheInfo());
@ -303,13 +303,13 @@ implements IStack, ICachingService {
return info;
}
public FramesCacheInfo update(int threadId, int stackDepth, int maxRequestedStackDepth) {
public FramesCacheInfo update(String threadId, int stackDepth, int maxRequestedStackDepth) {
FramesCacheInfo info = getThreadFramesCache(threadId);
info.setStackDepth(stackDepth, maxRequestedStackDepth);
return info;
}
public FramesCacheInfo update(int threadId, MIStackListFramesInfo framesInfo) {
public FramesCacheInfo update(String threadId, MIStackListFramesInfo framesInfo) {
FramesCacheInfo info = getThreadFramesCache(threadId);
if (framesInfo != null) {
int len = framesInfo.getMIFrames().length;
@ -507,9 +507,10 @@ implements IStack, ICachingService {
}
}
String threadId = execDmc.getThreadId();
// if requested stack limit is bigger then currently cached this call will return -1
final int maxDepth = endIndex > 0 ? endIndex + 1 : -1;
int depth = fFramesCache.getThreadFramesCache(execDmc.getThreadId()).getStackDepth(
int depth = fFramesCache.getThreadFramesCache(threadId).getStackDepth(
maxDepth);
if (depth > 0) { // our stack depth cache is good so we can use it to fill levels array
rm.setData(getDMFrames(execDmc, startIndex, endIndex, depth));
@ -524,7 +525,7 @@ implements IStack, ICachingService {
// getStackDepth call would have updated cache for us.
// We use same handler on success or error, since gdb is unreliable when comes to frame retrieval
// we will return frames array even if we get error when attempting to get stack depth.
int stackDepth = fFramesCache.getThreadFramesCache(execDmc.getThreadId()).getValidStackDepth();
int stackDepth = fFramesCache.getThreadFramesCache(threadId).getValidStackDepth();
rm.done(getDMFrames(execDmc, startIndex, endIndex, stackDepth));
}
});
@ -612,7 +613,7 @@ implements IStack, ICachingService {
return;
}
final int threadId = execDmc.getThreadId();
String threadId = execDmc.getThreadId();
final int frameLevel = miFrameDmc.fLevel;
FrameData fd = fFramesCache.getThreadFramesCache(threadId).getFrameData(frameLevel);
if (fd != null) {
@ -1026,8 +1027,7 @@ implements IStack, ICachingService {
return;
}
final int threadId = execDmc.getThreadId();
String threadId = execDmc.getThreadId();
// Check our internal cache first because different commands can
// still be re-used.
int depth = fFramesCache.getThreadFramesCache(threadId).getStackDepth(maxDepth);

View file

@ -582,7 +582,7 @@ public abstract class AbstractMIControl extends AbstractDsfService
public String getThreadId() {
IMIExecutionDMContext execCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IMIExecutionDMContext.class);
if(execCtx != null)
return Integer.toString(execCtx.getThreadId());
return execCtx.getThreadId();
return null;
}

View file

@ -428,15 +428,21 @@ public class CommandFactory {
return new MIBreakInsert(ctx, func, false);
}
/**
* @since 5.0
*/
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
boolean isHardware, String condition, int ignoreCount,
String line, int tid) {
String line, String tid) {
return new MIBreakInsert(ctx, isTemporary, isHardware, condition, ignoreCount, line, tid, false);
}
/**
* @since 5.0
*/
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
boolean isHardware, String condition, int ignoreCount,
String location, int tid, boolean disabled, boolean isTracepoint) {
String location, String tid, boolean disabled, boolean isTracepoint) {
return new MIBreakInsert(ctx, isTemporary, isHardware, condition, ignoreCount, location, tid, disabled, isTracepoint, false);
}

View file

@ -66,12 +66,12 @@ public class MIBreakInsert extends MICommand<MIBreakInsertInfo>
{
/** @since 4.0 */
public MIBreakInsert(IBreakpointsTargetDMContext ctx, String func, boolean allowPending) {
this(ctx, false, false, null, 0, func, 0, allowPending);
this(ctx, false, false, null, 0, func, "0", allowPending); //$NON-NLS-1$
}
/** @since 4.0 */
/** @since 5.0*/
public MIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary, boolean isHardware,
String condition, int ignoreCount, String line, int tid, boolean allowPending) {
String condition, int ignoreCount, String line, String tid, boolean allowPending) {
this(ctx, isTemporary, isHardware, condition, ignoreCount, line, tid, false, false, allowPending);
}
@ -79,10 +79,10 @@ public class MIBreakInsert extends MICommand<MIBreakInsertInfo>
* This constructor allows to specify if the breakpoint should actually be
* a tracepoint (this will only work starting with GDB 7.1)
* It also includes if a breakpoint should be created disabled (starting GDB 7.0)
* @since 4.0
* @since 5.0
*/
public MIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary, boolean isHardware,
String condition, int ignoreCount, String location, int tid, boolean disabled, boolean isTracepoint,
String condition, int ignoreCount, String location, String tid, boolean disabled, boolean isTracepoint,
boolean allowPending) {
super(ctx, "-break-insert"); //$NON-NLS-1$
@ -94,7 +94,7 @@ public class MIBreakInsert extends MICommand<MIBreakInsertInfo>
// and passcounts cannot be set by a -break-insert
ignoreCount = 0;
// GDB 7.1 only supports tracepoints that apply to all threads
tid = 0;
tid = "0"; //$NON-NLS-1$
}
// Determine the number of optional parameters that are present
@ -112,7 +112,7 @@ public class MIBreakInsert extends MICommand<MIBreakInsertInfo>
if (ignoreCount > 0) {
i += 2;
}
if (tid > 0) {
if (!tid.equals("0")) { //$NON-NLS-1$
i += 2;
}
if (disabled) {
@ -150,10 +150,10 @@ public class MIBreakInsert extends MICommand<MIBreakInsertInfo>
opts[i] = Integer.toString(ignoreCount);
i++;
}
if (tid > 0) {
if (!tid.equals("0")) { //$NON-NLS-1$
opts[i] = "-p"; //$NON-NLS-1$
i++;
opts[i] = Integer.toString(tid);
opts[i] = tid;
i++;
}
if (disabled) {

View file

@ -23,14 +23,17 @@ import java.util.regex.Pattern;
*/
public class CLIThreadInfo extends MIInfo {
private Integer fCurrentThread;
private String fCurrentThread;
public CLIThreadInfo(MIOutput out) {
super(out);
parse();
}
public Integer getCurrentThread(){
/**
* @since 5.0
*/
public String getCurrentThread(){
return fCurrentThread;
}
@ -56,7 +59,7 @@ public class CLIThreadInfo extends MIInfo {
Matcher matcher = pattern.matcher(str);
if (matcher.find()) {
String id = matcher.group(1).trim();
fCurrentThread = Integer.parseInt(id);
fCurrentThread = id;
}
}
}

View file

@ -209,7 +209,7 @@ public class SyncUtil {
@Override
protected void execute(DataRequestMonitor<MIBreakInsertInfo> rm) {
fGdbControl.queueCommand(
fCommandFactory.createMIBreakInsert(bpTargetDmc, temporary, false, null, 0, location, 0),
fCommandFactory.createMIBreakInsert(bpTargetDmc, temporary, false, null, 0, location, "0"),
rm);
}
};

View file

@ -116,7 +116,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}}
};
@ -164,7 +164,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}}
};
@ -215,7 +215,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}},
new Step() {
@ -224,7 +224,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHi", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHi", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}},
new Step() {
@ -233,7 +233,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}}
};
@ -286,7 +286,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}},
new Step() {
@ -295,7 +295,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, "invalid condition", 0, "PrintHi", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, "invalid condition", 0, "PrintHi", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}},
new Step() {
@ -304,7 +304,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}}
};
@ -345,7 +345,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}},
new Step() {
@ -354,7 +354,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHi", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHi", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}},
new Step() {
@ -363,7 +363,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}}
};
@ -422,7 +422,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}},
new Step() {
@ -431,7 +431,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, "invalid condition", 0, "PrintHi", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, "invalid condition", 0, "PrintHi", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}},
new Step() {
@ -440,7 +440,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}}
};
@ -499,7 +499,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}}
};
@ -567,7 +567,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
}}
};
@ -642,7 +642,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm) {
@Override
protected void handleSuccess() {
@ -652,7 +652,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
@Override
public void execute(final RequestMonitor rm) {
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), null));
}}}, new RequestMonitor(fGDBCtrl.getExecutor(), null));
@ -709,7 +709,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm) {
@Override
protected void handleSuccess() {
@ -719,7 +719,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
@Override
public void execute(final RequestMonitor otherRm) {
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), otherRm));
}}}, new RequestMonitor(fGDBCtrl.getExecutor(), null));
@ -786,7 +786,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm) {
@Override
protected void handleSuccess() {
@ -796,7 +796,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
@Override
public void execute(final RequestMonitor otherRm) {
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), otherRm));
}}}, rm);
}});
@ -851,7 +851,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm) {
@Override
protected void handleSuccess() {
@ -861,7 +861,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
@Override
public void execute(final RequestMonitor otherRm) {
fGDBCtrl.queueCommand(
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, 0),
fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, "0"),
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), otherRm));
}}}, rm);
}});

View file

@ -296,7 +296,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase {
// We check this _after_ we ask for the execution contexts because when running remote (i.e., with gdbserver),
// thread events are not sent by gdb until a request for a thread list is given (Bug 455992)
IStartedDMEvent startedEvent = startedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(1000));
Assert.assertEquals("Thread created event is for wrong thread id", sProgramIsCygwin ? 3 : 2, ((IMIExecutionDMContext)startedEvent.getDMContext()).getThreadId());
Assert.assertEquals("Thread created event is for wrong thread id", sProgramIsCygwin ? "3" : "2", ((IMIExecutionDMContext)startedEvent.getDMContext()).getThreadId());
/*
* Get data
@ -350,7 +350,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase {
fRunCtrl.getExecutor().submit(new Runnable() {
@Override
public void run() {
fRunCtrl.getExecutionData(((MIRunControl)fRunCtrl).createMIExecutionContext(containerDmc, 1), rm);
fRunCtrl.getExecutionData(((MIRunControl)fRunCtrl).createMIExecutionContext(containerDmc, "1"), rm);
}
});
wait.waitUntilDone(TestsPlugin.massageTimeout(5000));