Skip to content

Commit edfa23b

Browse files
authored
Merge pull request #7059 from medismailben/swift/release/5.9
2 parents 781ba90 + f436805 commit edfa23b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ void ScriptedProcess::DidLaunch() { m_pid = GetInterface().GetProcessID(); }
166166
void ScriptedProcess::DidResume() {
167167
// Update the PID again, in case the user provided a placeholder pid at launch
168168
m_pid = GetInterface().GetProcessID();
169-
GetLoadedDynamicLibrariesInfos();
170169
}
171170

172171
Status ScriptedProcess::DoResume() {

lldb/source/Plugins/Process/scripted/ScriptedProcess.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "lldb/Target/Process.h"
1313
#include "lldb/Utility/ConstString.h"
1414
#include "lldb/Utility/ScriptedMetadata.h"
15+
#include "lldb/Utility/State.h"
1516
#include "lldb/Utility/Status.h"
1617

1718
#include "ScriptedThread.h"
@@ -93,6 +94,11 @@ class ScriptedProcess : public Process {
9394
void *GetImplementation() override;
9495

9596
void ForceScriptedState(lldb::StateType state) override {
97+
// If we're about to stop, we should fetch the loaded dynamic libraries
98+
// dictionary before emitting the private stop event to avoid having the
99+
// module loading happen while the process state is changing.
100+
if (StateIsStoppedState(state, true))
101+
GetLoadedDynamicLibrariesInfos();
96102
SetPrivateState(state);
97103
}
98104

0 commit comments

Comments
 (0)