https://github.com/charles-zablit created 
https://github.com/llvm/llvm-project/pull/213010

`LoadLibraryW` runs on the debuggee with a timeout of 250ms (the default). On a 
loaded machine (in CI), this timeout is reached quite often, causing tests 
failures.

This patch gives both loader helpers an explicit timeout of 5s (clamped to half 
the overall timeout so the two stay consistent).

>From 91d3dd41c260fa8a1625c11220f861a69d175ad6 Mon Sep 17 00:00:00 2001
From: Charles Zablit <[email protected]>
Date: Thu, 30 Jul 2026 13:20:49 +0100
Subject: [PATCH] [lldb][Windows] Don't cut the loader helper off after 250ms

---
 lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp 
b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
index fdf6983801ae5..8868b497bd49d 100644
--- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
+++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
@@ -8,6 +8,7 @@
 
 #include "PlatformWindows.h"
 
+#include <chrono>
 #include <cstdio>
 #include <optional>
 #if defined(_WIN32)
@@ -422,6 +423,8 @@ uint32_t PlatformWindows::DoLoadImage(Process *process,
   // handle currently.
   options.SetTrapExceptions(false);
   options.SetTimeout(process->GetUtilityExpressionTimeout());
+  options.SetOneThreadTimeout(
+      std::min<std::chrono::microseconds>(5, 
process->GetUtilityExpressionTimeout() / 2));
   options.SetIsForUtilityExpr(true);
 
   ExpressionResults result =
@@ -932,6 +935,8 @@ extern "C" {
   // handle currently.
   options.SetTrapExceptions(false);
   options.SetTimeout(process->GetUtilityExpressionTimeout());
+  options.SetOneThreadTimeout(
+      std::min<std::chrono::microseconds>(5, 
process->GetUtilityExpressionTimeout() / 2));
 
   ExpressionResults result = UserExpression::Evaluate(
       context, options, expression, kLoaderDecls, value);

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to