[Lldb-commits] [PATCH] D123020: increase timeouts if running on valgrind

Luboš Luňák via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 4 04:02:46 PDT 2022


llunak created this revision.
llunak added a reviewer: clayborg.
llunak added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
llunak requested review of this revision.
Herald added a subscriber: lldb-commits.

Valgrind makes everything run much slower, so don't time out too soon.

BTW, does it make sense to get even things like this reviewed, or is it ok if I push these directly if I'm reasonably certain I know what I'm doing? I feel like I'm spamming you by now.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123020

Files:
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp


Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -34,6 +34,7 @@
 #include "lldb/Utility/StreamString.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/ScopedPrinter.h"
+#include "llvm/Support/Valgrind.h"
 
 #include "ProcessGDBRemoteLog.h"
 
@@ -1244,6 +1245,8 @@
 GDBRemoteCommunication::ScopedTimeout::ScopedTimeout(
     GDBRemoteCommunication &gdb_comm, std::chrono::seconds timeout)
     : m_gdb_comm(gdb_comm), m_timeout_modified(false) {
+  if (llvm::sys::RunningOnValgrind())
+    timeout *= 100; // Valgrind makes things take much longer.
   auto curr_timeout = gdb_comm.GetPacketTimeout();
   // Only update the timeout if the timeout is greater than the current
   // timeout. If the current timeout is larger, then just use that.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123020.420134.patch
Type: text/x-patch
Size: 989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220404/abecc28a/attachment-0001.bin>


More information about the lldb-commits mailing list