[Lldb-commits] [lldb] lldb: add support for thread names on Windows (PR #74731)

Saleem Abdulrasool via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 11 16:59:03 PST 2023


================
@@ -175,3 +179,30 @@ Status TargetThreadWindows::DoResume() {
 
   return Status();
 }
+
+const char *TargetThreadWindows::GetName() {
+  Log *log = GetLog(LLDBLog::Thread);
+  HMODULE hModule = ::LoadLibraryW(L"Kernel32.dll");
+  if (hModule) {
+    auto GetThreadDescription =
+        reinterpret_cast<GetThreadDescriptionFunctionPtr>(
+            ::GetProcAddress(hModule, "GetThreadDescription"));
+    LLDB_LOGF(log, "GetProcAddress: %p",
+              reinterpret_cast<void *>(GetThreadDescription));
+    if (GetThreadDescription) {
----------------
compnerd wrote:

An early out here would be nice to reduce indentation.

https://github.com/llvm/llvm-project/pull/74731


More information about the lldb-commits mailing list