diff options
author | Michał Górny <mgorny@moritz.systems> | 2022-01-11 20:28:37 +0100 |
---|---|---|
committer | Michał Górny <mgorny@moritz.systems> | 2022-01-13 11:24:36 +0100 |
commit | 1e74e5e9e3b903af568de834deab29fa342c665a (patch) | |
tree | 314d50a3b645eecdebc918293e2fe23956c4f615 /lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | |
parent | 1cbb456123a9e104d2a29c42f021ab537f18397b (diff) | |
download | llvm-1e74e5e9e3b903af568de834deab29fa342c665a.zip llvm-1e74e5e9e3b903af568de834deab29fa342c665a.tar.gz llvm-1e74e5e9e3b903af568de834deab29fa342c665a.tar.bz2 |
[lldb] [llgs] Implement qXfer:siginfo:read
Implement the qXfer:siginfo:read that is used to read the siginfo_t
(extended signal information) for the current thread. This is currently
implemented on FreeBSD and Linux.
Differential Revision: https://reviews.llvm.org/D117113
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index a7e4e9b..50d8ce9 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -536,3 +536,18 @@ void NativeThreadLinux::MaybeLogStateChange(lldb::StateType new_state) { NativeProcessLinux &NativeThreadLinux::GetProcess() { return static_cast<NativeProcessLinux &>(m_process); } + +const NativeProcessLinux &NativeThreadLinux::GetProcess() const { + return static_cast<const NativeProcessLinux &>(m_process); +} + +llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>> +NativeThreadLinux::GetSiginfo() const { + auto siginfo_buf = + llvm::WritableMemoryBuffer::getNewUninitMemBuffer(sizeof(siginfo_t)); + Status error = + GetProcess().GetSignalInfo(GetID(), siginfo_buf->getBufferStart()); + if (!error.Success()) + return error.ToError(); + return siginfo_buf; +} |