[Lldb-commits] [lldb] 8ed3e75 - [LLDB] Handle possible resume thread error

via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 16 08:43:38 PDT 2022


Author: Emmmer
Date: 2022-08-16T23:43:28+08:00
New Revision: 8ed3e75c96d987e294067e2fe0ab5b02a5bcc89d

URL: https://github.com/llvm/llvm-project/commit/8ed3e75c96d987e294067e2fe0ab5b02a5bcc89d
DIFF: https://github.com/llvm/llvm-project/commit/8ed3e75c96d987e294067e2fe0ab5b02a5bcc89d.diff

LOG: [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

Added: 
    

Modified: 
    lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 5556f69c10194..a0f9f476a3c6f 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<NativeThreadLinux &>(*thread), action->state,
-                   signo);
+      Status error = ResumeThread(static_cast<NativeThreadLinux &>(*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;
     }
 


        


More information about the lldb-commits mailing list