mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-22 00:15:25 +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:
parent
a56abb4783
commit
ba6eb9e0f0
29 changed files with 218 additions and 162 deletions
|
@ -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.SelectionUtils;
|
||||||
import org.eclipse.cdt.visualizer.ui.util.Timer;
|
import org.eclipse.cdt.visualizer.ui.util.Timer;
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
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.core.ILaunch;
|
||||||
import org.eclipse.debug.internal.ui.commands.actions.DropToFrameCommandAction;
|
import org.eclipse.debug.internal.ui.commands.actions.DropToFrameCommandAction;
|
||||||
import org.eclipse.debug.internal.ui.commands.actions.ResumeCommandAction;
|
import org.eclipse.debug.internal.ui.commands.actions.ResumeCommandAction;
|
||||||
|
@ -120,6 +122,8 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPinnable {
|
public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPinnable {
|
||||||
// --- constants ---
|
// --- constants ---
|
||||||
|
|
||||||
|
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 */
|
/** Eclipse ID for this view */
|
||||||
public static final String ECLIPSE_ID = "org.eclipse.cdt.dsf.gdb.multicorevisualizer.visualizer"; //$NON-NLS-1$
|
public static final String ECLIPSE_ID = "org.eclipse.cdt.dsf.gdb.multicorevisualizer.visualizer"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -999,7 +1003,16 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
|
||||||
|
|
||||||
IMIExecutionDMContext execContext =
|
IMIExecutionDMContext execContext =
|
||||||
DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
|
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
|
if (tid == 0) { // process
|
||||||
List<VisualizerThread> threads = model.getThreadsForProcess(pid);
|
List<VisualizerThread> threads = model.getThreadsForProcess(pid);
|
||||||
|
@ -1406,7 +1419,17 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
|
||||||
IMIProcessDMContext processContext =
|
IMIProcessDMContext processContext =
|
||||||
DMContexts.getAncestorOfType(execContext, IMIProcessDMContext.class);
|
DMContexts.getAncestorOfType(execContext, IMIProcessDMContext.class);
|
||||||
int pid = Integer.parseInt(processContext.getProcId());
|
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();
|
String osTIDValue = threadData.getId();
|
||||||
|
|
||||||
// If we can't get the real Linux OS tid, fallback to using the gdb thread id
|
// If we can't get the real Linux OS tid, fallback to using the gdb thread id
|
||||||
|
|
|
@ -61,6 +61,7 @@ import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
||||||
*/
|
*/
|
||||||
public class MulticoreVisualizerEventListener {
|
public class MulticoreVisualizerEventListener {
|
||||||
|
|
||||||
|
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 ---
|
// --- members ---
|
||||||
|
|
||||||
/** Visualizer we're managing events for. */
|
/** Visualizer we're managing events for. */
|
||||||
|
@ -130,11 +131,19 @@ public class MulticoreVisualizerEventListener {
|
||||||
int coreId = Integer.parseInt(cores[0]);
|
int coreId = Integer.parseInt(cores[0]);
|
||||||
final VisualizerCore vCore = model.getCore(coreId);
|
final VisualizerCore vCore = model.getCore(coreId);
|
||||||
|
|
||||||
int tid = execDmc.getThreadId();
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
final VisualizerThread thread = model.getThread(tid);
|
if (threadTmp != null) {
|
||||||
|
final VisualizerThread thread = threadTmp;
|
||||||
if (thread != null) {
|
|
||||||
assert thread.getState() == VisualizerExecutionState.RUNNING;
|
assert thread.getState() == VisualizerExecutionState.RUNNING;
|
||||||
|
|
||||||
VisualizerExecutionState _newState = VisualizerExecutionState.SUSPENDED;
|
VisualizerExecutionState _newState = VisualizerExecutionState.SUSPENDED;
|
||||||
|
@ -224,9 +233,17 @@ public class MulticoreVisualizerEventListener {
|
||||||
// We don't deal with processes
|
// We don't deal with processes
|
||||||
} else if (context instanceof IMIExecutionDMContext) {
|
} else if (context instanceof IMIExecutionDMContext) {
|
||||||
// Thread resumed
|
// Thread resumed
|
||||||
int tid = ((IMIExecutionDMContext)context).getThreadId();
|
int tid;
|
||||||
|
VisualizerThread thread = null;
|
||||||
VisualizerThread thread = model.getThread(tid);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
if (thread != null) {
|
if (thread != null) {
|
||||||
assert thread.getState() == VisualizerExecutionState.SUSPENDED ||
|
assert thread.getState() == VisualizerExecutionState.SUSPENDED ||
|
||||||
|
@ -267,7 +284,15 @@ public class MulticoreVisualizerEventListener {
|
||||||
if (vCore == null) return;
|
if (vCore == null) return;
|
||||||
|
|
||||||
int pid = Integer.parseInt(processContext.getProcId());
|
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;
|
int osTid = 0;
|
||||||
|
|
||||||
|
@ -321,7 +346,14 @@ public class MulticoreVisualizerEventListener {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int pid = Integer.parseInt(processContext.getProcId());
|
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;
|
int osTid = 0;
|
||||||
try {
|
try {
|
||||||
|
@ -382,7 +414,16 @@ public class MulticoreVisualizerEventListener {
|
||||||
IDMContext[] contexts = getData();
|
IDMContext[] contexts = getData();
|
||||||
for (IDMContext c : contexts) {
|
for (IDMContext c : contexts) {
|
||||||
if (c instanceof IMIExecutionDMContext) {
|
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);
|
model.markThreadExited(tid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,9 +442,14 @@ public class MulticoreVisualizerEventListener {
|
||||||
|
|
||||||
} else if (context instanceof IMIExecutionDMContext) {
|
} else if (context instanceof IMIExecutionDMContext) {
|
||||||
// Thread exited
|
// Thread exited
|
||||||
int tid = ((IMIExecutionDMContext)context).getThreadId();
|
int tid;
|
||||||
|
String strThreadId = ((IMIExecutionDMContext) context).getThreadId();
|
||||||
|
try {
|
||||||
|
tid = Integer.parseInt(strThreadId);
|
||||||
model.markThreadExited(tid);
|
model.markThreadExited(tid);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
assert false : THE_THREAD_ID_DOES_NOT_CONVERT_TO_AN_INTEGER + strThreadId;
|
||||||
|
}
|
||||||
|
|
||||||
if (canvas != null) {
|
if (canvas != null) {
|
||||||
canvas.requestUpdate();
|
canvas.requestUpdate();
|
||||||
|
|
|
@ -140,8 +140,16 @@ public class MulticoreVisualizerSelectionFinder
|
||||||
{
|
{
|
||||||
IMIExecutionDMContext execContext =
|
IMIExecutionDMContext execContext =
|
||||||
DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
|
DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
|
||||||
int tid = (execContext == null) ? 0 :
|
int tid = 0;
|
||||||
execContext.getThreadId();
|
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;
|
return tid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class TestMIBreakInsertCommand {
|
||||||
@Test
|
@Test
|
||||||
public void pathWithSlashesShouldNotBeSubstituted() {
|
public void pathWithSlashesShouldNotBeSubstituted() {
|
||||||
MIBreakInsert target = new MIBreakInsert(new TestContext(), false,
|
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",
|
assertEquals("Wrong syntax for command",
|
||||||
"-break-insert -i 1 -p 4 /test/this/path:14\n", target
|
"-break-insert -i 1 -p 4 /test/this/path:14\n", target
|
||||||
|
|
|
@ -183,9 +183,9 @@ public class GdbPinProvider implements IPinProvider {
|
||||||
|
|
||||||
// get the execution (thread) context label
|
// get the execution (thread) context label
|
||||||
if (execDmc != null) {
|
if (execDmc != null) {
|
||||||
int threadId = execDmc.getThreadId();
|
String threadId = execDmc.getThreadId();
|
||||||
label += !label.isEmpty() ? ": " : ""; //$NON-NLS-1$//$NON-NLS-2$
|
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;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
|
@ -360,23 +360,13 @@ public class GdbBreakpointVMProvider extends BreakpointVMProvider {
|
||||||
if ( threadContext != null ) {
|
if ( threadContext != null ) {
|
||||||
// A thread is selected. Now make sure this breakpoint is assigned to this thread.
|
// A thread is selected. Now make sure this breakpoint is assigned to this thread.
|
||||||
if (data.getThreadId() != null && data.getThreadId().length() > 0) {
|
if (data.getThreadId() != null && data.getThreadId().length() > 0) {
|
||||||
try {
|
String bpThreadId = data.getThreadId().trim();
|
||||||
int bpThreadId = Integer.parseInt( data.getThreadId() );
|
|
||||||
// A threadId of 0 means all threads of this process. We therefore will have to check
|
// 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
|
// 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.
|
// we simply make sure we have the right thread selected.
|
||||||
if ( bpThreadId != 0 ) {
|
if (!bpThreadId.equals("0")) { //$NON-NLS-1$
|
||||||
rm.done( threadContext.getThreadId() == bpThreadId );
|
String ctxThreadId = threadContext.getThreadId();
|
||||||
return;
|
rm.done(ctxThreadId.equals(bpThreadId));
|
||||||
}
|
|
||||||
}
|
|
||||||
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,7 +297,7 @@ public class ThreadVMNode extends AbstractThreadVMNode
|
||||||
IMIExecutionDMContext execDmc = findDmcInPath(
|
IMIExecutionDMContext execDmc = findDmcInPath(
|
||||||
update.getViewerInput(), update.getElementPath(), IMIExecutionDMContext.class);
|
update.getViewerInput(), update.getElementPath(), IMIExecutionDMContext.class);
|
||||||
if (execDmc != null) {
|
if (execDmc != null) {
|
||||||
update.setProperty(ILaunchVMConstants.PROP_ID, Integer.toString(execDmc.getThreadId()));
|
update.setProperty(ILaunchVMConstants.PROP_ID, execDmc.getThreadId());
|
||||||
|
|
||||||
// set pin properties
|
// set pin properties
|
||||||
IPinElementColorDescriptor colorDesc = PinCloneUtils.getPinElementColorDescriptor(GdbPinProvider.getPinnedHandles(), execDmc);
|
IPinElementColorDescriptor colorDesc = PinCloneUtils.getPinElementColorDescriptor(GdbPinProvider.getPinnedHandles(), execDmc);
|
||||||
|
|
|
@ -129,14 +129,13 @@ public class GDBBreakpoints_7_0 extends MIBreakpoints
|
||||||
final String condition = (String) getProperty(attributes, MIBreakpoints.CONDITION, NULL_STRING);
|
final String condition = (String) getProperty(attributes, MIBreakpoints.CONDITION, NULL_STRING);
|
||||||
final Integer ignoreCount = (Integer) getProperty(attributes, MIBreakpoints.IGNORE_COUNT, 0);
|
final Integer ignoreCount = (Integer) getProperty(attributes, MIBreakpoints.IGNORE_COUNT, 0);
|
||||||
String threadId = (String) getProperty(attributes, MIBreakpointDMData.THREAD_ID, "0"); //$NON-NLS-1$
|
String threadId = (String) getProperty(attributes, MIBreakpointDMData.THREAD_ID, "0"); //$NON-NLS-1$
|
||||||
final int tid = Integer.parseInt(threadId);
|
|
||||||
|
|
||||||
final Step insertBreakpointStep = new Step() {
|
final Step insertBreakpointStep = new Step() {
|
||||||
@Override
|
@Override
|
||||||
public void execute(final RequestMonitor rm) {
|
public void execute(final RequestMonitor rm) {
|
||||||
// Execute the command
|
// Execute the command
|
||||||
fConnection.queueCommand(
|
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) {
|
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
|
|
@ -210,7 +210,7 @@ public class GDBBreakpoints_7_2 extends GDBBreakpoints_7_0
|
||||||
final String condition = (String) getProperty(attributes, MIBreakpoints.CONDITION, NULL_STRING);
|
final String condition = (String) getProperty(attributes, MIBreakpoints.CONDITION, NULL_STRING);
|
||||||
|
|
||||||
fConnection.queueCommand(
|
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) {
|
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), drm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
|
|
@ -643,7 +643,7 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
|
||||||
// Insert a breakpoint at the requested stop symbol.
|
// Insert a breakpoint at the requested stop symbol.
|
||||||
IBreakpointsTargetDMContext bpTarget = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTarget = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class);
|
||||||
fGdb.queueCommand(
|
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) {
|
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), requestMonitor) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
|
|
@ -169,13 +169,8 @@ public class GDBProcesses_7_0 extends AbstractDsfService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getThreadId(){
|
public String getThreadId() {
|
||||||
try {
|
return fThreadId;
|
||||||
return Integer.parseInt(fThreadId);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unused; reintroduce if needed
|
/* Unused; reintroduce if needed
|
||||||
|
|
|
@ -147,16 +147,16 @@ public class GDBRunControl extends MIRunControl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IMIExecutionDMContext createMIExecutionContext(IContainerDMContext container, int threadId) {
|
public IMIExecutionDMContext createMIExecutionContext(IContainerDMContext container, String threadId) {
|
||||||
IProcessDMContext procDmc = DMContexts.getAncestorOfType(container, IProcessDMContext.class);
|
IProcessDMContext procDmc = DMContexts.getAncestorOfType(container, IProcessDMContext.class);
|
||||||
|
|
||||||
IThreadDMContext threadDmc = null;
|
IThreadDMContext threadDmc = null;
|
||||||
if (procDmc != null) {
|
if (procDmc != null) {
|
||||||
// For now, reuse the threadId as the OSThreadId
|
// 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
|
@Override
|
||||||
|
@ -236,7 +236,7 @@ public class GDBRunControl extends MIRunControl {
|
||||||
IExecutionDMContext ctxt = iterator.next();
|
IExecutionDMContext ctxt = iterator.next();
|
||||||
if(! list.contains(ctxt)){
|
if(! list.contains(ctxt)){
|
||||||
IContainerDMContext containerDmc = DMContexts.getAncestorOfType(ctxt, IContainerDMContext.class);
|
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
|
// Dispatch DsfMIThreadExitEvent
|
||||||
getSession().dispatchEvent(e, getProperties());
|
getSession().dispatchEvent(e, getProperties());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2189,7 +2189,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo
|
||||||
attr.put(MIBreakpoints.FILE_NAME, debuggerPath);
|
attr.put(MIBreakpoints.FILE_NAME, debuggerPath);
|
||||||
attr.put(MIBreakpoints.LINE_NUMBER, lineNumber);
|
attr.put(MIBreakpoints.LINE_NUMBER, lineNumber);
|
||||||
attr.put(MIBreakpointDMData.IS_TEMPORARY, true);
|
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
|
// Now do the operation
|
||||||
moveToLocation(context, location, attr, rm);
|
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.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT);
|
||||||
attr.put(MIBreakpoints.ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$
|
attr.put(MIBreakpoints.ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$
|
||||||
attr.put(MIBreakpointDMData.IS_TEMPORARY, true);
|
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
|
// Now do the operation
|
||||||
moveToLocation(context, location, attr, rm);
|
moveToLocation(context, location, attr, rm);
|
||||||
|
|
|
@ -210,7 +210,7 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
||||||
IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fCommandControl.queueCommand(
|
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) {
|
new ImmediateDataRequestMonitor<MIBreakInsertInfo>(rm) {
|
||||||
@Override
|
@Override
|
||||||
public void handleSuccess() {
|
public void handleSuccess() {
|
||||||
|
@ -241,7 +241,7 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
||||||
|
|
||||||
fCommandControl.queueCommand(
|
fCommandControl.queueCommand(
|
||||||
fCommandFactory.createMIBreakInsert(bpTargetDmc, true, false, null, 0,
|
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) {
|
new ImmediateDataRequestMonitor<MIBreakInsertInfo>(rm) {
|
||||||
@Override
|
@Override
|
||||||
public void handleSuccess() {
|
public void handleSuccess() {
|
||||||
|
|
|
@ -28,13 +28,13 @@ public class CommandFactory_6_8 extends CommandFactory {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
|
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);
|
return new MIBreakInsert(ctx, isTemporary, isHardware, condition, ignoreCount, line, tid, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
|
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);
|
return new MIBreakInsert(ctx, isTemporary, isHardware, condition, ignoreCount, location, tid, disabled, isTracepoint, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ public interface IMIExecutionDMContext extends IExecutionDMContext
|
||||||
/**
|
/**
|
||||||
* Returns the GDB/MI thread identifier of this context.
|
* Returns the GDB/MI thread identifier of this context.
|
||||||
* @return
|
* @return
|
||||||
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public int getThreadId();
|
public String getThreadId();
|
||||||
}
|
}
|
|
@ -661,13 +661,12 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints, I
|
||||||
final String condition = (String) getProperty(attributes, CONDITION, NULL_STRING);
|
final String condition = (String) getProperty(attributes, CONDITION, NULL_STRING);
|
||||||
final Integer ignoreCount = (Integer) getProperty(attributes, IGNORE_COUNT, 0 );
|
final Integer ignoreCount = (Integer) getProperty(attributes, IGNORE_COUNT, 0 );
|
||||||
final String threadId = (String) getProperty(attributes, MIBreakpointDMData.THREAD_ID, "0"); //$NON-NLS-1$
|
final String threadId = (String) getProperty(attributes, MIBreakpointDMData.THREAD_ID, "0"); //$NON-NLS-1$
|
||||||
final int tid = Integer.parseInt(threadId);
|
|
||||||
|
|
||||||
final Step insertBreakpointStep = new Step() {
|
final Step insertBreakpointStep = new Step() {
|
||||||
@Override
|
@Override
|
||||||
public void execute(final RequestMonitor rm) {
|
public void execute(final RequestMonitor rm) {
|
||||||
fConnection.queueCommand(
|
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) {
|
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
|
|
@ -1971,7 +1971,7 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
||||||
if (targetThreads != null) {
|
if (targetThreads != null) {
|
||||||
for (IExecutionDMContext thread : targetThreads) {
|
for (IExecutionDMContext thread : targetThreads) {
|
||||||
if (thread instanceof IMIExecutionDMContext) {
|
if (thread instanceof IMIExecutionDMContext) {
|
||||||
results.add(Integer.toString(((IMIExecutionDMContext)thread).getThreadId()));
|
results.add(((IMIExecutionDMContext)thread).getThreadId());
|
||||||
} else {
|
} else {
|
||||||
// If any of the threads is not an IMIExecutionDMContext,
|
// If any of the threads is not an IMIExecutionDMContext,
|
||||||
// we don't support thread filters at all.
|
// we don't support thread filters at all.
|
||||||
|
|
|
@ -333,8 +333,8 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI
|
||||||
set.add(id);
|
set.add(id);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int threadId = Integer.parseInt(data.getThreadId());
|
String threadId = data.getThreadId();
|
||||||
if (threadId > 0) {
|
if (!threadId.equals("0")) { //$NON-NLS-1$
|
||||||
IDsfBreakpointExtension bpExtension =
|
IDsfBreakpointExtension bpExtension =
|
||||||
(IDsfBreakpointExtension)((ICBreakpoint)plBpt).getExtension(
|
(IDsfBreakpointExtension)((ICBreakpoint)plBpt).getExtension(
|
||||||
MIBreakpointsManager.GDB_DEBUG_MODEL_ID, ICBreakpointExtension.class);
|
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);
|
List<IExecutionDMContext> list = new ArrayList<IExecutionDMContext>(execDMCs.length);
|
||||||
for (IExecutionDMContext c : execDMCs) {
|
for (IExecutionDMContext c : execDMCs) {
|
||||||
if (c instanceof IMIExecutionDMContext
|
if (c instanceof IMIExecutionDMContext
|
||||||
&& ((IMIExecutionDMContext)c).getThreadId() != threadId) {
|
&& !((IMIExecutionDMContext)c).getThreadId().equals(threadId)) {
|
||||||
list.add(c);
|
list.add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -371,9 +371,6 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI
|
||||||
catch(CoreException e) {
|
catch(CoreException e) {
|
||||||
GdbPlugin.log(e.getStatus());
|
GdbPlugin.log(e.getStatus());
|
||||||
}
|
}
|
||||||
catch(NumberFormatException e) {
|
|
||||||
GdbPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Invalid thread id")); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -515,10 +512,9 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI
|
||||||
if (execDMCs == null) {
|
if (execDMCs == null) {
|
||||||
execDMCs = new IExecutionDMContext[0];
|
execDMCs = new IExecutionDMContext[0];
|
||||||
}
|
}
|
||||||
int threadNum = Integer.parseInt(threadId);
|
|
||||||
for (IExecutionDMContext execDMC : execDMCs) {
|
for (IExecutionDMContext execDMC : execDMCs) {
|
||||||
if (execDMC instanceof IMIExecutionDMContext
|
String ctxThreadId = ((IMIExecutionDMContext)execDMC).getThreadId();
|
||||||
&& ((IMIExecutionDMContext)execDMC).getThreadId() == threadNum) {
|
if (execDMC instanceof IMIExecutionDMContext && ctxThreadId.equals(threadId)) {
|
||||||
// The platform breakpoint is already restricted to the given thread.
|
// The platform breakpoint is already restricted to the given thread.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -531,9 +527,6 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI
|
||||||
threadId);
|
threadId);
|
||||||
bpExtension.setThreadFilters(newExecDMCs);
|
bpExtension.setThreadFilters(newExecDMCs);
|
||||||
}
|
}
|
||||||
catch(NumberFormatException e) {
|
|
||||||
GdbPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Invalid thread id")); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
catch(CoreException e) {
|
catch(CoreException e) {
|
||||||
GdbPlugin.log(e);
|
GdbPlugin.log(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,20 +109,10 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICa
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getThreadId(){
|
public String getThreadId(){
|
||||||
try {
|
return fThreadId;
|
||||||
return Integer.parseInt(fThreadId);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enable if need arises
|
|
||||||
// public String getId(){
|
|
||||||
// return fThreadId;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() { return baseToString() + ".thread[" + fThreadId + "]"; } //$NON-NLS-1$ //$NON-NLS-2$
|
public String toString() { return baseToString() + ".thread[" + fThreadId + "]"; } //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
|
|
|
@ -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.
|
* 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.
|
* 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 containerDmc The container that this context belongs to.
|
||||||
* @param threadId GDB/MI thread identifier.
|
* @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]);
|
super(sessionId, containerDmc != null ? new IDMContext[] { containerDmc } : new IDMContext[0]);
|
||||||
fThreadId = threadId;
|
fThreadId = threadId;
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getThreadId(){
|
public String getThreadId(){
|
||||||
return fThreadId;
|
return fThreadId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,11 +141,11 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
return super.baseEquals(obj) && ((MIExecutionDMC)obj).fThreadId == fThreadId;
|
return super.baseEquals(obj) && ((MIExecutionDMC)obj).fThreadId.equals(fThreadId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() { return super.baseHashCode() ^ fThreadId; }
|
public int hashCode() { return super.baseHashCode() + fThreadId.hashCode(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
|
@ -417,7 +417,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
||||||
*/
|
*/
|
||||||
protected MIStoppedEvent fSilencedSignalEvent;
|
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) {
|
public MIRunControl(DsfSession session) {
|
||||||
super(session);
|
super(session);
|
||||||
|
@ -474,7 +474,10 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
||||||
/** @since 2.0 */
|
/** @since 2.0 */
|
||||||
protected ICommandControlService getConnection() { return fConnection; }
|
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);
|
return new MIExecutionDMC(getSession().getId(), container, threadId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,7 +586,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(final MIThreadCreatedEvent e) {
|
public void eventDispatched(final MIThreadCreatedEvent e) {
|
||||||
IContainerDMContext containerDmc = e.getDMContext();
|
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());
|
getSession().dispatchEvent(new StartedDMEvent(executionCtx, e), getProperties());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -596,7 +599,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(final MIThreadExitEvent e) {
|
public void eventDispatched(final MIThreadExitEvent e) {
|
||||||
IContainerDMContext containerDmc = e.getDMContext();
|
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());
|
getSession().dispatchEvent(new ExitedDMEvent(executionCtx, e), getProperties());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -903,7 +906,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
||||||
} else {
|
} else {
|
||||||
IExecutionDMContext[] executionDmcs = new IMIExecutionDMContext[info.getThreadIds().length];
|
IExecutionDMContext[] executionDmcs = new IMIExecutionDMContext[info.getThreadIds().length];
|
||||||
for (int i = 0; i < info.getThreadIds().length; i++) {
|
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;
|
return executionDmcs;
|
||||||
}
|
}
|
||||||
|
@ -1562,7 +1565,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
||||||
attr.put(MIBreakpoints.FILE_NAME, debuggerPath);
|
attr.put(MIBreakpoints.FILE_NAME, debuggerPath);
|
||||||
attr.put(MIBreakpoints.LINE_NUMBER, lineNumber);
|
attr.put(MIBreakpoints.LINE_NUMBER, lineNumber);
|
||||||
attr.put(MIBreakpointDMData.IS_TEMPORARY, true);
|
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
|
// Now do the operation
|
||||||
moveToLocation(context, location, attr, rm);
|
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.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT);
|
||||||
attr.put(MIBreakpoints.ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$
|
attr.put(MIBreakpoints.ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$
|
||||||
attr.put(MIBreakpointDMData.IS_TEMPORARY, true);
|
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
|
// Now do the operation
|
||||||
moveToLocation(context, location, attr, rm);
|
moveToLocation(context, location, attr, rm);
|
||||||
|
|
|
@ -285,7 +285,7 @@ implements IStack, ICachingService {
|
||||||
it will eliminate the issue with invalid data on subsequent invocations. We don't cache errors.
|
it will eliminate the issue with invalid data on subsequent invocations. We don't cache errors.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
private class FramesCache extends HashMap<Integer, FramesCacheInfo> {
|
private class FramesCache extends HashMap<String, FramesCacheInfo> {
|
||||||
public void clear(IDMContext context) {
|
public void clear(IDMContext context) {
|
||||||
final IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
|
final IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
|
||||||
if (execDmc != null) {
|
if (execDmc != null) {
|
||||||
|
@ -295,7 +295,7 @@ implements IStack, ICachingService {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public FramesCacheInfo getThreadFramesCache(int threadId) {
|
public FramesCacheInfo getThreadFramesCache(String threadId) {
|
||||||
FramesCacheInfo info = get(threadId);
|
FramesCacheInfo info = get(threadId);
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
put(threadId, info = new FramesCacheInfo());
|
put(threadId, info = new FramesCacheInfo());
|
||||||
|
@ -303,13 +303,13 @@ implements IStack, ICachingService {
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FramesCacheInfo update(int threadId, int stackDepth, int maxRequestedStackDepth) {
|
public FramesCacheInfo update(String threadId, int stackDepth, int maxRequestedStackDepth) {
|
||||||
FramesCacheInfo info = getThreadFramesCache(threadId);
|
FramesCacheInfo info = getThreadFramesCache(threadId);
|
||||||
info.setStackDepth(stackDepth, maxRequestedStackDepth);
|
info.setStackDepth(stackDepth, maxRequestedStackDepth);
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FramesCacheInfo update(int threadId, MIStackListFramesInfo framesInfo) {
|
public FramesCacheInfo update(String threadId, MIStackListFramesInfo framesInfo) {
|
||||||
FramesCacheInfo info = getThreadFramesCache(threadId);
|
FramesCacheInfo info = getThreadFramesCache(threadId);
|
||||||
if (framesInfo != null) {
|
if (framesInfo != null) {
|
||||||
int len = framesInfo.getMIFrames().length;
|
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
|
// if requested stack limit is bigger then currently cached this call will return -1
|
||||||
final int maxDepth = endIndex > 0 ? endIndex + 1 : -1;
|
final int maxDepth = endIndex > 0 ? endIndex + 1 : -1;
|
||||||
int depth = fFramesCache.getThreadFramesCache(execDmc.getThreadId()).getStackDepth(
|
int depth = fFramesCache.getThreadFramesCache(threadId).getStackDepth(
|
||||||
maxDepth);
|
maxDepth);
|
||||||
if (depth > 0) { // our stack depth cache is good so we can use it to fill levels array
|
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));
|
rm.setData(getDMFrames(execDmc, startIndex, endIndex, depth));
|
||||||
|
@ -524,7 +525,7 @@ implements IStack, ICachingService {
|
||||||
// getStackDepth call would have updated cache for us.
|
// 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 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.
|
// 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));
|
rm.done(getDMFrames(execDmc, startIndex, endIndex, stackDepth));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -612,7 +613,7 @@ implements IStack, ICachingService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int threadId = execDmc.getThreadId();
|
String threadId = execDmc.getThreadId();
|
||||||
final int frameLevel = miFrameDmc.fLevel;
|
final int frameLevel = miFrameDmc.fLevel;
|
||||||
FrameData fd = fFramesCache.getThreadFramesCache(threadId).getFrameData(frameLevel);
|
FrameData fd = fFramesCache.getThreadFramesCache(threadId).getFrameData(frameLevel);
|
||||||
if (fd != null) {
|
if (fd != null) {
|
||||||
|
@ -1026,8 +1027,7 @@ implements IStack, ICachingService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int threadId = execDmc.getThreadId();
|
String threadId = execDmc.getThreadId();
|
||||||
|
|
||||||
// Check our internal cache first because different commands can
|
// Check our internal cache first because different commands can
|
||||||
// still be re-used.
|
// still be re-used.
|
||||||
int depth = fFramesCache.getThreadFramesCache(threadId).getStackDepth(maxDepth);
|
int depth = fFramesCache.getThreadFramesCache(threadId).getStackDepth(maxDepth);
|
||||||
|
|
|
@ -582,7 +582,7 @@ public abstract class AbstractMIControl extends AbstractDsfService
|
||||||
public String getThreadId() {
|
public String getThreadId() {
|
||||||
IMIExecutionDMContext execCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IMIExecutionDMContext.class);
|
IMIExecutionDMContext execCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IMIExecutionDMContext.class);
|
||||||
if(execCtx != null)
|
if(execCtx != null)
|
||||||
return Integer.toString(execCtx.getThreadId());
|
return execCtx.getThreadId();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -428,15 +428,21 @@ public class CommandFactory {
|
||||||
return new MIBreakInsert(ctx, func, false);
|
return new MIBreakInsert(ctx, func, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
|
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
|
||||||
boolean isHardware, String condition, int ignoreCount,
|
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);
|
return new MIBreakInsert(ctx, isTemporary, isHardware, condition, ignoreCount, line, tid, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
|
public ICommand<MIBreakInsertInfo> createMIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
|
||||||
boolean isHardware, String condition, int ignoreCount,
|
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);
|
return new MIBreakInsert(ctx, isTemporary, isHardware, condition, ignoreCount, location, tid, disabled, isTracepoint, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,12 +66,12 @@ public class MIBreakInsert extends MICommand<MIBreakInsertInfo>
|
||||||
{
|
{
|
||||||
/** @since 4.0 */
|
/** @since 4.0 */
|
||||||
public MIBreakInsert(IBreakpointsTargetDMContext ctx, String func, boolean allowPending) {
|
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,
|
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);
|
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
|
* This constructor allows to specify if the breakpoint should actually be
|
||||||
* a tracepoint (this will only work starting with GDB 7.1)
|
* 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)
|
* 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,
|
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) {
|
boolean allowPending) {
|
||||||
super(ctx, "-break-insert"); //$NON-NLS-1$
|
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
|
// and passcounts cannot be set by a -break-insert
|
||||||
ignoreCount = 0;
|
ignoreCount = 0;
|
||||||
// GDB 7.1 only supports tracepoints that apply to all threads
|
// 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
|
// Determine the number of optional parameters that are present
|
||||||
|
@ -112,7 +112,7 @@ public class MIBreakInsert extends MICommand<MIBreakInsertInfo>
|
||||||
if (ignoreCount > 0) {
|
if (ignoreCount > 0) {
|
||||||
i += 2;
|
i += 2;
|
||||||
}
|
}
|
||||||
if (tid > 0) {
|
if (!tid.equals("0")) { //$NON-NLS-1$
|
||||||
i += 2;
|
i += 2;
|
||||||
}
|
}
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
@ -150,10 +150,10 @@ public class MIBreakInsert extends MICommand<MIBreakInsertInfo>
|
||||||
opts[i] = Integer.toString(ignoreCount);
|
opts[i] = Integer.toString(ignoreCount);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (tid > 0) {
|
if (!tid.equals("0")) { //$NON-NLS-1$
|
||||||
opts[i] = "-p"; //$NON-NLS-1$
|
opts[i] = "-p"; //$NON-NLS-1$
|
||||||
i++;
|
i++;
|
||||||
opts[i] = Integer.toString(tid);
|
opts[i] = tid;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
|
|
@ -23,14 +23,17 @@ import java.util.regex.Pattern;
|
||||||
*/
|
*/
|
||||||
public class CLIThreadInfo extends MIInfo {
|
public class CLIThreadInfo extends MIInfo {
|
||||||
|
|
||||||
private Integer fCurrentThread;
|
private String fCurrentThread;
|
||||||
|
|
||||||
public CLIThreadInfo(MIOutput out) {
|
public CLIThreadInfo(MIOutput out) {
|
||||||
super(out);
|
super(out);
|
||||||
parse();
|
parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getCurrentThread(){
|
/**
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
public String getCurrentThread(){
|
||||||
return fCurrentThread;
|
return fCurrentThread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +59,7 @@ public class CLIThreadInfo extends MIInfo {
|
||||||
Matcher matcher = pattern.matcher(str);
|
Matcher matcher = pattern.matcher(str);
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
String id = matcher.group(1).trim();
|
String id = matcher.group(1).trim();
|
||||||
fCurrentThread = Integer.parseInt(id);
|
fCurrentThread = id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,7 @@ public class SyncUtil {
|
||||||
@Override
|
@Override
|
||||||
protected void execute(DataRequestMonitor<MIBreakInsertInfo> rm) {
|
protected void execute(DataRequestMonitor<MIBreakInsertInfo> rm) {
|
||||||
fGdbControl.queueCommand(
|
fGdbControl.queueCommand(
|
||||||
fCommandFactory.createMIBreakInsert(bpTargetDmc, temporary, false, null, 0, location, 0),
|
fCommandFactory.createMIBreakInsert(bpTargetDmc, temporary, false, null, 0, location, "0"),
|
||||||
rm);
|
rm);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}}
|
}}
|
||||||
};
|
};
|
||||||
|
@ -164,7 +164,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}}
|
}}
|
||||||
};
|
};
|
||||||
|
@ -215,7 +215,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}},
|
}},
|
||||||
new Step() {
|
new Step() {
|
||||||
|
@ -224,7 +224,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}},
|
}},
|
||||||
new Step() {
|
new Step() {
|
||||||
|
@ -233,7 +233,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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));
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}}
|
}}
|
||||||
};
|
};
|
||||||
|
@ -286,7 +286,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}},
|
}},
|
||||||
new Step() {
|
new Step() {
|
||||||
|
@ -295,7 +295,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}},
|
}},
|
||||||
new Step() {
|
new Step() {
|
||||||
|
@ -304,7 +304,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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));
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}}
|
}}
|
||||||
};
|
};
|
||||||
|
@ -345,7 +345,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}},
|
}},
|
||||||
new Step() {
|
new Step() {
|
||||||
|
@ -354,7 +354,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}},
|
}},
|
||||||
new Step() {
|
new Step() {
|
||||||
|
@ -363,7 +363,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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));
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}}
|
}}
|
||||||
};
|
};
|
||||||
|
@ -422,7 +422,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}},
|
}},
|
||||||
new Step() {
|
new Step() {
|
||||||
|
@ -431,7 +431,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}},
|
}},
|
||||||
new Step() {
|
new Step() {
|
||||||
|
@ -440,7 +440,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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));
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}}
|
}}
|
||||||
};
|
};
|
||||||
|
@ -499,7 +499,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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));
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}}
|
}}
|
||||||
};
|
};
|
||||||
|
@ -567,7 +567,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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));
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm));
|
||||||
}}
|
}}
|
||||||
};
|
};
|
||||||
|
@ -642,7 +642,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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) {
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
@ -652,7 +652,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
@Override
|
@Override
|
||||||
public void execute(final RequestMonitor rm) {
|
public void execute(final RequestMonitor rm) {
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), null));
|
||||||
}}}, new RequestMonitor(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);
|
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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) {
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
@ -719,7 +719,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
@Override
|
@Override
|
||||||
public void execute(final RequestMonitor otherRm) {
|
public void execute(final RequestMonitor otherRm) {
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), otherRm));
|
||||||
}}}, new RequestMonitor(fGDBCtrl.getExecutor(), null));
|
}}}, new RequestMonitor(fGDBCtrl.getExecutor(), null));
|
||||||
|
|
||||||
|
@ -786,7 +786,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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) {
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
@ -796,7 +796,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
@Override
|
@Override
|
||||||
public void execute(final RequestMonitor otherRm) {
|
public void execute(final RequestMonitor otherRm) {
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), otherRm));
|
||||||
}}}, rm);
|
}}}, rm);
|
||||||
}});
|
}});
|
||||||
|
@ -851,7 +851,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class);
|
||||||
|
|
||||||
fGDBCtrl.queueCommand(
|
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) {
|
new DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
@ -861,7 +861,7 @@ public class MIRunControlTargetAvailableTest extends BaseParametrizedTestCase {
|
||||||
@Override
|
@Override
|
||||||
public void execute(final RequestMonitor otherRm) {
|
public void execute(final RequestMonitor otherRm) {
|
||||||
fGDBCtrl.queueCommand(
|
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 DataRequestMonitor<MIBreakInsertInfo> (fGDBCtrl.getExecutor(), otherRm));
|
||||||
}}}, rm);
|
}}}, rm);
|
||||||
}});
|
}});
|
||||||
|
|
|
@ -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),
|
// 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)
|
// 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));
|
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
|
* Get data
|
||||||
|
@ -350,7 +350,7 @@ public class MIRunControlTest extends BaseParametrizedTestCase {
|
||||||
fRunCtrl.getExecutor().submit(new Runnable() {
|
fRunCtrl.getExecutor().submit(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
fRunCtrl.getExecutionData(((MIRunControl)fRunCtrl).createMIExecutionContext(containerDmc, 1), rm);
|
fRunCtrl.getExecutionData(((MIRunControl)fRunCtrl).createMIExecutionContext(containerDmc, "1"), rm);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
wait.waitUntilDone(TestsPlugin.massageTimeout(5000));
|
wait.waitUntilDone(TestsPlugin.massageTimeout(5000));
|
||||||
|
|
Loading…
Add table
Reference in a new issue