[Lldb-commits] [lldb] 90e6808 - Skip two WatchpointAlgorithm tests for 32-bit lldb's

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 31 23:58:13 PST 2024


Author: Jason Molenda
Date: 2024-01-31T23:58:06-08:00
New Revision: 90e68086d8fdbfb32dfc7e7e3498f44365274ce8

URL: https://github.com/llvm/llvm-project/commit/90e68086d8fdbfb32dfc7e7e3498f44365274ce8
DIFF: https://github.com/llvm/llvm-project/commit/90e68086d8fdbfb32dfc7e7e3498f44365274ce8.diff

LOG: Skip two WatchpointAlgorithm tests for 32-bit lldb's

After iterating with the arm-ubuntu CI bot, I found the crash (a
std::bad_alloc exception being thrown) was caused by these two
entries when built on a 32-bit machine.  I probably have an assumption
about size_t being 64-bits in WatchpointAlgorithms and we have a
problem when it's actually 32-bits and we're dealing with a real
64-bit address.  All of the cases where the address can be represented
in the low 32-bits of the addr_t work correctly, so for now I'm
skipping these two unit tests when building lldb on a 32-bit host
until I can review that method and possibly switch to explicit
uin64_t's.
.

Added: 
    

Modified: 
    lldb/unittests/Breakpoint/WatchpointAlgorithmsTests.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/Breakpoint/WatchpointAlgorithmsTests.cpp b/lldb/unittests/Breakpoint/WatchpointAlgorithmsTests.cpp
index 0b2ba6c70bb74..ba99c6bf4fabf 100644
--- a/lldb/unittests/Breakpoint/WatchpointAlgorithmsTests.cpp
+++ b/lldb/unittests/Breakpoint/WatchpointAlgorithmsTests.cpp
@@ -43,6 +43,11 @@ TEST(WatchpointAlgorithmsTests, PowerOf2Watchpoints) {
 
   // clang-format off
   std::vector<testcase> doubleword_max = {
+#if defined(__LP64__)
+    // These two tests don't work if lldb is built on
+    // a 32-bit system (likely with a 32-bit size_t).
+    // A 32-bit lldb debugging a 64-bit process isn't 
+    // critical right now.
     {
       {0x7fffffffe83b, 1},
       {{0x7fffffffe83b, 1}}
@@ -51,6 +56,7 @@ TEST(WatchpointAlgorithmsTests, PowerOf2Watchpoints) {
       {0x7fffffffe838, 2},
       {{0x7fffffffe838, 2}}
     },
+#endif
     {
       {0x1012, 8},
       {{0x1010, 8}, {0x1018, 8}}


        


More information about the lldb-commits mailing list