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 <jalalo...@fb.com>
Date: Fri, 30 May 2025 12:02:02 -0700
Subject: [PATCH 1/3] 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@eGCbfH0TQ47ZV^L@|vZr?DS(wb7{Lf(1j-22^g
z?zw;8o2*S1j}PqHB`kyTy!@w$_^gOYUk=L<^g-J9@+B#22a-D5Yaiy_Lw&IP?b(@R
zTcc%QgVeY?waL>DRc5apm+)7+PF(2VocJUb=WZQeUO!Z6_K5QhN@U%|4cLkdrB$PR
z2C$3&<heEU5f|arIFnD}!lUW9;2`{V@YjAd9T%G3C7u^E5A+w5k~km1Qo8wUBL1d>
z^MIptaV_9l4z3LxWejKH4DYZFf|X>PfJq9@jF>pDo{p0}wuessym!)Z8y)gVf17Jb
z9QtSeDfN0W>$8dRZCyLg<YgT=36uVqmnIH`*!WE3#5F%m$87)*!zKI$=hAWc4*8_N
z@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@ct6M_dN`By?~d
z;-hrOmj}*kCCBFjM;XHzL=CuE2S-1YF`UU~lW{sYxRVr|K@hjz0av^FoKN`6e4QL0
z{k8DYDb5WC$M`5?IJ1vh7~f`(xHfQG?|tx3{2uc#F3OlcvtqY!4#@1bE*uuul`FNE
zKmj%O*vr$Cy8Yeyff9eG?b3xIdE&wWp`_iF7t_FQBdsGh7eBUly<fKS)E}W4yZ^hD
zgziBKHrjUXzuT{9f|^`Pw)^qzz|1iv!_jf;@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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)

>From ae1808d7ac878e3537f9ee6679434de0f1eab17b Mon Sep 17 00:00:00 2001
From: Jacob Lalonde <jalalo...@fb.com>
Date: Fri, 30 May 2025 12:43:58 -0700
Subject: [PATCH 2/3] Fix shell test

---
 lldb/test/Shell/Register/Core/x86-64-linux-tkill.test | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test 
b/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
index 240b1e9f8b2d6..e6d9f27a1777c 100644
--- a/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
+++ b/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
@@ -1,6 +1,6 @@
 # XFAIL: system-darwin
 # XFAIL: system-windows
-# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-linux-tkill.test | FileCheck %s
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-linux-tkill.core | FileCheck %s
 
 thread list
-# CHECK: * thread #1, name = 'tkill.out', stop reason = SIGSEGV: sent by tkill 
system call (sender pid=649752, uid=2667987)
+# CHECK: hread #1: tid = 2667987, 0x00007f9a265076cd, name = 'tkill.out', stop 
reason = SIGSEGV: sent by tkill system call (sender pid=2667987, uid=649752)

>From 06771cd21afd8b73901bed10fde4bb274626740b Mon Sep 17 00:00:00 2001
From: Jacob Lalonde <jalalo...@fb.com>
Date: Fri, 30 May 2025 13:11:43 -0700
Subject: [PATCH 3/3] Switch test to require

---
 lldb/test/Shell/Register/Core/x86-64-linux-tkill.test | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test 
b/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
index e6d9f27a1777c..64b99af2d83fa 100644
--- a/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
+++ b/lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
@@ -1,5 +1,4 @@
-# XFAIL: system-darwin
-# XFAIL: system-windows
+# REQUIRES: system-linux
 # RUN: %lldb -b -s %s -c %p/Inputs/x86-64-linux-tkill.core | FileCheck %s
 
 thread list

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to