From 8ed3e75c96d987e294067e2fe0ab5b02a5bcc89d Mon Sep 17 00:00:00 2001 From: Emmmer Date: Tue, 16 Aug 2022 15:37:23 +0800 Subject: [LLDB] Handle possible resume thread error In this switch case we didn't handle possible errors in `ResumeThread()`, it's hard to get helpful information when it goes wrong. Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D131946 --- lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 5556f69c1019..a0f9f476a3c6 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -933,8 +933,14 @@ Status NativeProcessLinux::Resume(const ResumeActionList &resume_actions) { case eStateStepping: { // Run the thread, possibly feeding it the signal. const int signo = action->signal; - ResumeThread(static_cast(*thread), action->state, - signo); + Status error = ResumeThread(static_cast(*thread), + action->state, signo); + if (error.Fail()) + return Status("NativeProcessLinux::%s: failed to resume thread " + "for pid %" PRIu64 ", tid %" PRIu64 ", error = %s", + __FUNCTION__, GetID(), thread->GetID(), + error.AsCString()); + break; } -- cgit v1.2.3