[Lldb-commits] [lldb] 02d8fb5 - [lldb][test] check if CoreDumping info is supported (#160333)

via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 25 01:49:30 PDT 2025


Author: Ebuka Ezike
Date: 2025-09-25T09:49:26+01:00
New Revision: 02d8fb5789f64ed9cff3f42b005105a51c6c7550

URL: https://github.com/llvm/llvm-project/commit/02d8fb5789f64ed9cff3f42b005105a51c6c7550
DIFF: https://github.com/llvm/llvm-project/commit/02d8fb5789f64ed9cff3f42b005105a51c6c7550.diff

LOG: [lldb][test] check if CoreDumping info is supported (#160333)

CoreDumping in /proc/<pid>/status was added in kernel 4.15, this causes the
test to fail in older kernel versions. see
https://man7.org/linux/man-pages/man5/proc_pid_status.5.html

Added: 
    

Modified: 
    lldb/unittests/Host/posix/HostTest.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/Host/posix/HostTest.cpp b/lldb/unittests/Host/posix/HostTest.cpp
index 082edccf4e774..dc75b288ba76a 100644
--- a/lldb/unittests/Host/posix/HostTest.cpp
+++ b/lldb/unittests/Host/posix/HostTest.cpp
@@ -15,6 +15,10 @@
 #include <cerrno>
 #include <sys/resource.h>
 
+#ifdef __linux__
+#include <linux/version.h>
+#endif // __linux__
+
 using namespace lldb_private;
 
 namespace {
@@ -116,7 +120,12 @@ TEST_F(HostTest, GetProcessInfoSetsPriority) {
   ASSERT_TRUE(Info.IsZombie().has_value());
   ASSERT_FALSE(Info.IsZombie().value());
 
+  // CoreDumping was added in kernel version 4.15.
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
   ASSERT_TRUE(Info.IsCoreDumping().has_value());
   ASSERT_FALSE(Info.IsCoreDumping().value());
+#else
+  ASSERT_FALSE(Info.IsCoreDumping().has_value());
+#endif
 }
 #endif


        


More information about the lldb-commits mailing list