Index: lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp =================================================================== --- lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp +++ lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp @@ -211,6 +211,22 @@ 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(*thread).SetStoppedByExec(); + SetState(StateType::eStateStopped, true); + return; + } + if (info.pl_lwpid > 0) { for (const auto &t : m_threads) { if (t->GetID() == static_cast(info.pl_lwpid)) Index: lldb/test/API/functionalities/exec/TestExec.py =================================================================== --- lldb/test/API/functionalities/exec/TestExec.py +++ lldb/test/API/functionalities/exec/TestExec.py @@ -20,7 +20,6 @@ @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 @@ @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)