1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00

Force thread order in GDBProcessesTest.getThreadData

A change in gdb showed that we shouldn't rely on the order of threads
when they are all created at the same time.

The solution is to break after each thread is created, so that gdb takes
note of the new thread before we spawn another one. This way, they'll
always be in the same order.

Change-Id: Ia62dc0476163ad44bba52d51df95cf747d27da84
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/39712
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Simon Marchi 2015-01-15 15:38:01 -05:00 committed by Marc Khouzam
parent 3d264fbae0
commit da85a41850

View file

@ -150,8 +150,15 @@ public class GDBProcessesTest extends BaseTestCase {
*/
@Test
public void getThreadData() throws Throwable {
// Start all threads, stop when they are all started
SyncUtil.runToLine(SOURCE_NAME, getLineForTag("LINE_MAIN_ALL_THREADS_STARTED"));
// Start the threads one by one to make sure they are discovered by gdb in the right
// order.
for (int i = 0; i < 5; i++) {
SyncUtil.runToLocation(SOURCE_NAME + ":" + getLineForTag("LINE_MAIN_AFTER_THREAD_START"));
}
// We need to get there to make sure that all the threads have their name set.
SyncUtil.runToLocation(SOURCE_NAME + ":" + getLineForTag("LINE_MAIN_ALL_THREADS_STARTED"));
IThreadDMData mainThreadData = SyncUtil.getThreadData(1);