|
Lines 30-35
Link Here
|
| 30 |
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsUpdatedEvent; |
30 |
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsUpdatedEvent; |
| 31 |
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; |
31 |
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; |
| 32 |
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; |
32 |
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; |
|
|
33 |
import org.eclipse.cdt.dsf.gdb.internal.tracepointactions.CollectAction; |
| 34 |
import org.eclipse.cdt.dsf.gdb.internal.tracepointactions.EvaluateAction; |
| 35 |
import org.eclipse.cdt.dsf.gdb.internal.tracepointactions.TracepointActionManager; |
| 33 |
import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData; |
36 |
import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData; |
| 34 |
import org.eclipse.cdt.dsf.mi.service.MIBreakpoints; |
37 |
import org.eclipse.cdt.dsf.mi.service.MIBreakpoints; |
| 35 |
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler; |
38 |
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler; |
|
Lines 52-161
Link Here
|
| 52 |
@BeforeClass |
55 |
@BeforeClass |
| 53 |
public static void beforeClassMethod_7_0() { |
56 |
public static void beforeClassMethod_7_0() { |
| 54 |
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_0); |
57 |
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_0); |
| 55 |
|
58 |
|
| 56 |
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/TracepointTestApp.exe"); |
59 |
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/TracepointTestApp.exe"); |
| 57 |
|
60 |
|
| 58 |
// GDB tracepoints are only supported on a remote target (e.g., using gdbserver) |
61 |
// GDB tracepoints are only supported on a remote target (e.g., using gdbserver) |
| 59 |
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, |
62 |
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, |
| 60 |
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE); |
63 |
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE); |
|
|
64 |
|
| 65 |
// To test both fast and slow tracepoint we just the FAST_THEN_SLOW setting |
| 66 |
setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE, |
| 67 |
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_THEN_SLOW); |
| 61 |
} |
68 |
} |
| 62 |
|
69 |
|
| 63 |
private DsfSession fSession; |
70 |
private DsfSession fSession; |
| 64 |
private DsfServicesTracker fServicesTracker; |
71 |
private DsfServicesTracker fServicesTracker; |
| 65 |
private IBreakpoints fBreakpointService; |
72 |
private IBreakpoints fBreakpointService; |
| 66 |
// private ITraceControl fTraceService; |
73 |
// private ITraceControl fTraceService; |
| 67 |
private IBreakpointsTargetDMContext fBreakpointsDmc; |
74 |
private IBreakpointsTargetDMContext fBreakpointsDmc; |
| 68 |
// private ITraceTargetDMContext fTraceTargetDmc; |
75 |
// private ITraceTargetDMContext fTraceTargetDmc; |
| 69 |
|
76 |
|
| 70 |
// private int fTotalTracingBufferSize = 0; |
77 |
// private int fTotalTracingBufferSize = 0; |
| 71 |
|
78 |
|
|
|
79 |
private static final String SOURCE_FILE = "TracepointTestApp.cc"; |
| 80 |
private static final String METHOD_NAME = "testTracepoints"; |
| 81 |
private static final int LINE_NUMBER_1 = 97; |
| 82 |
private static final int LINE_NUMBER_2 = 75; |
| 83 |
private static final int LINE_NUMBER_3 = 76; |
| 84 |
private static final int LINE_NUMBER_4 = 85; |
| 85 |
private static final int LINE_LOOP_2 = 109; |
| 86 |
private static final String NO_CONDITION = ""; |
| 87 |
private static final String NO_COMMANDS = ""; |
| 88 |
// private static final int LAST_LINE_NUMBER = 94; |
| 89 |
// |
| 90 |
// private static final int TOTAL_FRAMES_TO_BE_COLLECTED = 1 + 1 + 10 + 1 + 10000; |
| 91 |
|
| 72 |
private final static int[] PASS_COUNTS = {12, 2, 32, 6, 128, 0, 0, 0, 0, 0, 0, 0}; |
92 |
private final static int[] PASS_COUNTS = {12, 2, 32, 6, 128, 0, 0, 0, 0, 0, 0, 0}; |
|
|
93 |
private final static String[] CONDITIONS = {"gIntVar == 543", "gBoolVar == false", "counter == 3", "counter > 4", "counter > 2 && lIntVar == 12345"}; |
| 73 |
|
94 |
|
| 74 |
// private static CollectAction COLLECT_ACTION_1; |
95 |
private static CollectAction[] COLLECT_ACTIONS = new CollectAction[10]; |
| 75 |
// private static CollectAction COLLECT_ACTION_2; |
96 |
private static EvaluateAction[] EVAL_ACTIONS = new EvaluateAction[10]; |
| 76 |
// private static CollectAction COLLECT_ACTION_3; |
97 |
// private static WhileSteppingAction[] STEPPING_ACTION_1 = new WhileSteppingAction[3]; |
| 77 |
// private static EvalAction EVAL_ACTION_1; |
|
|
| 78 |
// private static EvalAction EVAL_ACTION_2; |
| 79 |
// private static EvalAction EVAL_ACTION_3; |
| 80 |
// private static WhileSteppingAction STEPPING_ACTION_1; |
| 81 |
// private static WhileSteppingAction STEPPING_ACTION_2; |
| 82 |
// private static WhileSteppingAction STEPPING_ACTION_3; |
| 83 |
|
98 |
|
|
|
99 |
static { |
| 100 |
TracepointActionManager tracepointActionMgr = TracepointActionManager.getInstance(); |
| 84 |
|
101 |
|
| 85 |
// static { |
102 |
int index = 0; |
| 86 |
// BreakpointActionManager breakpointActionMgr = CDebugCorePlugin.getDefault().getBreakpointActionManager(); |
103 |
COLLECT_ACTIONS[index] = new CollectAction(); |
| 87 |
// |
104 |
COLLECT_ACTIONS[index].setCollectString("$locals"); |
| 88 |
// COLLECT_ACTION_1 = new CollectAction(); |
105 |
COLLECT_ACTIONS[index].setName("Collect locals"); |
| 89 |
// COLLECT_ACTION_1.setCollectString("$locals, counter"); |
106 |
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]); |
| 90 |
// COLLECT_ACTION_1.setName("CollectAction1"); |
107 |
index++; |
| 91 |
// breakpointActionMgr.addAction(COLLECT_ACTION_1); |
|
|
| 92 |
// |
| 93 |
// COLLECT_ACTION_2 = new CollectAction(); |
| 94 |
// COLLECT_ACTION_2.setCollectString("$reg"); |
| 95 |
// COLLECT_ACTION_2.setName("CollectAction2"); |
| 96 |
// breakpointActionMgr.addAction(COLLECT_ACTION_2); |
| 97 |
// |
| 98 |
// COLLECT_ACTION_3 = new CollectAction(); |
| 99 |
// COLLECT_ACTION_3.setCollectString("$myTraceVariable"); |
| 100 |
// COLLECT_ACTION_3.setName("CollectAction3"); |
| 101 |
// breakpointActionMgr.addAction(COLLECT_ACTION_3); |
| 102 |
// |
| 103 |
// |
| 104 |
// EVAL_ACTION_1 = new EvalAction(); |
| 105 |
// EVAL_ACTION_1.setEvalString("$count=$count+1"); |
| 106 |
// EVAL_ACTION_1.setName("EvalAction1"); |
| 107 |
// breakpointActionMgr.addAction(EVAL_ACTION_1); |
| 108 |
// |
| 109 |
// EVAL_ACTION_2 = new EvalAction(); |
| 110 |
// EVAL_ACTION_2.setEvalString("$count2=$count2+2"); |
| 111 |
// EVAL_ACTION_2.setName("EvalAction2"); |
| 112 |
// breakpointActionMgr.addAction(EVAL_ACTION_2); |
| 113 |
// |
| 114 |
// EVAL_ACTION_3 = new EvalAction(); |
| 115 |
// EVAL_ACTION_3.setEvalString("$count3=$count3+3"); |
| 116 |
// EVAL_ACTION_3.setName("EvalAction3"); |
| 117 |
// breakpointActionMgr.addAction(EVAL_ACTION_3); |
| 118 |
// |
| 119 |
// //TODO do while stepping actions |
| 120 |
// |
| 121 |
// } |
| 122 |
|
108 |
|
| 123 |
@Before |
109 |
COLLECT_ACTIONS[index] = new CollectAction(); |
| 124 |
public void initialTest() throws Exception { |
110 |
COLLECT_ACTIONS[index].setCollectString("gIntVar"); |
| 125 |
fSession = getGDBLaunch().getSession(); |
111 |
COLLECT_ACTIONS[index].setName("Collect gIntVar"); |
| 126 |
Runnable runnable = new Runnable() { |
112 |
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]); |
| 127 |
public void run() { |
113 |
index++; |
| 128 |
fServicesTracker = new DsfServicesTracker(TestsPlugin.getBundleContext(), fSession.getId()); |
|
|
| 129 |
|
114 |
|
| 130 |
|
115 |
COLLECT_ACTIONS[index] = new CollectAction(); |
| 131 |
fBreakpointService = fServicesTracker.getService(IBreakpoints.class); |
116 |
COLLECT_ACTIONS[index].setCollectString("$locals, counter, $reg"); |
| 132 |
// fTraceService = fServicesTracker.getService(ITraceControl.class); |
117 |
COLLECT_ACTIONS[index].setName("Collect locals, counter and reg"); |
| 133 |
fSession.addServiceEventListener(GDBRemoteTracepointsTest_7_0.this, null); |
118 |
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]); |
| 134 |
|
119 |
index++; |
| 135 |
// Create a large array to make sure we don't run out |
120 |
|
| 136 |
fTracepoints = new IBreakpointDMContext[100]; |
121 |
COLLECT_ACTIONS[index] = new CollectAction(); |
| 137 |
|
122 |
COLLECT_ACTIONS[index].setCollectString("$reg"); |
| 138 |
// Run an initial test to check that everything is ok with GDB |
123 |
COLLECT_ACTIONS[index].setName("Collect reg"); |
| 139 |
checkTraceInitialStatus(); |
124 |
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]); |
| 140 |
} |
125 |
index++; |
| 141 |
}; |
126 |
|
| 142 |
fSession.getExecutor().submit(runnable).get(); |
127 |
COLLECT_ACTIONS[index] = new CollectAction(); |
| 143 |
|
128 |
COLLECT_ACTIONS[index].setCollectString("counter, $locals"); |
| 144 |
IContainerDMContext containerDmc = SyncUtil.getContainerContext(); |
129 |
COLLECT_ACTIONS[index].setName("Collect counter, locals"); |
| 145 |
fBreakpointsDmc = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class); |
130 |
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]); |
| 146 |
assert(fBreakpointsDmc != null); |
131 |
index++; |
| 147 |
// fTraceTargetDmc = DMContexts.getAncestorOfType(containerDmc, ITraceTargetDMContext.class); |
132 |
|
|
|
133 |
COLLECT_ACTIONS[index] = new CollectAction(); |
| 134 |
COLLECT_ACTIONS[index].setCollectString("$myTraceVariable"); |
| 135 |
COLLECT_ACTIONS[index].setName("Collect myTraceVariable"); |
| 136 |
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]); |
| 137 |
index++; |
| 138 |
|
| 139 |
index=0; |
| 140 |
EVAL_ACTIONS[index] = new EvaluateAction(); |
| 141 |
EVAL_ACTIONS[index].setEvalString("$count=$count+1"); |
| 142 |
EVAL_ACTIONS[index].setName("Eval increment count"); |
| 143 |
tracepointActionMgr.addAction(EVAL_ACTIONS[index]); |
| 144 |
index++; |
| 145 |
|
| 146 |
EVAL_ACTIONS[index] = new EvaluateAction(); |
| 147 |
EVAL_ACTIONS[index].setEvalString("$count2=$count2+2"); |
| 148 |
EVAL_ACTIONS[index].setName("Eval increment count2 by 2"); |
| 149 |
tracepointActionMgr.addAction(EVAL_ACTIONS[index]); |
| 150 |
index++; |
| 151 |
|
| 152 |
EVAL_ACTIONS[index] = new EvaluateAction(); |
| 153 |
EVAL_ACTIONS[index].setEvalString("$count3=$count3+3"); |
| 154 |
EVAL_ACTIONS[index].setName("Eval increment count3 by 3"); |
| 155 |
tracepointActionMgr.addAction(EVAL_ACTIONS[index]); |
| 156 |
index++; |
| 157 |
|
| 158 |
//TODO do while stepping actions |
| 159 |
index=0; |
| 148 |
|
160 |
|
| 149 |
} |
161 |
} |
| 150 |
|
162 |
|
|
|
163 |
@Before |
| 164 |
public void initialTest() throws Exception { |
| 165 |
fSession = getGDBLaunch().getSession(); |
| 166 |
Runnable runnable = new Runnable() { |
| 167 |
public void run() { |
| 168 |
fServicesTracker = new DsfServicesTracker(TestsPlugin.getBundleContext(), fSession.getId()); |
| 169 |
|
| 170 |
|
| 171 |
fBreakpointService = fServicesTracker.getService(IBreakpoints.class); |
| 172 |
// fTraceService = fServicesTracker.getService(ITraceControl.class); |
| 173 |
fSession.addServiceEventListener(GDBRemoteTracepointsTest_7_0.this, null); |
| 174 |
|
| 175 |
// Create a large array to make sure we don't run out |
| 176 |
fTracepoints = new IBreakpointDMContext[100]; |
| 177 |
|
| 178 |
// Run an initial test to check that everything is ok with GDB |
| 179 |
checkTraceInitialStatus(); |
| 180 |
} |
| 181 |
}; |
| 182 |
fSession.getExecutor().submit(runnable).get(); |
| 183 |
|
| 184 |
IContainerDMContext containerDmc = SyncUtil.getContainerContext(); |
| 185 |
fBreakpointsDmc = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class); |
| 186 |
assert(fBreakpointsDmc != null); |
| 187 |
// fTraceTargetDmc = DMContexts.getAncestorOfType(containerDmc, ITraceTargetDMContext.class); |
| 188 |
|
| 189 |
} |
| 190 |
|
| 151 |
@After |
191 |
@After |
| 152 |
public void shutdown() throws Exception { |
192 |
public void shutdown() throws Exception { |
| 153 |
Runnable runnable = new Runnable() { |
193 |
Runnable runnable = new Runnable() { |
| 154 |
public void run() { |
194 |
public void run() { |
| 155 |
fSession.removeServiceEventListener(GDBRemoteTracepointsTest_7_0.this); |
195 |
fSession.removeServiceEventListener(GDBRemoteTracepointsTest_7_0.this); |
| 156 |
} |
196 |
} |
| 157 |
}; |
197 |
}; |
| 158 |
fSession.getExecutor().submit(runnable).get(); |
198 |
fSession.getExecutor().submit(runnable).get(); |
| 159 |
fBreakpointService = null; |
199 |
fBreakpointService = null; |
| 160 |
fServicesTracker.dispose(); |
200 |
fServicesTracker.dispose(); |
| 161 |
} |
201 |
} |
|
Lines 164-207
Link Here
|
| 164 |
// ********************************************************************* |
204 |
// ********************************************************************* |
| 165 |
// Below are utility methods. |
205 |
// Below are utility methods. |
| 166 |
// ********************************************************************* |
206 |
// ********************************************************************* |
| 167 |
private static Boolean lock = true; |
207 |
private static Boolean lock = true; |
| 168 |
enum Events {BP_ADDED, BP_UPDATED, BP_REMOVED, BP_HIT} |
208 |
enum Events {BP_ADDED, BP_UPDATED, BP_REMOVED, BP_HIT} |
| 169 |
final int BP_ADDED = Events.BP_ADDED.ordinal(); |
209 |
final int BP_ADDED = Events.BP_ADDED.ordinal(); |
| 170 |
final int BP_UPDATED = Events.BP_UPDATED.ordinal(); |
210 |
final int BP_UPDATED = Events.BP_UPDATED.ordinal(); |
| 171 |
final int BP_REMOVED = Events.BP_REMOVED.ordinal(); |
211 |
final int BP_REMOVED = Events.BP_REMOVED.ordinal(); |
| 172 |
final int BP_HIT = Events.BP_HIT.ordinal(); |
212 |
final int BP_HIT = Events.BP_HIT.ordinal(); |
| 173 |
private int[] fBreakpointEvents = new int[Events.values().length]; |
213 |
private int[] fBreakpointEvents = new int[Events.values().length]; |
| 174 |
private boolean fBreakpointEvent; |
214 |
private boolean fBreakpointEvent; |
| 175 |
private int fBreakpointEventCount; |
215 |
private int fBreakpointEventCount; |
| 176 |
|
216 |
|
| 177 |
@DsfServiceEventHandler |
217 |
@DsfServiceEventHandler |
| 178 |
public void eventDispatched(IBreakpointsAddedEvent e) { |
218 |
public void eventDispatched(IBreakpointsAddedEvent e) { |
| 179 |
synchronized (lock) { |
219 |
synchronized (lock) { |
| 180 |
fBreakpointEvents[BP_ADDED]++; |
220 |
fBreakpointEvents[BP_ADDED]++; |
| 181 |
fBreakpointEventCount++; |
221 |
fBreakpointEventCount++; |
| 182 |
fBreakpointEvent = true; |
222 |
fBreakpointEvent = true; |
| 183 |
lock.notifyAll(); |
223 |
lock.notifyAll(); |
| 184 |
} |
224 |
} |
| 185 |
} |
225 |
} |
| 186 |
|
226 |
|
| 187 |
@DsfServiceEventHandler |
227 |
@DsfServiceEventHandler |
| 188 |
public void eventDispatched(IBreakpointsUpdatedEvent e) { |
228 |
public void eventDispatched(IBreakpointsUpdatedEvent e) { |
| 189 |
synchronized (lock) { |
229 |
synchronized (lock) { |
| 190 |
fBreakpointEvents[BP_UPDATED]++; |
230 |
fBreakpointEvents[BP_UPDATED]++; |
| 191 |
fBreakpointEventCount++; |
231 |
fBreakpointEventCount++; |
| 192 |
fBreakpointEvent = true; |
232 |
fBreakpointEvent = true; |
| 193 |
lock.notifyAll(); |
233 |
lock.notifyAll(); |
| 194 |
} |
234 |
} |
| 195 |
} |
235 |
} |
| 196 |
|
236 |
|
| 197 |
@DsfServiceEventHandler |
237 |
@DsfServiceEventHandler |
| 198 |
public void eventDispatched(IBreakpointsRemovedEvent e) { |
238 |
public void eventDispatched(IBreakpointsRemovedEvent e) { |
| 199 |
synchronized (lock) { |
239 |
synchronized (lock) { |
| 200 |
fBreakpointEvents[BP_REMOVED]++; |
240 |
fBreakpointEvents[BP_REMOVED]++; |
| 201 |
fBreakpointEventCount++; |
241 |
fBreakpointEventCount++; |
| 202 |
fBreakpointEvent = true; |
242 |
fBreakpointEvent = true; |
| 203 |
lock.notifyAll(); |
243 |
lock.notifyAll(); |
| 204 |
} |
244 |
} |
| 205 |
} |
245 |
} |
| 206 |
|
246 |
|
| 207 |
// Clears the counters |
247 |
// Clears the counters |
|
Lines 218-226
Link Here
|
| 218 |
// Get the breakpoint hit count |
258 |
// Get the breakpoint hit count |
| 219 |
private int getBreakpointEventCount(int event) { |
259 |
private int getBreakpointEventCount(int event) { |
| 220 |
int count = 0; |
260 |
int count = 0; |
| 221 |
synchronized (lock) { |
261 |
synchronized (lock) { |
| 222 |
count = fBreakpointEvents[event]; |
262 |
count = fBreakpointEvents[event]; |
| 223 |
} |
263 |
} |
| 224 |
return count; |
264 |
return count; |
| 225 |
} |
265 |
} |
| 226 |
|
266 |
|
|
Lines 235-572
Link Here
|
| 235 |
} |
275 |
} |
| 236 |
} |
276 |
} |
| 237 |
fBreakpointEvent = false; |
277 |
fBreakpointEvent = false; |
| 238 |
} |
278 |
} |
| 239 |
} |
279 |
} |
| 240 |
|
280 |
|
| 241 |
// ********************************************************************* |
281 |
// ********************************************************************* |
| 242 |
// Breakpoint service methods (to use with tracepoints). |
282 |
// Breakpoint service methods (to use with tracepoints). |
| 243 |
// ********************************************************************* |
283 |
// ********************************************************************* |
| 244 |
|
284 |
|
| 245 |
private IBreakpointDMContext insertBreakpoint(final IBreakpointsTargetDMContext context, |
285 |
private IBreakpointDMContext insertBreakpoint(final IBreakpointsTargetDMContext context, |
| 246 |
final Map<String,Object> attributes) throws InterruptedException |
286 |
final Map<String,Object> attributes) throws InterruptedException |
| 247 |
{ |
287 |
{ |
| 248 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
288 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 249 |
|
289 |
|
| 250 |
fBreakpointService.getExecutor().submit(new Runnable() { |
290 |
fBreakpointService.getExecutor().submit(new Runnable() { |
| 251 |
public void run() { |
291 |
public void run() { |
| 252 |
fBreakpointService.insertBreakpoint(context, attributes, |
292 |
fBreakpointService.insertBreakpoint(context, attributes, |
| 253 |
new DataRequestMonitor<IBreakpointDMContext>(fBreakpointService.getExecutor(), null) { |
293 |
new DataRequestMonitor<IBreakpointDMContext>(fBreakpointService.getExecutor(), null) { |
| 254 |
@Override |
294 |
@Override |
| 255 |
protected void handleCompleted() { |
295 |
protected void handleCompleted() { |
| 256 |
wait.setReturnInfo(getData()); |
296 |
wait.setReturnInfo(getData()); |
| 257 |
wait.waitFinished(getStatus()); |
297 |
wait.waitFinished(getStatus()); |
| 258 |
} |
298 |
} |
| 259 |
}); |
299 |
}); |
| 260 |
} |
300 |
} |
| 261 |
}); |
301 |
}); |
| 262 |
|
302 |
|
| 263 |
// Wait for the result and return the breakpoint id |
303 |
// Wait for the result and return the breakpoint id |
| 264 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
304 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 265 |
assertTrue(wait.getMessage(), wait.isOK()); |
305 |
assertTrue(wait.getMessage(), wait.isOK()); |
| 266 |
|
306 |
|
| 267 |
return (IBreakpointDMContext)wait.getReturnInfo(); |
307 |
return (IBreakpointDMContext)wait.getReturnInfo(); |
| 268 |
} |
308 |
} |
| 269 |
|
309 |
|
| 270 |
private void removeBreakpoint(final IBreakpointDMContext breakpoint) throws InterruptedException |
310 |
private void removeBreakpoint(final IBreakpointDMContext breakpoint) throws InterruptedException |
| 271 |
{ |
311 |
{ |
| 272 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
312 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 273 |
|
313 |
|
| 274 |
fBreakpointService.getExecutor().submit(new Runnable() { |
314 |
fBreakpointService.getExecutor().submit(new Runnable() { |
| 275 |
public void run() { |
315 |
public void run() { |
| 276 |
fBreakpointService.removeBreakpoint(breakpoint, |
316 |
fBreakpointService.removeBreakpoint(breakpoint, |
| 277 |
new RequestMonitor(fBreakpointService.getExecutor(), null) { |
317 |
new RequestMonitor(fBreakpointService.getExecutor(), null) { |
| 278 |
@Override |
318 |
@Override |
| 279 |
protected void handleCompleted() { |
319 |
protected void handleCompleted() { |
| 280 |
wait.waitFinished(getStatus()); |
320 |
wait.waitFinished(getStatus()); |
| 281 |
} |
321 |
} |
| 282 |
}); |
322 |
}); |
| 283 |
} |
323 |
} |
| 284 |
}); |
324 |
}); |
| 285 |
|
325 |
|
| 286 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
326 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 287 |
assertTrue(wait.getMessage(), wait.isOK()); |
327 |
assertTrue(wait.getMessage(), wait.isOK()); |
| 288 |
} |
328 |
} |
| 289 |
|
329 |
|
| 290 |
private void updateBreakpoint(final IBreakpointDMContext breakpoint, |
330 |
private void updateBreakpoint(final IBreakpointDMContext breakpoint, |
| 291 |
final Map<String, Object> delta) throws InterruptedException |
331 |
final Map<String, Object> delta) throws InterruptedException |
| 292 |
{ |
332 |
{ |
| 293 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
333 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 294 |
|
334 |
|
| 295 |
fBreakpointService.getExecutor().submit(new Runnable() { |
335 |
fBreakpointService.getExecutor().submit(new Runnable() { |
| 296 |
public void run() { |
336 |
public void run() { |
| 297 |
fBreakpointService.updateBreakpoint(breakpoint, delta, |
337 |
fBreakpointService.updateBreakpoint(breakpoint, delta, |
| 298 |
new RequestMonitor(fBreakpointService.getExecutor(), null) { |
338 |
new RequestMonitor(fBreakpointService.getExecutor(), null) { |
| 299 |
@Override |
339 |
@Override |
| 300 |
protected void handleCompleted() { |
340 |
protected void handleCompleted() { |
| 301 |
wait.waitFinished(getStatus()); |
341 |
wait.waitFinished(getStatus()); |
| 302 |
} |
342 |
} |
| 303 |
}); |
343 |
}); |
| 304 |
} |
344 |
} |
| 305 |
}); |
345 |
}); |
| 306 |
|
346 |
|
| 307 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
347 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 308 |
assertTrue(wait.getMessage(), wait.isOK()); |
348 |
assertTrue(wait.getMessage(), wait.isOK()); |
| 309 |
} |
349 |
} |
| 310 |
|
|
|
| 311 |
private IBreakpointDMData getBreakpoint(final IBreakpointDMContext breakpoint) throws InterruptedException |
| 312 |
{ |
| 313 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 314 |
|
350 |
|
| 315 |
fBreakpointService.getExecutor().submit(new Runnable() { |
351 |
private IBreakpointDMData getBreakpoint(final IBreakpointDMContext breakpoint) throws InterruptedException |
| 316 |
public void run() { |
352 |
{ |
| 317 |
fBreakpointService.getBreakpointDMData(breakpoint, |
353 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 318 |
new DataRequestMonitor<IBreakpointDMData>(fBreakpointService.getExecutor(), null) { |
|
|
| 319 |
@Override |
| 320 |
protected void handleCompleted() { |
| 321 |
wait.setReturnInfo(getData()); |
| 322 |
wait.waitFinished(getStatus()); |
| 323 |
} |
| 324 |
}); |
| 325 |
} |
| 326 |
}); |
| 327 |
|
354 |
|
| 328 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
355 |
fBreakpointService.getExecutor().submit(new Runnable() { |
| 329 |
assertTrue(wait.getMessage(), wait.isOK()); |
356 |
public void run() { |
|
|
357 |
fBreakpointService.getBreakpointDMData(breakpoint, |
| 358 |
new DataRequestMonitor<IBreakpointDMData>(fBreakpointService.getExecutor(), null) { |
| 359 |
@Override |
| 360 |
protected void handleCompleted() { |
| 361 |
wait.setReturnInfo(getData()); |
| 362 |
wait.waitFinished(getStatus()); |
| 363 |
} |
| 364 |
}); |
| 365 |
} |
| 366 |
}); |
| 330 |
|
367 |
|
| 331 |
return (IBreakpointDMData)wait.getReturnInfo(); |
368 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 332 |
} |
369 |
assertTrue(wait.getMessage(), wait.isOK()); |
| 333 |
|
|
|
| 334 |
private IBreakpointDMContext[] getBreakpoints(final IBreakpointsTargetDMContext context) throws InterruptedException |
| 335 |
{ |
| 336 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 337 |
|
370 |
|
| 338 |
fBreakpointService.getExecutor().submit(new Runnable() { |
371 |
return (IBreakpointDMData)wait.getReturnInfo(); |
| 339 |
public void run() { |
372 |
} |
| 340 |
fBreakpointService.getBreakpoints(context, new DataRequestMonitor<IBreakpointDMContext[]>(fBreakpointService.getExecutor(), null) { |
|
|
| 341 |
@Override |
| 342 |
protected void handleCompleted() { |
| 343 |
wait.setReturnInfo(getData()); |
| 344 |
wait.waitFinished(getStatus()); |
| 345 |
} |
| 346 |
}); |
| 347 |
} |
| 348 |
}); |
| 349 |
|
373 |
|
| 350 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
374 |
private IBreakpointDMContext[] getBreakpoints(final IBreakpointsTargetDMContext context) throws InterruptedException |
| 351 |
assertTrue(wait.getMessage(), wait.isOK()); |
375 |
{ |
|
|
376 |
final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 352 |
|
377 |
|
| 353 |
return (IBreakpointDMContext[])wait.getReturnInfo(); |
378 |
fBreakpointService.getExecutor().submit(new Runnable() { |
| 354 |
} |
379 |
public void run() { |
|
|
380 |
fBreakpointService.getBreakpoints(context, new DataRequestMonitor<IBreakpointDMContext[]>(fBreakpointService.getExecutor(), null) { |
| 381 |
@Override |
| 382 |
protected void handleCompleted() { |
| 383 |
wait.setReturnInfo(getData()); |
| 384 |
wait.waitFinished(getStatus()); |
| 385 |
} |
| 386 |
}); |
| 387 |
} |
| 388 |
}); |
| 389 |
|
| 390 |
wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 391 |
assertTrue(wait.getMessage(), wait.isOK()); |
| 392 |
|
| 393 |
return (IBreakpointDMContext[])wait.getReturnInfo(); |
| 394 |
} |
| 355 |
|
395 |
|
| 356 |
// ********************************************************************* |
396 |
// ********************************************************************* |
| 357 |
// TraceControl service methods. |
397 |
// TraceControl service methods. |
| 358 |
// ********************************************************************* |
398 |
// ********************************************************************* |
| 359 |
|
399 |
|
| 360 |
// private void startTracing() throws InterruptedException |
400 |
// private void startTracing() throws InterruptedException |
| 361 |
// { |
401 |
// { |
| 362 |
// startTracing(null); |
402 |
// startTracing(null); |
| 363 |
// } |
403 |
// } |
| 364 |
// |
404 |
// |
| 365 |
// private void startTracing(String errorMessage) throws InterruptedException |
405 |
// private void startTracing(String errorMessage) throws InterruptedException |
| 366 |
// { |
406 |
// { |
| 367 |
// final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
407 |
// final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 368 |
// |
408 |
// |
| 369 |
// fTraceService.getExecutor().submit(new Runnable() { |
409 |
// fTraceService.getExecutor().submit(new Runnable() { |
| 370 |
// public void run() { |
410 |
// public void run() { |
| 371 |
// fTraceService.canStartTracing(fTraceTargetDmc, |
411 |
// fTraceService.canStartTracing(fTraceTargetDmc, |
| 372 |
// new DataRequestMonitor<Boolean>(fTraceService.getExecutor(), null) { |
412 |
// new DataRequestMonitor<Boolean>(fTraceService.getExecutor(), null) { |
| 373 |
// @Override |
413 |
// @Override |
| 374 |
// protected void handleCompleted() { |
414 |
// protected void handleCompleted() { |
| 375 |
// wait.setReturnInfo(getData()); |
415 |
// wait.setReturnInfo(getData()); |
| 376 |
// wait.waitFinished(getStatus()); |
416 |
// wait.waitFinished(getStatus()); |
| 377 |
// } |
417 |
// } |
| 378 |
// }); |
418 |
// }); |
| 379 |
// } |
419 |
// } |
| 380 |
// }); |
420 |
// }); |
| 381 |
// |
421 |
// |
| 382 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
422 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 383 |
// assertTrue(wait.getMessage(), wait.isOK()); |
423 |
// assertTrue(wait.getMessage(), wait.isOK()); |
| 384 |
// assertTrue("Not allowed to start tracing!", (Boolean)wait.getReturnInfo()); |
424 |
// assertTrue("Not allowed to start tracing!", (Boolean)wait.getReturnInfo()); |
| 385 |
// |
425 |
// |
| 386 |
// wait.waitReset(); |
426 |
// wait.waitReset(); |
| 387 |
// |
427 |
// |
| 388 |
// fTraceService.getExecutor().submit(new Runnable() { |
428 |
// fTraceService.getExecutor().submit(new Runnable() { |
| 389 |
// public void run() { |
429 |
// public void run() { |
| 390 |
// fTraceService.startTracing(fTraceTargetDmc, |
430 |
// fTraceService.startTracing(fTraceTargetDmc, |
| 391 |
// new RequestMonitor(fTraceService.getExecutor(), null) { |
431 |
// new RequestMonitor(fTraceService.getExecutor(), null) { |
| 392 |
// @Override |
432 |
// @Override |
| 393 |
// protected void handleCompleted() { |
433 |
// protected void handleCompleted() { |
| 394 |
// wait.waitFinished(getStatus()); |
434 |
// wait.waitFinished(getStatus()); |
| 395 |
// } |
435 |
// } |
| 396 |
// }); |
436 |
// }); |
| 397 |
// } |
437 |
// } |
| 398 |
// }); |
438 |
// }); |
| 399 |
// |
439 |
// |
| 400 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
440 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 401 |
// if (errorMessage == null) { |
441 |
// if (errorMessage == null) { |
| 402 |
// assertTrue(wait.getMessage(), wait.isOK()); |
442 |
// assertTrue(wait.getMessage(), wait.isOK()); |
| 403 |
// } else { |
443 |
// } else { |
| 404 |
// assertTrue(wait.getMessage(), !wait.isOK()); |
444 |
// assertTrue(wait.getMessage(), !wait.isOK()); |
| 405 |
// assertTrue("Message " + wait.getMessage() + " does not contain \"" + errorMessage +"\"", |
445 |
// assertTrue("Message " + wait.getMessage() + " does not contain \"" + errorMessage +"\"", |
| 406 |
// wait.getMessage().indexOf(errorMessage) != -1); |
446 |
// wait.getMessage().indexOf(errorMessage) != -1); |
| 407 |
// } |
447 |
// } |
| 408 |
// } |
448 |
// } |
| 409 |
// |
449 |
// |
| 410 |
// private void stopTracing() throws InterruptedException |
450 |
// private void stopTracing() throws InterruptedException |
| 411 |
// { |
451 |
// { |
| 412 |
// final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
452 |
// final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 413 |
// |
453 |
// |
| 414 |
// fTraceService.getExecutor().submit(new Runnable() { |
454 |
// fTraceService.getExecutor().submit(new Runnable() { |
| 415 |
// public void run() { |
455 |
// public void run() { |
| 416 |
// fTraceService.canStopTracing(fTraceTargetDmc, |
456 |
// fTraceService.canStopTracing(fTraceTargetDmc, |
| 417 |
// new DataRequestMonitor<Boolean>(fTraceService.getExecutor(), null) { |
457 |
// new DataRequestMonitor<Boolean>(fTraceService.getExecutor(), null) { |
| 418 |
// @Override |
458 |
// @Override |
| 419 |
// protected void handleCompleted() { |
459 |
// protected void handleCompleted() { |
| 420 |
// wait.setReturnInfo(getData()); |
460 |
// wait.setReturnInfo(getData()); |
| 421 |
// wait.waitFinished(getStatus()); |
461 |
// wait.waitFinished(getStatus()); |
| 422 |
// } |
462 |
// } |
| 423 |
// }); |
463 |
// }); |
| 424 |
// } |
464 |
// } |
| 425 |
// }); |
465 |
// }); |
| 426 |
// |
466 |
// |
| 427 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
467 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 428 |
// assertTrue(wait.getMessage(), wait.isOK()); |
468 |
// assertTrue(wait.getMessage(), wait.isOK()); |
| 429 |
// assertTrue("Not allowed to stop tracing!", (Boolean)wait.getReturnInfo()); |
469 |
// assertTrue("Not allowed to stop tracing!", (Boolean)wait.getReturnInfo()); |
| 430 |
// |
470 |
// |
| 431 |
// wait.waitReset(); |
471 |
// wait.waitReset(); |
| 432 |
// |
472 |
// |
| 433 |
// fTraceService.getExecutor().submit(new Runnable() { |
473 |
// fTraceService.getExecutor().submit(new Runnable() { |
| 434 |
// public void run() { |
474 |
// public void run() { |
| 435 |
// fTraceService.stopTracing(fTraceTargetDmc, |
475 |
// fTraceService.stopTracing(fTraceTargetDmc, |
| 436 |
// new RequestMonitor(fTraceService.getExecutor(), null) { |
476 |
// new RequestMonitor(fTraceService.getExecutor(), null) { |
| 437 |
// @Override |
477 |
// @Override |
| 438 |
// protected void handleCompleted() { |
478 |
// protected void handleCompleted() { |
| 439 |
// wait.waitFinished(getStatus()); |
479 |
// wait.waitFinished(getStatus()); |
| 440 |
// } |
480 |
// } |
| 441 |
// }); |
481 |
// }); |
| 442 |
// } |
482 |
// } |
| 443 |
// }); |
483 |
// }); |
| 444 |
// |
484 |
// |
| 445 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
485 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 446 |
// assertTrue(wait.getMessage(), wait.isOK()); |
486 |
// assertTrue(wait.getMessage(), wait.isOK()); |
| 447 |
// } |
487 |
// } |
| 448 |
// |
488 |
// |
| 449 |
// private boolean isTracing() throws InterruptedException |
489 |
// private boolean isTracing() throws InterruptedException |
| 450 |
// { |
490 |
// { |
| 451 |
// final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
491 |
// final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 452 |
// |
492 |
// |
| 453 |
// fTraceService.getExecutor().submit(new Runnable() { |
493 |
// fTraceService.getExecutor().submit(new Runnable() { |
| 454 |
// public void run() { |
494 |
// public void run() { |
| 455 |
// fTraceService.isTracing(fTraceTargetDmc, |
495 |
// fTraceService.isTracing(fTraceTargetDmc, |
| 456 |
// new DataRequestMonitor<Boolean>(fTraceService.getExecutor(), null) { |
496 |
// new DataRequestMonitor<Boolean>(fTraceService.getExecutor(), null) { |
| 457 |
// @Override |
497 |
// @Override |
| 458 |
// protected void handleCompleted() { |
498 |
// protected void handleCompleted() { |
| 459 |
// wait.setReturnInfo(getData()); |
499 |
// wait.setReturnInfo(getData()); |
| 460 |
// wait.waitFinished(getStatus()); |
500 |
// wait.waitFinished(getStatus()); |
| 461 |
// } |
501 |
// } |
| 462 |
// }); |
502 |
// }); |
| 463 |
// } |
503 |
// } |
| 464 |
// }); |
504 |
// }); |
| 465 |
// |
505 |
// |
| 466 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
506 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 467 |
// assertTrue(wait.getMessage(), wait.isOK()); |
507 |
// assertTrue(wait.getMessage(), wait.isOK()); |
| 468 |
// |
508 |
// |
| 469 |
// return (Boolean)wait.getReturnInfo(); |
509 |
// return (Boolean)wait.getReturnInfo(); |
| 470 |
// } |
510 |
// } |
| 471 |
// |
511 |
// |
| 472 |
// private ITraceStatusDMData getTraceStatus() throws InterruptedException |
512 |
// private ITraceStatusDMData getTraceStatus() throws InterruptedException |
| 473 |
// { |
513 |
// { |
| 474 |
// final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
514 |
// final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); |
| 475 |
// |
515 |
// |
| 476 |
// fTraceService.getExecutor().submit(new Runnable() { |
516 |
// fTraceService.getExecutor().submit(new Runnable() { |
| 477 |
// public void run() { |
517 |
// public void run() { |
| 478 |
// fTraceService.getTraceStatus(fTraceTargetDmc, |
518 |
// fTraceService.getTraceStatus(fTraceTargetDmc, |
| 479 |
// new DataRequestMonitor<ITraceStatusDMData>(fTraceService.getExecutor(), null) { |
519 |
// new DataRequestMonitor<ITraceStatusDMData>(fTraceService.getExecutor(), null) { |
| 480 |
// @Override |
520 |
// @Override |
| 481 |
// protected void handleCompleted() { |
521 |
// protected void handleCompleted() { |
| 482 |
// wait.setReturnInfo(getData()); |
522 |
// wait.setReturnInfo(getData()); |
| 483 |
// wait.waitFinished(getStatus()); |
523 |
// wait.waitFinished(getStatus()); |
| 484 |
// } |
524 |
// } |
| 485 |
// }); |
525 |
// }); |
| 486 |
// } |
526 |
// } |
| 487 |
// }); |
527 |
// }); |
| 488 |
// |
528 |
// |
| 489 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
529 |
// wait.waitUntilDone(AsyncCompletionWaitor.WAIT_FOREVER); |
| 490 |
// assertTrue(wait.getMessage(), wait.isOK()); |
530 |
// assertTrue(wait.getMessage(), wait.isOK()); |
| 491 |
// |
531 |
// |
| 492 |
// return (ITraceStatusDMData)wait.getReturnInfo(); |
532 |
// return (ITraceStatusDMData)wait.getReturnInfo(); |
| 493 |
// } |
533 |
// } |
| 494 |
|
534 |
|
| 495 |
// ********************************************************************* |
535 |
// ********************************************************************* |
| 496 |
// Below are the tests for the control of tracepoints. |
536 |
// Below are the tests for the control of tracepoints. |
| 497 |
// ********************************************************************* |
537 |
// ********************************************************************* |
| 498 |
|
538 |
|
| 499 |
private static final String SOURCE_FILE = "TracepointTestApp.cc"; |
539 |
private IBreakpointDMContext[] fTracepoints = null; |
| 500 |
private static final String METHOD_NAME = "testTracepoints"; |
|
|
| 501 |
private static final int LINE_NUMBER_1 = 84; |
| 502 |
private static final int LINE_NUMBER_2 = 55; |
| 503 |
private static final int LINE_NUMBER_3 = 56; |
| 504 |
private static final int LINE_LOOP_1 = 81; |
| 505 |
private static final int LINE_LOOP_2 = 88; |
| 506 |
private static final String NO_CONDITION = ""; |
| 507 |
// private static final int LAST_LINE_NUMBER = 94; |
| 508 |
// |
| 509 |
// private static final int TOTAL_FRAMES_TO_BE_COLLECTED = 1 + 1 + 10 + 1 + 10000; |
| 510 |
|
540 |
|
|
|
541 |
// private void checkTraceStatus(boolean supported, boolean active, int frames, |
| 542 |
// STOP_REASON_ENUM reason, Integer stoppingTracepoint) throws Throwable { |
| 543 |
// ITraceStatusDMData status = getTraceStatus(); |
| 544 |
// assertTrue("Error tracing supported should be " + supported + " but was " + status.isTracingSupported(), |
| 545 |
// status.isTracingSupported() == supported); |
| 546 |
// assertTrue("Error tracing active should be " + active + " but was " + status.isTracingActive(), |
| 547 |
// status.isTracingActive() == active); |
| 548 |
// boolean isTracing = isTracing(); |
| 549 |
// assertTrue("Error, tracing active is " + status.isTracingActive() + " but the tracepoint service thinks it is " + isTracing, |
| 550 |
// status.isTracingActive() == isTracing); |
| 551 |
// |
| 552 |
// assertTrue("Wrong number of collected frames. Expected " + frames + " but got " + |
| 553 |
// status.getNumberOfCollectedFrame(), |
| 554 |
// status.getNumberOfCollectedFrame() == frames); |
| 555 |
// assertTrue("Total buffer size should be positive but is " + |
| 556 |
// status.getTotalBufferSize(), |
| 557 |
// status.getTotalBufferSize() > 0); |
| 558 |
// |
| 559 |
// if (fTotalTracingBufferSize == 0) { |
| 560 |
// // Initialize buffer |
| 561 |
// fTotalTracingBufferSize = status.getTotalBufferSize(); |
| 562 |
// } else { |
| 563 |
// assertTrue("Total buffer size changed! Should be " + fTotalTracingBufferSize + |
| 564 |
// " but got " + status.getTotalBufferSize(), |
| 565 |
// status.getTotalBufferSize() == fTotalTracingBufferSize); |
| 566 |
// } |
| 567 |
// |
| 568 |
// assertTrue("Expected stopping reason " + reason + " but got " + status.getStopReason(), |
| 569 |
// status.getStopReason() == reason); |
| 570 |
// assertTrue("Expected stopping bp " + stoppingTracepoint + " but got " + status.getStoppingTracepoint(), |
| 571 |
// status.getStoppingTracepoint() == stoppingTracepoint); |
| 572 |
// } |
| 573 |
// |
| 574 |
// private void checkTraceStatus(boolean supported, boolean active, int frames) throws Throwable { |
| 575 |
// checkTraceStatus(supported, active, frames, null, null); |
| 576 |
// } |
| 511 |
|
577 |
|
| 512 |
private IBreakpointDMContext[] fTracepoints = null; |
578 |
// GDB 7.0 does not support fast tracepoints, but GDB 7.2 will |
|
|
579 |
protected boolean fastTracepointsSupported() { return false; } |
| 513 |
|
580 |
|
| 514 |
// private void checkTraceStatus(boolean supported, boolean active, int frames, |
|
|
| 515 |
// STOP_REASON_ENUM reason, Integer stoppingTracepoint) throws Throwable { |
| 516 |
// ITraceStatusDMData status = getTraceStatus(); |
| 517 |
// assertTrue("Error tracing supported should be " + supported + " but was " + status.isTracingSupported(), |
| 518 |
// status.isTracingSupported() == supported); |
| 519 |
// assertTrue("Error tracing active should be " + active + " but was " + status.isTracingActive(), |
| 520 |
// status.isTracingActive() == active); |
| 521 |
// boolean isTracing = isTracing(); |
| 522 |
// assertTrue("Error, tracing active is " + status.isTracingActive() + " but the tracepoint service thinks it is " + isTracing, |
| 523 |
// status.isTracingActive() == isTracing); |
| 524 |
// |
| 525 |
// assertTrue("Wrong number of collected frames. Expected " + frames + " but got " + |
| 526 |
// status.getNumberOfCollectedFrame(), |
| 527 |
// status.getNumberOfCollectedFrame() == frames); |
| 528 |
// assertTrue("Total buffer size should be positive but is " + |
| 529 |
// status.getTotalBufferSize(), |
| 530 |
// status.getTotalBufferSize() > 0); |
| 531 |
// |
| 532 |
// if (fTotalTracingBufferSize == 0) { |
| 533 |
// // Initialize buffer |
| 534 |
// fTotalTracingBufferSize = status.getTotalBufferSize(); |
| 535 |
// } else { |
| 536 |
// assertTrue("Total buffer size changed! Should be " + fTotalTracingBufferSize + |
| 537 |
// " but got " + status.getTotalBufferSize(), |
| 538 |
// status.getTotalBufferSize() == fTotalTracingBufferSize); |
| 539 |
// } |
| 540 |
// |
| 541 |
// assertTrue("Expected stopping reason " + reason + " but got " + status.getStopReason(), |
| 542 |
// status.getStopReason() == reason); |
| 543 |
// assertTrue("Expected stopping bp " + stoppingTracepoint + " but got " + status.getStoppingTracepoint(), |
| 544 |
// status.getStoppingTracepoint() == stoppingTracepoint); |
| 545 |
// } |
| 546 |
// |
| 547 |
// private void checkTraceStatus(boolean supported, boolean active, int frames) throws Throwable { |
| 548 |
// checkTraceStatus(supported, active, frames, null, null); |
| 549 |
// } |
| 550 |
|
| 551 |
// GDB 7.0 does not support fast tracepoints, but GDB 7.1 will |
| 552 |
protected boolean fastTracepointsSupported() { return false; } |
| 553 |
|
| 554 |
private class TracepointData { |
581 |
private class TracepointData { |
| 555 |
String sourceFile; |
582 |
String sourceFile; |
| 556 |
int lineNumber; |
583 |
int lineNumber; |
| 557 |
String condition; |
584 |
String condition; |
| 558 |
int passcount; |
585 |
int passcount; |
| 559 |
boolean enabled; |
586 |
boolean enabled; |
| 560 |
String actions; |
587 |
String commands; |
| 561 |
boolean isFastTp; |
588 |
boolean isFastTp; |
| 562 |
|
589 |
|
| 563 |
public TracepointData(String file, int line, String cond, int pass, boolean isEnabled, String acts, boolean fast) { |
590 |
public TracepointData(String file, int line, String cond, int pass, boolean isEnabled, String cmds, boolean fast) { |
| 564 |
sourceFile = file; |
591 |
sourceFile = file; |
| 565 |
lineNumber = line; |
592 |
lineNumber = line; |
| 566 |
condition = cond; |
593 |
condition = cond; |
| 567 |
passcount = pass; |
594 |
passcount = pass; |
| 568 |
enabled = isEnabled; |
595 |
enabled = isEnabled; |
| 569 |
actions = acts; |
596 |
commands = cmds; |
| 570 |
if (fastTracepointsSupported()) { |
597 |
if (fastTracepointsSupported()) { |
| 571 |
isFastTp = fast; |
598 |
isFastTp = fast; |
| 572 |
} else { |
599 |
} else { |
|
Lines 574-583
Link Here
|
| 574 |
} |
601 |
} |
| 575 |
} |
602 |
} |
| 576 |
} |
603 |
} |
| 577 |
|
604 |
|
| 578 |
private void checkTracepoints(TracepointData[] dataArray) throws Throwable { |
605 |
private void checkTracepoints(TracepointData[] dataArray) throws Throwable { |
| 579 |
int numTracepoints = dataArray.length; |
606 |
int numTracepoints = dataArray.length; |
| 580 |
|
607 |
|
| 581 |
// Fetch the tp list from the backend |
608 |
// Fetch the tp list from the backend |
| 582 |
IBreakpointDMContext[] tracepoints = getBreakpoints(fBreakpointsDmc); |
609 |
IBreakpointDMContext[] tracepoints = getBreakpoints(fBreakpointsDmc); |
| 583 |
assertTrue("expected " + numTracepoints + " breakpoint(s), received " |
610 |
assertTrue("expected " + numTracepoints + " breakpoint(s), received " |
|
Lines 585-591
Link Here
|
| 585 |
|
612 |
|
| 586 |
for (int i=0; i<numTracepoints; i++) { |
613 |
for (int i=0; i<numTracepoints; i++) { |
| 587 |
TracepointData data = dataArray[i]; |
614 |
TracepointData data = dataArray[i]; |
| 588 |
|
615 |
|
| 589 |
// Ensure that the tracepoints were correctly installed |
616 |
// Ensure that the tracepoints were correctly installed |
| 590 |
MIBreakpointDMData tp = (MIBreakpointDMData) getBreakpoint(fTracepoints[i]); |
617 |
MIBreakpointDMData tp = (MIBreakpointDMData) getBreakpoint(fTracepoints[i]); |
| 591 |
assertTrue("tracepoint "+i+" is not a tracepoint but a " + tp.getBreakpointType(), |
618 |
assertTrue("tracepoint "+i+" is not a tracepoint but a " + tp.getBreakpointType(), |
|
Lines 600-615
Link Here
|
| 600 |
tp.getCondition().equals(data.condition)); |
627 |
tp.getCondition().equals(data.condition)); |
| 601 |
assertTrue("tracepoint "+i+" mismatch (wrong pass count) got " + tp.getPassCount(), |
628 |
assertTrue("tracepoint "+i+" mismatch (wrong pass count) got " + tp.getPassCount(), |
| 602 |
tp.getPassCount() == data.passcount); |
629 |
tp.getPassCount() == data.passcount); |
| 603 |
assertTrue("tracepoint "+i+" mismatch (wrong state) got " + tp.isEnabled(), |
630 |
assertTrue("tracepoint "+i+" mismatch (wrong enablement) got " + tp.isEnabled(), |
| 604 |
tp.isEnabled() == data.enabled); |
631 |
tp.isEnabled() == data.enabled); |
| 605 |
assertTrue("tracepoint mismatch (wrong actions) got " + tp.getCommands(), |
632 |
assertTrue("tracepoint "+i+" mismatch (wrong actions) got " + tp.getCommands(), |
| 606 |
tp.getCommands().equals(data.actions)); |
633 |
tp.getCommands().equals(data.commands)); |
| 607 |
|
634 |
|
| 608 |
assertTrue("tracepoint "+i+" mismatch", |
635 |
assertTrue("tracepoint "+i+" mismatch", |
| 609 |
tp.equals((MIBreakpointDMData)getBreakpoint(tracepoints[i]))); |
636 |
tp.equals((MIBreakpointDMData)getBreakpoint(tracepoints[i]))); |
| 610 |
} |
637 |
} |
| 611 |
} |
638 |
} |
| 612 |
|
639 |
|
| 613 |
/** |
640 |
/** |
| 614 |
* This test makes sure that the tracing status is correct when we start. |
641 |
* This test makes sure that the tracing status is correct when we start. |
| 615 |
* It also stores the total buffer size to be used by other tests. |
642 |
* It also stores the total buffer size to be used by other tests. |
|
Lines 618-626
Link Here
|
| 618 |
*/ |
645 |
*/ |
| 619 |
@Test |
646 |
@Test |
| 620 |
public void checkTraceInitialStatus() { |
647 |
public void checkTraceInitialStatus() { |
| 621 |
// checkTraceStatus(true, false, 0); |
648 |
// checkTraceStatus(true, false, 0); |
| 622 |
} |
649 |
} |
| 623 |
|
650 |
|
| 624 |
/** |
651 |
/** |
| 625 |
* This test sets different tracepoints in the program: |
652 |
* This test sets different tracepoints in the program: |
| 626 |
* - using a method address |
653 |
* - using a method address |
|
Lines 630-640
Link Here
|
| 630 |
* It also set a fast tracepoint by |
657 |
* It also set a fast tracepoint by |
| 631 |
*/ |
658 |
*/ |
| 632 |
@Test |
659 |
@Test |
| 633 |
public void testCreateTracepoints() throws Throwable { |
660 |
public void createTracepoints() throws Throwable { |
| 634 |
|
661 |
|
| 635 |
Map<String, Object> attributes = null; |
662 |
Map<String, Object> attributes = null; |
| 636 |
int index = 0; |
663 |
int index = 0; |
| 637 |
|
664 |
|
| 638 |
// First tracepoint (will be a slow tracepoint) |
665 |
// First tracepoint (will be a slow tracepoint) |
| 639 |
attributes = new HashMap<String, Object>(); |
666 |
attributes = new HashMap<String, Object>(); |
| 640 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
667 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
|
Lines 647-654
Link Here
|
| 647 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
674 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 648 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
675 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 649 |
clearEventCounters(); |
676 |
clearEventCounters(); |
| 650 |
|
677 |
|
| 651 |
// Second tracepoint (will be a fast tracepoint) |
678 |
// Second tracepoint (will be a slow tracepoint) |
| 652 |
attributes = new HashMap<String, Object>(); |
679 |
attributes = new HashMap<String, Object>(); |
| 653 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
680 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 654 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
681 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
|
Lines 662-672
Link Here
|
| 662 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
689 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 663 |
clearEventCounters(); |
690 |
clearEventCounters(); |
| 664 |
|
691 |
|
| 665 |
// Third tracepoint (will be a slow tracepoint) |
692 |
// Third tracepoint (will be a fast tracepoint) |
| 666 |
attributes = new HashMap<String, Object>(); |
693 |
attributes = new HashMap<String, Object>(); |
| 667 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
694 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 668 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
695 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 669 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_1); |
696 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_4); |
| 670 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
697 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 671 |
|
698 |
|
| 672 |
waitForBreakpointEvent(); |
699 |
waitForBreakpointEvent(); |
|
Lines 703-725
Link Here
|
| 703 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
730 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 704 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
731 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 705 |
clearEventCounters(); |
732 |
clearEventCounters(); |
| 706 |
|
733 |
|
| 707 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
734 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 708 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, "", false)); |
735 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, NO_COMMANDS, false)); |
| 709 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, "", true)); |
736 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, NO_COMMANDS, false)); |
| 710 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_1, NO_CONDITION, 0, true, "", false)); |
737 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, 0, true, NO_COMMANDS, true)); |
| 711 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, "", true)); |
738 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, NO_COMMANDS, true)); |
| 712 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, "", false)); |
739 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, NO_COMMANDS, false)); |
| 713 |
|
740 |
|
| 714 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
741 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 715 |
} |
742 |
} |
| 716 |
|
743 |
|
| 717 |
/** |
744 |
/** |
| 718 |
* This test sets the different types of tracepoints and then deletes them |
745 |
* This test sets the different types of tracepoints and then deletes them |
| 719 |
*/ |
746 |
*/ |
| 720 |
@Test |
747 |
@Test |
| 721 |
public void testDeleteTracepoints() throws Throwable { |
748 |
public void deleteTracepoints() throws Throwable { |
| 722 |
testCreateTracepoints(); |
749 |
createTracepoints(); |
| 723 |
// Delete all tracepoints |
750 |
// Delete all tracepoints |
| 724 |
for (IBreakpointDMContext tp : fTracepoints) { |
751 |
for (IBreakpointDMContext tp : fTracepoints) { |
| 725 |
if (tp == null) break; |
752 |
if (tp == null) break; |
|
Lines 736-744
Link Here
|
| 736 |
* This test sets the different types of tracepoints and then disables them |
763 |
* This test sets the different types of tracepoints and then disables them |
| 737 |
*/ |
764 |
*/ |
| 738 |
@Test |
765 |
@Test |
| 739 |
public void testDisableTracepoints() throws Throwable { |
766 |
public void disableTracepoints() throws Throwable { |
| 740 |
testCreateTracepoints(); |
767 |
createTracepoints(); |
| 741 |
|
768 |
|
| 742 |
Map<String, Object> delta = new HashMap<String, Object>(); |
769 |
Map<String, Object> delta = new HashMap<String, Object>(); |
| 743 |
delta.put(MIBreakpoints.IS_ENABLED, false); |
770 |
delta.put(MIBreakpoints.IS_ENABLED, false); |
| 744 |
// Disable all tracepoints |
771 |
// Disable all tracepoints |
|
Lines 748-759
Link Here
|
| 748 |
} |
775 |
} |
| 749 |
|
776 |
|
| 750 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
777 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 751 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, false, "", false)); |
778 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, false, NO_COMMANDS, false)); |
| 752 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, false, "", true)); |
779 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, false, NO_COMMANDS, false)); |
| 753 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_1, NO_CONDITION, 0, false, "", false)); |
780 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, 0, false, NO_COMMANDS, true)); |
| 754 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, false, "", true)); |
781 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, false, NO_COMMANDS, true)); |
| 755 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, false, "", false)); |
782 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, false, NO_COMMANDS, false)); |
| 756 |
|
783 |
|
| 757 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
784 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 758 |
} |
785 |
} |
| 759 |
|
786 |
|
|
Lines 761-769
Link Here
|
| 761 |
* This test sets, disables the different types of tracepoints and then enables them |
788 |
* This test sets, disables the different types of tracepoints and then enables them |
| 762 |
*/ |
789 |
*/ |
| 763 |
@Test |
790 |
@Test |
| 764 |
public void testEnableTracepoints() throws Throwable { |
791 |
public void enableTracepoints() throws Throwable { |
| 765 |
testDisableTracepoints(); |
792 |
disableTracepoints(); |
| 766 |
|
793 |
|
| 767 |
Map<String, Object> delta = new HashMap<String, Object>(); |
794 |
Map<String, Object> delta = new HashMap<String, Object>(); |
| 768 |
delta.put(MIBreakpoints.IS_ENABLED, true); |
795 |
delta.put(MIBreakpoints.IS_ENABLED, true); |
| 769 |
// Enable all tracepoints |
796 |
// Enable all tracepoints |
|
Lines 773-783
Link Here
|
| 773 |
} |
800 |
} |
| 774 |
|
801 |
|
| 775 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
802 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 776 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, "", false)); |
803 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, NO_COMMANDS, false)); |
| 777 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, "", true)); |
804 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, NO_COMMANDS, false)); |
| 778 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_1, NO_CONDITION, 0, true, "", false)); |
805 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, 0, true, NO_COMMANDS, true)); |
| 779 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, "", true)); |
806 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, NO_COMMANDS, true)); |
| 780 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, "", false)); |
807 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, NO_COMMANDS, false)); |
| 781 |
|
808 |
|
| 782 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
809 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 783 |
} |
810 |
} |
|
Lines 786-794
Link Here
|
| 786 |
* This test sets the different types of tracepoints and then sets their passcount |
813 |
* This test sets the different types of tracepoints and then sets their passcount |
| 787 |
*/ |
814 |
*/ |
| 788 |
@Test |
815 |
@Test |
| 789 |
public void testTracepointPasscount() throws Throwable { |
816 |
public void tracepointPasscount() throws Throwable { |
| 790 |
testCreateTracepoints(); |
817 |
createTracepoints(); |
| 791 |
|
818 |
|
| 792 |
Map<String, Object> delta = new HashMap<String, Object>(); |
819 |
Map<String, Object> delta = new HashMap<String, Object>(); |
| 793 |
// Set passcount for all tracepoints |
820 |
// Set passcount for all tracepoints |
| 794 |
for (int i=0; i<fTracepoints.length; i++) { |
821 |
for (int i=0; i<fTracepoints.length; i++) { |
|
Lines 799-1056
Link Here
|
| 799 |
} |
826 |
} |
| 800 |
|
827 |
|
| 801 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
828 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 802 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, PASS_COUNTS[0], true, "", false)); |
829 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, PASS_COUNTS[0], true, NO_COMMANDS, false)); |
| 803 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, PASS_COUNTS[1], true, "", true)); |
830 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, PASS_COUNTS[1], true, NO_COMMANDS, false)); |
| 804 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_1, NO_CONDITION, PASS_COUNTS[2], true, "", false)); |
831 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, PASS_COUNTS[2], true, NO_COMMANDS, true)); |
| 805 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, PASS_COUNTS[3], true, "", true)); |
832 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, PASS_COUNTS[3], true, NO_COMMANDS, true)); |
| 806 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, PASS_COUNTS[4], true, "", false)); |
833 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, PASS_COUNTS[4], true, NO_COMMANDS, false)); |
| 807 |
|
834 |
|
| 808 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
835 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 809 |
} |
836 |
} |
| 810 |
|
837 |
|
| 811 |
/** |
838 |
/** |
| 812 |
* This test sets a tracepoint and then gives it a condition |
839 |
* This test sets the different types of tracepoints and then sets some conditions |
| 813 |
*/ |
840 |
*/ |
| 814 |
//@Test |
841 |
@Test |
| 815 |
public void testTracepointCondition() throws Throwable { |
842 |
public void tracepointCondition() throws Throwable { |
| 816 |
// Use trace state variables and stuff |
843 |
createTracepoints(); |
| 817 |
} |
|
|
| 818 |
|
| 819 |
|
844 |
|
| 820 |
// private void testActions(String[] actions) throws Throwable { |
845 |
Map<String, Object> delta = new HashMap<String, Object>(); |
| 821 |
// Map<String, Object> delta = new HashMap<String, Object>(); |
846 |
// Set conditions for all tracepoints |
| 822 |
// ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
847 |
for (int i=0; i<fTracepoints.length; i++) { |
| 823 |
// |
848 |
if (fTracepoints[i] == null) break; |
| 824 |
// for (int i=0; i<actions.length; i++) { |
849 |
if (CONDITIONS[i].equals(NO_CONDITION)) continue; |
| 825 |
// delta.put(MIBreakpoints.COMMANDS, actions[i]); |
850 |
delta.put(MIBreakpoints.CONDITION, CONDITIONS[i]); |
| 826 |
// updateBreakpoint(fTracepoints[i], delta); |
851 |
updateBreakpoint(fTracepoints[i], delta); |
| 827 |
// dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, actions[i], false)); |
852 |
} |
| 828 |
// } |
853 |
|
| 829 |
// |
854 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 830 |
// checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
855 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, CONDITIONS[0], 0, true, NO_COMMANDS, false)); |
| 831 |
// } |
856 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, CONDITIONS[1], 0, true, NO_COMMANDS, false)); |
| 832 |
// |
857 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, CONDITIONS[2], 0, true, NO_COMMANDS, true)); |
| 833 |
// /** |
858 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, CONDITIONS[3], 0, true, NO_COMMANDS, true)); |
| 834 |
// * This test sets the different types of tracepoints and then sets some collect actions |
859 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, CONDITIONS[4], 0, true, NO_COMMANDS, false)); |
| 835 |
// */ |
860 |
|
| 836 |
// @Test |
861 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 837 |
// public void testCollectActions() throws Throwable { |
862 |
|
| 838 |
// final String ACTIONS1 = COLLECT_ACTION_1.getName()+","+COLLECT_ACTION_2.getName()+","+COLLECT_ACTION_3.getName(); |
863 |
} |
| 839 |
// final String ACTIONS2 = COLLECT_ACTION_1.getName()+","+COLLECT_ACTION_3.getName(); |
864 |
|
| 840 |
// final String ACTIONS3 = COLLECT_ACTION_3.getName(); |
865 |
/** |
| 841 |
// |
866 |
* This test sets the different types of tracepoints and then sets some actions |
| 842 |
// testCreateTracepoints(); |
867 |
*/ |
| 843 |
// testActions(new String[] {ACTIONS1, ACTIONS2, ACTIONS3, ""}); |
868 |
@Test |
| 844 |
// } |
869 |
public void tracepointActions() throws Throwable { |
| 845 |
// |
870 |
createTracepoints(); |
| 846 |
// /** |
871 |
|
| 847 |
// * This test sets the different types of tracepoints and then sets some eval actions |
872 |
Map<String, Object> delta = new HashMap<String, Object>(); |
| 848 |
// */ |
873 |
// Set conditions for all tracepoints |
| 849 |
// @Test |
874 |
for (int i=0; i<fTracepoints.length; i++) { |
| 850 |
// public void testEvalActions() throws Throwable { |
875 |
if (fTracepoints[i] == null) break; |
| 851 |
// final String ACTIONS1 = EVAL_ACTION_1.getName()+","+EVAL_ACTION_2.getName()+","+EVAL_ACTION_3.getName(); |
876 |
if (COLLECT_ACTIONS[i].equals(NO_COMMANDS)) continue; |
| 852 |
// final String ACTIONS2 = EVAL_ACTION_1.getName()+","+EVAL_ACTION_3.getName(); |
877 |
delta.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[i].getName()); |
| 853 |
// final String ACTIONS3 = EVAL_ACTION_3.getName(); |
878 |
updateBreakpoint(fTracepoints[i], delta); |
| 854 |
// |
879 |
} |
| 855 |
// testCreateTracepoints(); |
880 |
|
| 856 |
// testActions(new String[] {ACTIONS1, ACTIONS2, ACTIONS3, ""}); |
881 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 857 |
// } |
882 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, COLLECT_ACTIONS[0].toString(), false)); |
| 858 |
// |
883 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, COLLECT_ACTIONS[1].toString(), false)); |
| 859 |
// /** |
884 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, 0, true, COLLECT_ACTIONS[2].toString(), true)); |
| 860 |
// * This test sets the different types of tracepoints and then sets some while-stepping actions |
885 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, COLLECT_ACTIONS[3].toString(), true)); |
| 861 |
// */ |
886 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, COLLECT_ACTIONS[4].toString(), false)); |
| 862 |
// //@Test |
887 |
|
| 863 |
// public void testSteppingActions() throws Throwable { |
888 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 864 |
//// final String ACTIONS1 = STEPPING_ACTION_1.getName()+","+STEPPING_ACTION_2.getName()+","+STEPPING_ACTION_3.getName(); |
889 |
|
| 865 |
//// final String ACTIONS2 = STEPPING_ACTION_1.getName()+","+STEPPING_ACTION_3.getName(); |
890 |
} |
| 866 |
//// final String ACTIONS3 = STEPPING_ACTION_3.getName(); |
891 |
|
| 867 |
//// |
892 |
/** |
| 868 |
//// testCreateTracepoints(); |
893 |
* This test creates a tracepoint that starts disabled |
| 869 |
//// testActions(new String[] {ACTIONS1, ACTIONS2, ACTIONS3, ""}); |
894 |
*/ |
| 870 |
// } |
895 |
@Test |
| 871 |
// |
896 |
public void createTracepointDisabled() throws Throwable { |
| 872 |
// /** |
897 |
Map<String, Object> attributes = null; |
| 873 |
// * This test sets the different types of tracepoints and then sets a mix of different |
898 |
int index = 0; |
| 874 |
// * tracepoint actions |
899 |
|
| 875 |
// */ |
900 |
// First tracepoint will be a slow tracepoint |
| 876 |
// //@Test |
901 |
attributes = new HashMap<String, Object>(); |
| 877 |
// public void testMixedActions() throws Throwable { |
902 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 878 |
//// final String ACTIONS1 = COLLECT_ACTION_1.getName() + "," + |
903 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 879 |
//// EVAL_ACTION_2.getName() + "," + |
904 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2); |
| 880 |
//// STEPPING_ACTION_3.getName(); |
905 |
attributes.put(MIBreakpoints.IS_ENABLED, false); |
| 881 |
//// final String ACTIONS2 = STEPPING_ACTION_1.getName() + "," + |
906 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 882 |
//// COLLECT_ACTION_2.getName() + "," + |
907 |
|
| 883 |
//// EVAL_ACTION_1.getName() + "," + |
908 |
waitForBreakpointEvent(); |
| 884 |
//// COLLECT_ACTION_3.getName() + "," + |
909 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 885 |
//// EVAL_ACTION_2.getName() + "," + |
910 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 886 |
//// EVAL_ACTION_3.getName(); |
911 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 887 |
//// final String ACTIONS3 = EVAL_ACTION_3.getName() + "," + |
912 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 888 |
//// COLLECT_ACTION_1.getName() + "," + |
913 |
clearEventCounters(); |
| 889 |
//// EVAL_ACTION_2.getName() + "," + |
914 |
|
| 890 |
//// STEPPING_ACTION_3.getName(); |
915 |
// Second tracepoint will be a fast tracepoint |
| 891 |
//// |
916 |
attributes = new HashMap<String, Object>(); |
| 892 |
//// testCreateTracepoints(); |
917 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 893 |
//// testActions(new String[] {ACTIONS1, ACTIONS2, ACTIONS3, ""}); |
918 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 894 |
// } |
919 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1); |
| 895 |
// |
920 |
attributes.put(MIBreakpoints.IS_ENABLED, false); |
| 896 |
// /** |
921 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 897 |
// * This test sets the different types of tracepoints and then sets some default collect actions |
922 |
|
| 898 |
// */ |
923 |
waitForBreakpointEvent(); |
| 899 |
// //@Test |
924 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 900 |
// public void testDefaultCollectAction() throws Throwable { |
925 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 901 |
// testCreateTracepoints(); |
926 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 902 |
// } |
927 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 903 |
// |
928 |
clearEventCounters(); |
| 904 |
// // ********************************************************************* |
929 |
|
| 905 |
// // Below are the tests for the control of tracing |
930 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 906 |
// // ********************************************************************* |
931 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, false, NO_COMMANDS, false)); |
| 907 |
// |
932 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, false, NO_COMMANDS, true)); |
| 908 |
// /** |
933 |
|
| 909 |
// * This test sets different tracepoints in the program: |
934 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 910 |
// * - using a filename and line number |
935 |
} |
| 911 |
// * - using a method name |
936 |
|
| 912 |
// * - using a method address |
937 |
/** |
| 913 |
// * |
938 |
* This test creates a tracepoint that starts with a passcount |
| 914 |
// * and confirms they are installed when tracing starts |
939 |
*/ |
| 915 |
// */ |
940 |
@Test |
| 916 |
// @Test |
941 |
public void createTracepointWithPasscount() throws Throwable { |
| 917 |
// public void testCreateAndRunTracepoints() throws Throwable { |
942 |
Map<String, Object> attributes = null; |
| 918 |
// testCreateTracepoints(); |
943 |
int index = 0; |
| 919 |
// startTracing(); |
944 |
|
| 920 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
945 |
// First tracepoint will be a slow tracepoint |
| 921 |
// checkTraceStatus(true, true, TOTAL_FRAMES_TO_BE_COLLECTED); |
946 |
attributes = new HashMap<String, Object>(); |
| 922 |
// stopTracing(); |
947 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 923 |
// checkTraceStatus(true, false, TOTAL_FRAMES_TO_BE_COLLECTED); |
948 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 924 |
// } |
949 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2); |
| 925 |
// |
950 |
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[0]); |
| 926 |
// /** |
951 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 927 |
// * This test sets the different types of tracepoints and then deletes them |
952 |
|
| 928 |
// * and confirms they are not installed when tracing starts |
953 |
waitForBreakpointEvent(); |
| 929 |
// */ |
954 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 930 |
// @Test |
955 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 931 |
// public void testDeleteAndRunTracepoints() throws Throwable { |
956 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 932 |
// testDeleteTracepoints(); |
957 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 933 |
// startTracing("No tracepoints available to download"); |
958 |
clearEventCounters(); |
| 934 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
959 |
|
| 935 |
// checkTraceStatus(true, false, 0); |
960 |
// Second tracepoint will be a fast tracepoint |
| 936 |
// } |
961 |
attributes = new HashMap<String, Object>(); |
| 937 |
// |
962 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 938 |
// /** |
963 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 939 |
// * This test sets the different types of tracepoints and then disables them |
964 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1); |
| 940 |
// * and confirms they are not hit when tracing starts |
965 |
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[1]); |
| 941 |
// */ |
966 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 942 |
// @Test |
967 |
|
| 943 |
// public void testDisableAndRunTracepoints() throws Throwable { |
968 |
waitForBreakpointEvent(); |
| 944 |
// testDisableTracepoints(); |
969 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 945 |
// startTracing("None of the downloadable tracepoints enabled"); |
970 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 946 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
971 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 947 |
// checkTraceStatus(true, false, 0); |
972 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 948 |
// } |
973 |
clearEventCounters(); |
| 949 |
// |
974 |
|
| 950 |
// /** |
975 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 951 |
// * This test sets, disables the different types of tracepoints and then enables them |
976 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, PASS_COUNTS[0], true, NO_COMMANDS, false)); |
| 952 |
// * and confirms they are hit when tracing starts |
977 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, PASS_COUNTS[1], true, NO_COMMANDS, true)); |
| 953 |
// */ |
978 |
|
| 954 |
// @Test |
979 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 955 |
// public void testEnableAndRunTracepoints() throws Throwable { |
980 |
} |
| 956 |
// testEnableTracepoints(); |
981 |
|
| 957 |
// startTracing(); |
982 |
/** |
| 958 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
983 |
* This test creates a tracepoint that starts with a condition |
| 959 |
// checkTraceStatus(true, true, TOTAL_FRAMES_TO_BE_COLLECTED); |
984 |
*/ |
| 960 |
// stopTracing(); |
985 |
@Test |
| 961 |
// checkTraceStatus(true, false, TOTAL_FRAMES_TO_BE_COLLECTED); |
986 |
public void createTracepointWithCondition() throws Throwable { |
| 962 |
// } |
987 |
Map<String, Object> attributes = null; |
| 963 |
// |
988 |
int index = 0; |
| 964 |
// /** |
989 |
|
| 965 |
// * This test sets the different types of tracepoints and then sets their passcount |
990 |
// First tracepoint will be a slow tracepoint |
| 966 |
// * and confirms the passcount is respected |
991 |
attributes = new HashMap<String, Object>(); |
| 967 |
// */ |
992 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 968 |
// @Test |
993 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 969 |
// public void testTracepointPasscountAndRun1() throws Throwable { |
994 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2); |
| 970 |
// testTracepointPasscount(); |
995 |
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[0]); |
| 971 |
// startTracing(); |
996 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 972 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
997 |
|
| 973 |
// |
998 |
waitForBreakpointEvent(); |
| 974 |
// checkTraceStatus(true, false, |
999 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 975 |
// 1 + 1 + 10 + 1 + PASS_COUNTS[4], |
1000 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 976 |
// STOP_REASON_ENUM.PASSCOUNT, 6); |
1001 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 977 |
// } |
1002 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 978 |
// |
1003 |
clearEventCounters(); |
| 979 |
// /** |
1004 |
|
| 980 |
// * This test sets the passcount of the a tracepoint that is hit before some |
1005 |
// Second tracepoint will be a fast tracepoint |
| 981 |
// * other tracepoints are hit, to confirm tracing really stops. |
1006 |
attributes = new HashMap<String, Object>(); |
| 982 |
// */ |
1007 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 983 |
// @Test |
1008 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 984 |
// public void testTracepointPasscountAndRun2() throws Throwable { |
1009 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1); |
| 985 |
// testTracepointPasscount(); |
1010 |
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[1]); |
| 986 |
// |
1011 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 987 |
// // Set the passcount of the forth tp to make it stop the tracing |
1012 |
|
| 988 |
// Map<String, Object> delta = new HashMap<String, Object>(); |
1013 |
waitForBreakpointEvent(); |
| 989 |
// delta.put(MIBreakpoints.IGNORE_COUNT, 1); |
1014 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 990 |
// updateBreakpoint(fTracepoints[3], delta); |
1015 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 991 |
// |
1016 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 992 |
// startTracing(); |
1017 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 993 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
1018 |
clearEventCounters(); |
| 994 |
// |
1019 |
|
| 995 |
// checkTraceStatus(true, false, |
1020 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 996 |
// 1 + 1 + 10 + 1, |
1021 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, CONDITIONS[0], 0, true, NO_COMMANDS, false)); |
| 997 |
// STOP_REASON_ENUM.PASSCOUNT, 5); |
1022 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, CONDITIONS[1], 0, true, NO_COMMANDS, true)); |
| 998 |
// } |
1023 |
|
| 999 |
// |
1024 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 1000 |
// /** |
1025 |
} |
| 1001 |
// * This test sets a tracepoint and then gives it a condition |
1026 |
|
| 1002 |
// * and confirms the condition is respected |
1027 |
/** |
| 1003 |
// */ |
1028 |
* This test creates tracepoints that start a command |
| 1004 |
// //@Test |
1029 |
*/ |
| 1005 |
// public void testTracepointConditionAndRun() throws Throwable { |
1030 |
@Test |
| 1006 |
// // Use trace state variables and stuff |
1031 |
public void createTracepointWithCommand() throws Throwable { |
| 1007 |
// } |
1032 |
Map<String, Object> attributes = null; |
| 1008 |
// |
1033 |
int index = 0; |
| 1009 |
// /** |
1034 |
|
| 1010 |
// * This test sets the different types of tracepoints and then sets some collect actions |
1035 |
// First tracepoint will be a slow tracepoint |
| 1011 |
// * and confirms the proper information is collected |
1036 |
attributes = new HashMap<String, Object>(); |
| 1012 |
// */ |
1037 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 1013 |
// //@Test |
1038 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 1014 |
// public void testCollectActionsAndRun() throws Throwable { |
1039 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2); |
| 1015 |
// testCreateTracepoints(); |
1040 |
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[0].getName()); |
| 1016 |
// } |
1041 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 1017 |
// |
1042 |
|
| 1018 |
// /** |
1043 |
waitForBreakpointEvent(); |
| 1019 |
// * This test sets the different types of tracepoints and then sets some eval actions |
1044 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 1020 |
// * and confirms the trace variables are properly updated |
1045 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 1021 |
// */ |
1046 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 1022 |
// //@Test |
1047 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 1023 |
// public void testEvalActionsAndRun() throws Throwable { |
1048 |
clearEventCounters(); |
| 1024 |
// testCreateTracepoints(); |
1049 |
|
| 1025 |
// } |
1050 |
// Second tracepoint will be a fast tracepoint |
| 1026 |
// |
1051 |
attributes = new HashMap<String, Object>(); |
| 1027 |
// /** |
1052 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 1028 |
// * This test sets the different types of tracepoints and then sets some while-stepping actions |
1053 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 1029 |
// * and confirms the proper information is collected |
1054 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1); |
| 1030 |
// */ |
1055 |
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[1].getName()); |
| 1031 |
// //@Test |
1056 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 1032 |
// public void testSteppingActionsAndRun() throws Throwable { |
1057 |
|
| 1033 |
// testCreateTracepoints(); |
1058 |
waitForBreakpointEvent(); |
| 1034 |
// } |
1059 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 1035 |
// |
1060 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 1036 |
// /** |
1061 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 1037 |
// * This test sets the different types of tracepoints and then sets a mix of different |
1062 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 1038 |
// * tracepoint actions and confirms the proper information is collected |
1063 |
clearEventCounters(); |
| 1039 |
// */ |
1064 |
|
| 1040 |
// //@Test |
1065 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 1041 |
// public void testMixedActionsAndRun() throws Throwable { |
1066 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, COLLECT_ACTIONS[0].toString(), false)); |
| 1042 |
// testCreateTracepoints(); |
1067 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, COLLECT_ACTIONS[1].toString(), true)); |
| 1043 |
// } |
1068 |
|
| 1044 |
// |
1069 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 1045 |
// /** |
1070 |
} |
| 1046 |
// * This test sets the different types of tracepoints and then sets some default collect actions |
1071 |
|
| 1047 |
// * and confirms the proper information is collected |
1072 |
/** |
| 1048 |
// */ |
1073 |
* This test creates tracepoints that start with more than one command |
| 1049 |
// //@Test |
1074 |
*/ |
| 1050 |
// public void testDefaultCollectActionAndRun() throws Throwable { |
1075 |
@Test |
| 1051 |
// testCreateTracepoints(); |
1076 |
public void createTracepointWithMultipleCommands() throws Throwable { |
| 1052 |
// } |
1077 |
Map<String, Object> attributes = null; |
| 1053 |
// |
1078 |
int index = 0; |
| 1054 |
|
1079 |
|
|
|
1080 |
// First tracepoint will be a slow tracepoint |
| 1081 |
attributes = new HashMap<String, Object>(); |
| 1082 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 1083 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 1084 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2); |
| 1085 |
String commandsNames1 = COLLECT_ACTIONS[0].getName() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER + |
| 1086 |
COLLECT_ACTIONS[1].getName() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER + |
| 1087 |
COLLECT_ACTIONS[2].getName(); |
| 1088 |
String commandsResult1 = COLLECT_ACTIONS[0].toString() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER + |
| 1089 |
COLLECT_ACTIONS[1].toString() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER + |
| 1090 |
COLLECT_ACTIONS[2].toString(); |
| 1091 |
attributes.put(MIBreakpoints.COMMANDS, commandsNames1); |
| 1092 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 1093 |
|
| 1094 |
waitForBreakpointEvent(); |
| 1095 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 1096 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 1097 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 1098 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 1099 |
clearEventCounters(); |
| 1100 |
|
| 1101 |
// Second tracepoint will be a fast tracepoint |
| 1102 |
attributes = new HashMap<String, Object>(); |
| 1103 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 1104 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 1105 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1); |
| 1106 |
String commandsNames2 = COLLECT_ACTIONS[2].getName() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER + |
| 1107 |
COLLECT_ACTIONS[2].getName() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER + |
| 1108 |
COLLECT_ACTIONS[1].getName(); |
| 1109 |
String commandsResult2 = COLLECT_ACTIONS[2].toString() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER + |
| 1110 |
COLLECT_ACTIONS[2].toString() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER + |
| 1111 |
COLLECT_ACTIONS[1].toString(); |
| 1112 |
attributes.put(MIBreakpoints.COMMANDS, commandsNames2); |
| 1113 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 1114 |
|
| 1115 |
waitForBreakpointEvent(); |
| 1116 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 1117 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 1118 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 1119 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 1120 |
clearEventCounters(); |
| 1121 |
|
| 1122 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 1123 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, commandsResult1, false)); |
| 1124 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, commandsResult2, true)); |
| 1125 |
|
| 1126 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 1127 |
} |
| 1128 |
|
| 1129 |
/** |
| 1130 |
* This test creates an enabled tracepoint that starts with commands, condition and passcount |
| 1131 |
*/ |
| 1132 |
@Test |
| 1133 |
public void createTracepointEnabledWithCommandsConditionPasscount() throws Throwable { |
| 1134 |
Map<String, Object> attributes = null; |
| 1135 |
int index = 0; |
| 1136 |
|
| 1137 |
// First tracepoint will be a slow tracepoint |
| 1138 |
attributes = new HashMap<String, Object>(); |
| 1139 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 1140 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 1141 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2); |
| 1142 |
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[0].getName()); |
| 1143 |
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[0]); |
| 1144 |
attributes.put(MIBreakpoints.IS_ENABLED, true); |
| 1145 |
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[0]); |
| 1146 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 1147 |
|
| 1148 |
waitForBreakpointEvent(); |
| 1149 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 1150 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 1151 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 1152 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 1153 |
clearEventCounters(); |
| 1154 |
|
| 1155 |
// Second tracepoint will be a fast tracepoint |
| 1156 |
attributes = new HashMap<String, Object>(); |
| 1157 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 1158 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 1159 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1); |
| 1160 |
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[1].getName()); |
| 1161 |
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[1]); |
| 1162 |
attributes.put(MIBreakpoints.IS_ENABLED, true); |
| 1163 |
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[1]); |
| 1164 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 1165 |
|
| 1166 |
waitForBreakpointEvent(); |
| 1167 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 1168 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 1169 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 1170 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 1171 |
clearEventCounters(); |
| 1172 |
|
| 1173 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 1174 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, CONDITIONS[0], PASS_COUNTS[0], true, COLLECT_ACTIONS[0].toString(), false)); |
| 1175 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, CONDITIONS[1], PASS_COUNTS[1], true, COLLECT_ACTIONS[1].toString(), true)); |
| 1176 |
|
| 1177 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 1178 |
} |
| 1179 |
|
| 1180 |
/** |
| 1181 |
* This test creates a disabled tracepoint that starts with commands, condition and passcount |
| 1182 |
*/ |
| 1183 |
@Test |
| 1184 |
public void createTracepointDisabledWithCommandsConditionPasscount() throws Throwable { |
| 1185 |
Map<String, Object> attributes = null; |
| 1186 |
int index = 0; |
| 1187 |
|
| 1188 |
// First tracepoint will be a slow tracepoint |
| 1189 |
attributes = new HashMap<String, Object>(); |
| 1190 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 1191 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 1192 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2); |
| 1193 |
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[0].getName()); |
| 1194 |
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[0]); |
| 1195 |
attributes.put(MIBreakpoints.IS_ENABLED, false); |
| 1196 |
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[0]); |
| 1197 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 1198 |
|
| 1199 |
waitForBreakpointEvent(); |
| 1200 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 1201 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 1202 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 1203 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 1204 |
clearEventCounters(); |
| 1205 |
|
| 1206 |
// Second tracepoint will be a fast tracepoint |
| 1207 |
attributes = new HashMap<String, Object>(); |
| 1208 |
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); |
| 1209 |
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); |
| 1210 |
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1); |
| 1211 |
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[1].getName()); |
| 1212 |
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[1]); |
| 1213 |
attributes.put(MIBreakpoints.IS_ENABLED, false); |
| 1214 |
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[1]); |
| 1215 |
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes); |
| 1216 |
|
| 1217 |
waitForBreakpointEvent(); |
| 1218 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received " |
| 1219 |
+ fBreakpointEventCount, fBreakpointEventCount == 1); |
| 1220 |
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received " |
| 1221 |
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1); |
| 1222 |
clearEventCounters(); |
| 1223 |
|
| 1224 |
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>(); |
| 1225 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, CONDITIONS[0], PASS_COUNTS[0], false, COLLECT_ACTIONS[0].toString(), false)); |
| 1226 |
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, CONDITIONS[1], PASS_COUNTS[1], false, COLLECT_ACTIONS[1].toString(), true)); |
| 1227 |
|
| 1228 |
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()])); |
| 1229 |
} |
| 1230 |
|
| 1231 |
// /** |
| 1232 |
// * This test sets the different types of tracepoints and then sets some eval actions |
| 1233 |
// */ |
| 1234 |
// @Test |
| 1235 |
// public void testEvalActions() throws Throwable { |
| 1236 |
// final String ACTIONS1 = EVAL_ACTION_1.getName()+","+EVAL_ACTION_2.getName()+","+EVAL_ACTION_3.getName(); |
| 1237 |
// final String ACTIONS2 = EVAL_ACTION_1.getName()+","+EVAL_ACTION_3.getName(); |
| 1238 |
// final String ACTIONS3 = EVAL_ACTION_3.getName(); |
| 1239 |
// |
| 1240 |
// testCreateTracepoints(); |
| 1241 |
// testActions(new String[] {ACTIONS1, ACTIONS2, ACTIONS3, ""}); |
| 1242 |
// } |
| 1243 |
// |
| 1244 |
// /** |
| 1245 |
// * This test sets the different types of tracepoints and then sets some while-stepping actions |
| 1246 |
// */ |
| 1247 |
// //@Test |
| 1248 |
// public void testSteppingActions() throws Throwable { |
| 1249 |
//// final String ACTIONS1 = STEPPING_ACTION_1.getName()+","+STEPPING_ACTION_2.getName()+","+STEPPING_ACTION_3.getName(); |
| 1250 |
//// final String ACTIONS2 = STEPPING_ACTION_1.getName()+","+STEPPING_ACTION_3.getName(); |
| 1251 |
//// final String ACTIONS3 = STEPPING_ACTION_3.getName(); |
| 1252 |
//// |
| 1253 |
//// testCreateTracepoints(); |
| 1254 |
//// testActions(new String[] {ACTIONS1, ACTIONS2, ACTIONS3, ""}); |
| 1255 |
// } |
| 1256 |
// |
| 1257 |
// /** |
| 1258 |
// * This test sets the different types of tracepoints and then sets a mix of different |
| 1259 |
// * tracepoint actions |
| 1260 |
// */ |
| 1261 |
// //@Test |
| 1262 |
// public void testMixedActions() throws Throwable { |
| 1263 |
//// final String ACTIONS1 = COLLECT_ACTION_1.getName() + "," + |
| 1264 |
//// EVAL_ACTION_2.getName() + "," + |
| 1265 |
//// STEPPING_ACTION_3.getName(); |
| 1266 |
//// final String ACTIONS2 = STEPPING_ACTION_1.getName() + "," + |
| 1267 |
//// COLLECT_ACTION_2.getName() + "," + |
| 1268 |
//// EVAL_ACTION_1.getName() + "," + |
| 1269 |
//// COLLECT_ACTION_3.getName() + "," + |
| 1270 |
//// EVAL_ACTION_2.getName() + "," + |
| 1271 |
//// EVAL_ACTION_3.getName(); |
| 1272 |
//// final String ACTIONS3 = EVAL_ACTION_3.getName() + "," + |
| 1273 |
//// COLLECT_ACTION_1.getName() + "," + |
| 1274 |
//// EVAL_ACTION_2.getName() + "," + |
| 1275 |
//// STEPPING_ACTION_3.getName(); |
| 1276 |
//// |
| 1277 |
//// testCreateTracepoints(); |
| 1278 |
//// testActions(new String[] {ACTIONS1, ACTIONS2, ACTIONS3, ""}); |
| 1279 |
// } |
| 1280 |
// |
| 1281 |
// /** |
| 1282 |
// * This test sets the different types of tracepoints and then sets some default collect actions |
| 1283 |
// */ |
| 1284 |
// //@Test |
| 1285 |
// public void testDefaultCollectAction() throws Throwable { |
| 1286 |
// testCreateTracepoints(); |
| 1287 |
// } |
| 1288 |
// |
| 1289 |
// // ********************************************************************* |
| 1290 |
// // Below are the tests for the control of tracing |
| 1291 |
// // ********************************************************************* |
| 1292 |
// |
| 1293 |
// /** |
| 1294 |
// * This test sets different tracepoints in the program: |
| 1295 |
// * - using a filename and line number |
| 1296 |
// * - using a method name |
| 1297 |
// * - using a method address |
| 1298 |
// * |
| 1299 |
// * and confirms they are installed when tracing starts |
| 1300 |
// */ |
| 1301 |
// @Test |
| 1302 |
// public void testCreateAndRunTracepoints() throws Throwable { |
| 1303 |
// testCreateTracepoints(); |
| 1304 |
// startTracing(); |
| 1305 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
| 1306 |
// checkTraceStatus(true, true, TOTAL_FRAMES_TO_BE_COLLECTED); |
| 1307 |
// stopTracing(); |
| 1308 |
// checkTraceStatus(true, false, TOTAL_FRAMES_TO_BE_COLLECTED); |
| 1309 |
// } |
| 1310 |
// |
| 1311 |
// /** |
| 1312 |
// * This test sets the different types of tracepoints and then deletes them |
| 1313 |
// * and confirms they are not installed when tracing starts |
| 1314 |
// */ |
| 1315 |
// @Test |
| 1316 |
// public void testDeleteAndRunTracepoints() throws Throwable { |
| 1317 |
// testDeleteTracepoints(); |
| 1318 |
// startTracing("No tracepoints available to download"); |
| 1319 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
| 1320 |
// checkTraceStatus(true, false, 0); |
| 1321 |
// } |
| 1322 |
// |
| 1323 |
// /** |
| 1324 |
// * This test sets the different types of tracepoints and then disables them |
| 1325 |
// * and confirms they are not hit when tracing starts |
| 1326 |
// */ |
| 1327 |
// @Test |
| 1328 |
// public void testDisableAndRunTracepoints() throws Throwable { |
| 1329 |
// testDisableTracepoints(); |
| 1330 |
// startTracing("None of the downloadable tracepoints enabled"); |
| 1331 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
| 1332 |
// checkTraceStatus(true, false, 0); |
| 1333 |
// } |
| 1334 |
// |
| 1335 |
// /** |
| 1336 |
// * This test sets, disables the different types of tracepoints and then enables them |
| 1337 |
// * and confirms they are hit when tracing starts |
| 1338 |
// */ |
| 1339 |
// @Test |
| 1340 |
// public void testEnableAndRunTracepoints() throws Throwable { |
| 1341 |
// testEnableTracepoints(); |
| 1342 |
// startTracing(); |
| 1343 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
| 1344 |
// checkTraceStatus(true, true, TOTAL_FRAMES_TO_BE_COLLECTED); |
| 1345 |
// stopTracing(); |
| 1346 |
// checkTraceStatus(true, false, TOTAL_FRAMES_TO_BE_COLLECTED); |
| 1347 |
// } |
| 1348 |
// |
| 1349 |
// /** |
| 1350 |
// * This test sets the different types of tracepoints and then sets their passcount |
| 1351 |
// * and confirms the passcount is respected |
| 1352 |
// */ |
| 1353 |
// @Test |
| 1354 |
// public void testTracepointPasscountAndRun1() throws Throwable { |
| 1355 |
// testTracepointPasscount(); |
| 1356 |
// startTracing(); |
| 1357 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
| 1358 |
// |
| 1359 |
// checkTraceStatus(true, false, |
| 1360 |
// 1 + 1 + 10 + 1 + PASS_COUNTS[4], |
| 1361 |
// STOP_REASON_ENUM.PASSCOUNT, 6); |
| 1362 |
// } |
| 1363 |
// |
| 1364 |
// /** |
| 1365 |
// * This test sets the passcount of the a tracepoint that is hit before some |
| 1366 |
// * other tracepoints are hit, to confirm tracing really stops. |
| 1367 |
// */ |
| 1368 |
// @Test |
| 1369 |
// public void testTracepointPasscountAndRun2() throws Throwable { |
| 1370 |
// testTracepointPasscount(); |
| 1371 |
// |
| 1372 |
// // Set the passcount of the forth tp to make it stop the tracing |
| 1373 |
// Map<String, Object> delta = new HashMap<String, Object>(); |
| 1374 |
// delta.put(MIBreakpoints.IGNORE_COUNT, 1); |
| 1375 |
// updateBreakpoint(fTracepoints[3], delta); |
| 1376 |
// |
| 1377 |
// startTracing(); |
| 1378 |
// SyncUtil.SyncRunToLocation(Integer.toString(LAST_LINE_NUMBER)); |
| 1379 |
// |
| 1380 |
// checkTraceStatus(true, false, |
| 1381 |
// 1 + 1 + 10 + 1, |
| 1382 |
// STOP_REASON_ENUM.PASSCOUNT, 5); |
| 1383 |
// } |
| 1384 |
// |
| 1385 |
// /** |
| 1386 |
// * This test sets a tracepoint and then gives it a condition |
| 1387 |
// * and confirms the condition is respected |
| 1388 |
// */ |
| 1389 |
// //@Test |
| 1390 |
// public void testTracepointConditionAndRun() throws Throwable { |
| 1391 |
// // Use trace state variables and stuff |
| 1392 |
// } |
| 1393 |
// |
| 1394 |
// /** |
| 1395 |
// * This test sets the different types of tracepoints and then sets some collect actions |
| 1396 |
// * and confirms the proper information is collected |
| 1397 |
// */ |
| 1398 |
// //@Test |
| 1399 |
// public void testCollectActionsAndRun() throws Throwable { |
| 1400 |
// testCreateTracepoints(); |
| 1401 |
// } |
| 1402 |
// |
| 1403 |
// /** |
| 1404 |
// * This test sets the different types of tracepoints and then sets some eval actions |
| 1405 |
// * and confirms the trace variables are properly updated |
| 1406 |
// */ |
| 1407 |
// //@Test |
| 1408 |
// public void testEvalActionsAndRun() throws Throwable { |
| 1409 |
// testCreateTracepoints(); |
| 1410 |
// } |
| 1411 |
// |
| 1412 |
// /** |
| 1413 |
// * This test sets the different types of tracepoints and then sets some while-stepping actions |
| 1414 |
// * and confirms the proper information is collected |
| 1415 |
// */ |
| 1416 |
// //@Test |
| 1417 |
// public void testSteppingActionsAndRun() throws Throwable { |
| 1418 |
// testCreateTracepoints(); |
| 1419 |
// } |
| 1420 |
// |
| 1421 |
// /** |
| 1422 |
// * This test sets the different types of tracepoints and then sets a mix of different |
| 1423 |
// * tracepoint actions and confirms the proper information is collected |
| 1424 |
// */ |
| 1425 |
// //@Test |
| 1426 |
// public void testMixedActionsAndRun() throws Throwable { |
| 1427 |
// testCreateTracepoints(); |
| 1428 |
// } |
| 1429 |
// |
| 1430 |
// /** |
| 1431 |
// * This test sets the different types of tracepoints and then sets some default collect actions |
| 1432 |
// * and confirms the proper information is collected |
| 1433 |
// */ |
| 1434 |
// //@Test |
| 1435 |
// public void testDefaultCollectActionAndRun() throws Throwable { |
| 1436 |
// testCreateTracepoints(); |
| 1437 |
// } |
| 1438 |
// |
| 1439 |
|
| 1055 |
|
1440 |
|
| 1056 |
} |
1441 |
} |