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

Jacob Lalonde via lldb-commits lldb-commits at lists.llvm.org
Fri May 30 12:12:54 PDT 2025


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

>From 05f09fa434c7fa925935337fb44740f1beba52ba Mon Sep 17 00:00:00 2001
From: Jacob Lalonde <jalalonde at fb.com>
Date: Fri, 30 May 2025 12:02:02 -0700
Subject: [PATCH] Flip and add test

---
 .../Plugins/Platform/Linux/PlatformLinux.cpp     |   2 +-
 lldb/test/Shell/Register/Core/Inputs/tkill.cpp   |  10 ++++++++++
 .../Register/Core/Inputs/x86-64-linux-tkill.core | Bin 0 -> 8048 bytes
 .../Shell/Register/Core/x86-64-linux-tkill.test  |   6 ++++++
 4 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 lldb/test/Shell/Register/Core/Inputs/tkill.cpp
 create mode 100644 lldb/test/Shell/Register/Core/Inputs/x86-64-linux-tkill.core
 create mode 100644 lldb/test/Shell/Register/Core/x86-64-linux-tkill.test

diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
index cb60caf1cb422..d5e35e392d66f 100644
--- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -564,7 +564,7 @@ static std::string GetDescriptionFromSiginfo(lldb::ValueObjectSP siginfo_sp) {
   }
 
   return linux_signals.GetSignalDescription(signo, code, addr, lower, upper,
-                                            uid, pid);
+                                            pid, uid);
 }
 
 lldb::StopInfoSP PlatformLinux::GetStopInfoFromSiginfo(Thread &thread) {
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..677bd3e6cf493
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/Inputs/tkill.cpp
@@ -0,0 +1,10 @@
+#include <signal.h>
+#include <sys/syscall.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 0000000000000000000000000000000000000000..3d1a05a34e7ca001108fd3c45c6f68ba5d379a9a
GIT binary patch
literal 8048
zcmeHMO=w(I6h4iywfNKN!nXdPPf&@3%uHg8?Lv9Bq;X)-N7_hTO(vP3(J>h^6Dfk`
z2`(xkOqUjfSa7KhXrb=nP8Y&JH at eGCbfH0TQ47ZV^L@|vZr?DS(wb7{Lf(1j-22^g
z?zw;8o2*S1j}PqHB`kyTy!@w$_^gOYUk=L<^g-J9 at +B#22a-D5Yaiy_Lw&IP?b(@R
zTcc%QgVeY?waL>DRc5apm+)7+PF(2VocJUb=WZQeUO!Z6_K5QhN at U%|4cLkdrB$PR
z2C$3&<heEU5f|arIFnD}!lUW9;2`{V at YjAd9T%G3C7u^E5A+w5k~km1Qo8wUBL1d>
z^MIptaV_9l4z3LxWejKH4DYZFf|X>PfJq9 at jF>pDo{p0}wuessym!)Z8y)gVf17Jb
z9QtSeDfN0W>$8dRZCyLg<YgT=36uVqmnIH`*!WE3#5F%m$87)*!zKI$=hAWc4*8_N
z at UtYYjX)`5{!CtK#;ZthK8Zs+=8-bWX9(P^gUiDorR%Q+-1-+ue?D-OF`Pkc0k`Sk
z0E^C_7|zTCahWfZ{)qGRh*XK;68`dErQ`Az))6=B;LtzYQ%3o;r at ct6M_dN`By?~d
z;-hrOmj}*kCCBFjM;XHzL=CuE2S-1YF`UU~lW{sYxRVr|K at hjz0av^FoKN`6e4QL0
z{k8DYDb5WC$M`5?IJ1vh7~f`(xHfQG?|tx3{2uc#F3OlcvtqY!4#@1bE*uuul`FNE
zKmj%O*vr$Cy8Yeyff9eG?b3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0
HcmV?d00001

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)



More information about the lldb-commits mailing list