github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp --
lldb/test/API/functionalities/thread/concurrent_events/main.cpp
--diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lldb/test/API/functionalities/thread/concurrent_events/main.cpp
b/lldb/test/API/functionalities/thread/concurrent_events/main.cpp
index 9fcc6769b..445c0cd9a 100644
--- a/lldb/test/API/functionalities/thread/concurrent_events/main.cpp
+++ b/lldb/test/API/functionalities/thread/concurrent_events/main.cpp
@@ -74,7 +74,7 @@ watchpoint_func (void *input) {
pseudo_barrier_wait(g_barrier);
do_action_args(input);
- g_watchme.data = 1; // watchpoint triggers here
+ g_watchme.data = 1; // watchpoint triggers here
return 0;
}
@@ -122,61 +122,64 @@ void start_threads(thread_vector& threads,
int dotest()
{
- g_watchme.data = 0;
-
- // Actions are triggered immediately after the thread is spawned
- unsigned num_breakpoint_threads = 1;
- unsigned num_watchpoint_threads = 0;
- unsigned num_signal_threads = 1;
- unsigned num_crash_threads = 0;
-
- // Actions below are triggered after a 1-second delay
- unsigned num_delay_breakpoint_threads = 0;
- unsigned num_delay_watchpoint_threads = 0;
- unsigned num_delay_signal_threads = 0;
- unsigned num_delay_crash_threads = 0;
-
- register_signal_handler(SIGUSR1, sigusr1_handler); // Break here and
adjust num_[breakpoint|watchpoint|signal|crash]_threads
-
- unsigned total_threads = num_breakpoint_threads \
- + num_watchpoint_threads \
- + num_signal_threads \
- + num_crash_threads \
- + num_delay_breakpoint_threads \
- + num_delay_watchpoint_threads \
- + num_delay_signal_threads \
- + num_delay_crash_threads;
-
- // Don't let either thread do anything until they're both ready.
- pseudo_barrier_init(g_barrier, total_threads);
-
- action_counts actions;
- actions.push_back(std::make_pair(num_breakpoint_threads, breakpoint_func));
- actions.push_back(std::make_pair(num_watchpoint_threads, watchpoint_func));
- actions.push_back(std::make_pair(num_signal_threads, signal_func));
- actions.push_back(std::make_pair(num_crash_threads, crash_func));
-
- action_counts delay_actions;
- delay_actions.push_back(std::make_pair(num_delay_breakpoint_threads,
breakpoint_func));
- delay_actions.push_back(std::make_pair(num_delay_watchpoint_threads,
watchpoint_func));
- delay_actions.push_back(std::make_pair(num_delay_signal_threads,
signal_func));
- delay_actions.push_back(std::make_pair(num_delay_crash_threads,
crash_func));
-
- // Create threads that handle instant actions
- thread_vector threads;
- start_threads(threads, actions);
-
- // Create threads that handle delayed actions
- action_args delay_arg;
- delay_arg.delay = 1;
- start_threads(threads, delay_actions, &delay_arg);
-
- // Join all threads
- typedef std::vector<pthread_t>::iterator thread_iterator;
- for(thread_iterator t = threads.begin(); t != threads.end(); ++t)
- pthread_join(*t, 0);
-
- return 0;
+ g_watchme.data = 0;
+
+ // Actions are triggered immediately after the thread is spawned
+ unsigned num_breakpoint_threads = 1;
+ unsigned num_watchpoint_threads = 0;
+ unsigned num_signal_threads = 1;
+ unsigned num_crash_threads = 0;
+
+ // Actions below are triggered after a 1-second delay
+ unsigned num_delay_breakpoint_threads = 0;
+ unsigned num_delay_watchpoint_threads = 0;
+ unsigned num_delay_signal_threads = 0;
+ unsigned num_delay_crash_threads = 0;
+
+ register_signal_handler(
+ SIGUSR1,
+ sigusr1_handler); // Break here and adjust
+ // num_[breakpoint|watchpoint|signal|crash]_threads
+
+ unsigned total_threads = num_breakpoint_threads + num_watchpoint_threads +
+ num_signal_threads + num_crash_threads +
+ num_delay_breakpoint_threads +
+ num_delay_watchpoint_threads +
+ num_delay_signal_threads + num_delay_crash_threads;
+
+ // Don't let either thread do anything until they're both ready.
+ pseudo_barrier_init(g_barrier, total_threads);
+
+ action_counts actions;
+ actions.push_back(std::make_pair(num_breakpoint_threads, breakpoint_func));
+ actions.push_back(std::make_pair(num_watchpoint_threads, watchpoint_func));
+ actions.push_back(std::make_pair(num_signal_threads, signal_func));
+ actions.push_back(std::make_pair(num_crash_threads, crash_func));
+
+ action_counts delay_actions;
+ delay_actions.push_back(
+ std::make_pair(num_delay_breakpoint_threads, breakpoint_func));
+ delay_actions.push_back(
+ std::make_pair(num_delay_watchpoint_threads, watchpoint_func));
+ delay_actions.push_back(
+ std::make_pair(num_delay_signal_threads, signal_func));
+ delay_actions.push_back(std::make_pair(num_delay_crash_threads, crash_func));
+
+ // Create threads that handle instant actions
+ thread_vector threads;
+ start_threads(threads, actions);
+
+ // Create threads that handle delayed actions
+ action_args delay_arg;
+ delay_arg.delay = 1;
+ start_threads(threads, delay_actions, &delay_arg);
+
+ // Join all threads
+ typedef std::vector<pthread_t>::iterator thread_iterator;
+ for (thread_iterator t = threads.begin(); t != threads.end(); ++t)
+ pthread_join(*t, 0);
+
+ return 0;
}
int main ()
``````````
</details>
https://github.com/llvm/llvm-project/pull/221697
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits