diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 65517eacd99..37376643d32 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2021-06-10 Tom de Vries + + * gdb.mi/user-selected-context-sync.c (child_sub_function, main): + Rewrite while (1) using dummy loop body. + 2021-06-10 Bhuvanendra Kumar N * gdb.base/foll-exec.c: convert the multi-line function call into diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.c b/gdb/testsuite/gdb.mi/user-selected-context-sync.c index 9818f30277f..ebb55f87e2c 100644 --- a/gdb/testsuite/gdb.mi/user-selected-context-sync.c +++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.c @@ -27,10 +27,10 @@ static pthread_barrier_t barrier; static void child_sub_function (void) { - /* Deliberately spin on a variable instead of plain 'while (1)' to - avoid the Clang bug https://bugs.llvm.org/show_bug.cgi?id=49614. */ - int spin = 1; - while (spin); /* thread loop line */ + volatile int dummy = 0; + while (1) + /* Dummy loop body to allow setting breakpoint. */ + dummy = !dummy; /* thread loop line */ } static void * @@ -60,10 +60,10 @@ main (void) pthread_barrier_wait (&barrier); - /* Deliberately spin on a variable instead of plain 'while (1)' to - avoid the Clang bug https://bugs.llvm.org/show_bug.cgi?id=49614. */ - int spin = 1; - while (spin); /* main break line */ + volatile int dummy = 0; + while (1) + /* Dummy loop body to allow setting breakpoint. */ + dummy = !dummy; /* main break line */ return 0; }