================
@@ -807,6 +808,23 @@ void
CommandCompletions::TypeCategoryNames(CommandInterpreter &interpreter,
});
}
+void CommandCompletions::ThreadIDs(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ const ExecutionContext &exe_ctx = interpreter.GetExecutionContext();
+ if (!exe_ctx.HasProcessScope())
+ return;
+
+ ThreadList &threads = exe_ctx.GetProcessPtr()->GetThreadList();
+ lldb::ThreadSP thread_sp;
+ for (uint32_t idx = 0; (thread_sp = threads.GetThreadAtIndex(idx)); ++idx) {
----------------
mdko wrote:
It's to avoid this warning:
```
/home/michristensen/llvm/llvm-project/lldb/source/Commands/CommandCompletions.cpp:820:36:
warning: using the result of an assignment as a condition without parentheses
[-Wparentheses]
for (uint32_t idx = 0; thread_sp = threads.GetThreadAtIndex(idx); ++idx) {
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/michristensen/llvm/llvm-project/lldb/source/Commands/CommandCompletions.cpp:820:36:
note: place parentheses around the assignment to silence this warning
for (uint32_t idx = 0; thread_sp = threads.GetThreadAtIndex(idx); ++idx) {
```
It's also consistent to how it was done in the ThreadIndex completer code:
https://github.com/llvm/llvm-project/blob/e109a2ea37b20141aad8c4db4d39ff56e8a6dc4e/lldb/source/Commands/CommandCompletions.cpp#L776
https://github.com/llvm/llvm-project/pull/73596
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits