[Lldb-commits] [lldb] 47667ee - [lldb] Update NativeProcess*BSD to new Status API

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 27 15:25:43 PDT 2024


Author: Adrian Prantl
Date: 2024-08-27T15:25:32-07:00
New Revision: 47667ee23d148458ab1c6f2c4cdce65ec981d766

URL: https://github.com/llvm/llvm-project/commit/47667ee23d148458ab1c6f2c4cdce65ec981d766
DIFF: https://github.com/llvm/llvm-project/commit/47667ee23d148458ab1c6f2c4cdce65ec981d766.diff

LOG: [lldb] Update NativeProcess*BSD to new Status API

Added: 
    

Modified: 
    lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
    lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
index 0bfcfc661fd6e3..97fff4b9f65a82 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
@@ -36,12 +36,12 @@ static Status EnsureFDFlags(int fd, int flags) {
 
   int status = fcntl(fd, F_GETFL);
   if (status == -1) {
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
     return error;
   }
 
   if (fcntl(fd, F_SETFL, status | flags) == -1) {
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
     return error;
   }
 
@@ -414,7 +414,7 @@ Status NativeProcessFreeBSD::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
   if (ret == -1) {
     error = CanTrace();
     if (error.Success())
-      error.SetErrorToErrno();
+      error = Status::FromErrno();
   }
 
   if (result)
@@ -523,7 +523,7 @@ Status NativeProcessFreeBSD::Halt() {
   if (StateIsStoppedState(m_state, false))
     return error;
   if (kill(GetID(), SIGSTOP) != 0)
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
   return error;
 }
 
@@ -544,7 +544,7 @@ Status NativeProcessFreeBSD::Signal(int signo) {
   Status error;
 
   if (kill(GetID(), signo))
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
 
   return error;
 }

diff  --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
index 14c85c2e76013a..8fb15d83117f45 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -41,12 +41,12 @@ static Status EnsureFDFlags(int fd, int flags) {
 
   int status = fcntl(fd, F_GETFL);
   if (status == -1) {
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
     return error;
   }
 
   if (fcntl(fd, F_SETFL, status | flags) == -1) {
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
     return error;
   }
 
@@ -391,7 +391,7 @@ Status NativeProcessNetBSD::StopProcess(lldb::pid_t pid) {
   ret = kill(pid, SIGSTOP);
 
   if (ret == -1)
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
 
   LLDB_LOG(log, "kill({0}, SIGSTOP)", pid);
 
@@ -412,7 +412,7 @@ Status NativeProcessNetBSD::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
   ret = ptrace(req, static_cast<::pid_t>(pid), addr, data);
 
   if (ret == -1)
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
 
   if (result)
     *result = ret;
@@ -576,7 +576,7 @@ Status NativeProcessNetBSD::Signal(int signo) {
   Status error;
 
   if (kill(GetID(), signo))
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
 
   return error;
 }
@@ -612,7 +612,7 @@ Status NativeProcessNetBSD::Kill() {
   }
 
   if (kill(GetID(), SIGKILL) != 0) {
-    error.SetErrorToErrno();
+    error = Status::FromErrno();
     return error;
   }
 


        


More information about the lldb-commits mailing list