Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Marchi2015-01-15 20:38:01 +0000
committerMarc Khouzam2015-01-16 18:13:44 +0000
commitda85a41850f2b78e9230cb6b7d755f14d90bdee3 (patch)
tree8abc2955b8a1da648d8d32b6862e233a65c2224c
parent3d264fbae05d76150f168b29edd9f623d81b1343 (diff)
downloadorg.eclipse.cdt-da85a41850f2b78e9230cb6b7d755f14d90bdee3.tar.gz
org.eclipse.cdt-da85a41850f2b78e9230cb6b7d755f14d90bdee3.tar.xz
org.eclipse.cdt-da85a41850f2b78e9230cb6b7d755f14d90bdee3.zip
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>
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java
index 70638b0df3a..b0dd786d5f4 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java
@@ -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);

Back to the top