[Lldb-commits] [lldb] [LLDB][Platform Linux] Flip and add test (PR #142200)

via lldb-commits lldb-commits at lists.llvm.org
Fri May 30 12:05:34 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jacob Lalonde (Jlalond)

<details>
<summary>Changes</summary>

Despite a great review from @<!-- -->labath, I accidentally landed the signal with the UID and PID properties flipped. I was actually trying to write tests for this feature when I discovered it. 

This fixes that bug, and add a shell test that runs only on Nix systems.

---
Full diff: https://github.com/llvm/llvm-project/pull/142200.diff


3 Files Affected:

- (added) lldb/test/Shell/Register/Core/Inputs/tkill.cpp (+10) 
- (added) lldb/test/Shell/Register/Core/Inputs/x86-64-linux-tkill.core () 
- (added) lldb/test/Shell/Register/Core/x86-64-linux-tkill.test (+6) 


``````````diff
diff --git a/lldb/test/Shell/Register/Core/Inputs/tkill.cpp b/lldb/test/Shell/Register/Core/Inputs/tkill.cpp
new file mode 100644
index 0000000000000..79310c7f26b52
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/Inputs/tkill.cpp
@@ -0,0 +1,10 @@
+#include <sys/syscall.h>
+#include <signal.h>
+
+int main() {
+    // Get the current thread ID
+    pid_t tid = syscall(SYS_gettid);
+    // Send a SIGSEGV signal to the current thread
+    syscall(SYS_tkill, tid, SIGSEGV);
+    return 0;
+}
diff --git a/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-tkill.core b/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-tkill.core
new file mode 100644
index 0000000000000..3d1a05a34e7ca
Binary files /dev/null and b/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-tkill.core differ
diff --git a/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test b/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
new file mode 100644
index 0000000000000..240b1e9f8b2d6
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
@@ -0,0 +1,6 @@
+# XFAIL: system-darwin
+# XFAIL: system-windows
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-linux-tkill.test | FileCheck %s
+
+thread list
+# CHECK: * thread #1, name = 'tkill.out', stop reason = SIGSEGV: sent by tkill system call (sender pid=649752, uid=2667987)

``````````

</details>


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


More information about the lldb-commits mailing list