https://github.com/Jlalond created https://github.com/llvm/llvm-project/pull/142200
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. >From b19ac1c3d1c5bd7af2fcea80a2b472b9a05c57de Mon Sep 17 00:00:00 2001 From: Jacob Lalonde <jalalo...@fb.com> Date: Fri, 30 May 2025 12:02:02 -0700 Subject: [PATCH] Flip and add test --- 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 ++++++ 3 files changed, 16 insertions(+) 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/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 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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zY!vP6Wo8@ zO3s=3Dzj&|%hjoai`!kUf+jZy*Z!0Nk$Zzn|3y1=X<4p(nRaqum(x-QXXV@qIV?Eo zyUZUsDmdp)v_~A&a>}1+C&zR-BXw}XPuQLu5uERH#!n6iPIr)rCdUJ3dz^N1DwiWs z2M3Dgg`5Z+=YGaR&I1l}h<0)sa1^d_?lE!icIvph8K&?q$KCuC`{!Ma`(>PV=px^k zbu<BcZ)a<dNAWGze6_xkt1iw>jO*uow!WO55OuBGWaC?Dj&6pr-l)tE4;ydUe0J=J zGq#<qer<lfR38}~9U04yjpv^oJ))x=bppKg8dXNBi%YAgM@}D}7?~K?F^?r;-idm( zZ_Pce4g!4^@Sa+W4kT`PD?@cjZf{4YMzV4THAB?-P;pEZ3rCNYg6YC5FPxl|Qb}uL zD%~vEXV63$)wZ3Yy)SJBH1|8B2-$#|>SE!gnNv#duZi1hb^OxfHa_2D``as9H()dw z`z1AKzGQDefBi1{8R#Jcxh|!LuCA+Tw{L@Pop$@xrW-!~tB#y_ak5x^E;qNhl$$Hp YUsuGZ*bU#W?`L2qGjMWd#{75tU*eM_V*mgE literal 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) _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits