[LLDB][Platform Linux] Flip uid and pid in get signal description (#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.
This commit is contained in:
@@ -580,7 +580,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) {
|
||||
|
||||
10
lldb/test/Shell/Register/Core/Inputs/tkill.cpp
Normal file
10
lldb/test/Shell/Register/Core/Inputs/tkill.cpp
Normal file
@@ -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;
|
||||
}
|
||||
BIN
lldb/test/Shell/Register/Core/Inputs/x86-64-linux-tkill.core
Normal file
BIN
lldb/test/Shell/Register/Core/Inputs/x86-64-linux-tkill.core
Normal file
Binary file not shown.
5
lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
Normal file
5
lldb/test/Shell/Register/Core/x86-64-linux-tkill.test
Normal file
@@ -0,0 +1,5 @@
|
||||
# REQUIRES: system-linux
|
||||
# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-linux-tkill.core | FileCheck %s
|
||||
|
||||
thread list
|
||||
# CHECK: hread #1: tid = 2667987, 0x00007f9a265076cd, name = 'tkill.out', stop reason = SIGSEGV: sent by tkill system call (sender pid=2667987, uid=649752)
|
||||
Reference in New Issue
Block a user