[Lldb-commits] [lldb] 9e1409a - [lldb] [Process/FreeBSDRemote] Handle exec() from inferior

Michał Górny via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 9 02:36:55 PST 2020


Author: Michał Górny
Date: 2020-11-09T11:35:11+01:00
New Revision: 9e1409aa1e0bb1963757941cf4db539147614fbf

URL: https://github.com/llvm/llvm-project/commit/9e1409aa1e0bb1963757941cf4db539147614fbf
DIFF: https://github.com/llvm/llvm-project/commit/9e1409aa1e0bb1963757941cf4db539147614fbf.diff

LOG: [lldb] [Process/FreeBSDRemote] Handle exec() from inferior

Differential Revision: https://reviews.llvm.org/D90938

Added: 
    

Modified: 
    lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
    lldb/test/API/functionalities/exec/TestExec.py

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
index d132e37d38fa..5c10c9c8cd07 100644
--- a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
@@ -211,6 +211,22 @@ void NativeProcessFreeBSD::MonitorSIGTRAP(lldb::pid_t pid) {
     return;
   }
 
+  if (info.pl_flags & PL_FLAG_EXEC) {
+    Status error = ReinitializeThreads();
+    if (error.Fail()) {
+      SetState(StateType::eStateInvalid);
+      return;
+    }
+
+    // Let our delegate know we have just exec'd.
+    NotifyDidExec();
+
+    for (const auto &thread : m_threads)
+      static_cast<NativeThreadFreeBSD &>(*thread).SetStoppedByExec();
+    SetState(StateType::eStateStopped, true);
+    return;
+  }
+
   if (info.pl_lwpid > 0) {
     for (const auto &t : m_threads) {
       if (t->GetID() == static_cast<lldb::tid_t>(info.pl_lwpid))

diff  --git a/lldb/test/API/functionalities/exec/TestExec.py b/lldb/test/API/functionalities/exec/TestExec.py
index 89ee6409bd84..019df2177137 100644
--- a/lldb/test/API/functionalities/exec/TestExec.py
+++ b/lldb/test/API/functionalities/exec/TestExec.py
@@ -20,7 +20,6 @@ class ExecTestCase(TestBase):
     @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems
     @expectedFailureNetBSD
     @skipIfAsan # rdar://problem/43756823
-    @skipIfFreeBSD  # hangs
     @skipIfWindows
     def test_hitting_exec (self):
         self.do_test(False)
@@ -29,7 +28,6 @@ def test_hitting_exec (self):
     @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems
     @expectedFailureNetBSD
     @skipIfAsan # rdar://problem/43756823
-    @skipIfFreeBSD  # hangs
     @skipIfWindows
     def test_skipping_exec (self):
         self.do_test(True)


        


More information about the lldb-commits mailing list