================
@@ -703,14 +714,74 @@ void NativeProcessWindows::OnExitThread(lldb::tid_t
thread_id,
}
void NativeProcessWindows::OnLoadDll(const ModuleSpec &module_spec,
- lldb::addr_t module_addr) {
- m_loaded_modules.clear();
+ lldb::addr_t module_addr,
+ lldb::tid_t thread_id) {
+ Log *log = GetLog(WindowsLog::Process);
+
+ if (module_spec.GetFileSpec()) {
+ FileSpec resolved = module_spec.GetFileSpec();
+ FileSystem::Instance().Resolve(resolved);
+ m_loaded_modules[resolved] = module_addr;
+ }
m_pending_library_events = true;
+
+ if (!m_initial_stop_seen || !m_client_supports_libraries_read)
+ return;
+
+ NativeThreadWindows *loader_thread = GetThreadByID(thread_id);
+ if (!loader_thread && !m_threads.empty()) {
+ LLDB_LOG(log, "LOAD_DLL on unknown tid {0:x}. Falling back to main
thread.",
+ thread_id);
+ loader_thread = static_cast<NativeThreadWindows *>(m_threads[0].get());
+ }
+ if (loader_thread) {
+ SetCurrentThreadID(loader_thread->GetID());
+ if (loader_thread->DoStop().Fail())
+ LLDB_LOG(log, "Failed to suspend thread {0} on LOAD_DLL.",
+ loader_thread->GetID());
+ ThreadStopInfo info;
+ info.reason = lldb::eStopReasonNone;
+ info.signo = 0;
+ loader_thread->SetStopReason(info, "");
+ }
+ SetState(eStateStopped, true);
----------------
charles-zablit wrote:
It could yes. To fix this, I hoisted the `m_pending_event_dll` into its own
method `ArmDllEventWait` that has to be called before waiting for an event.
https://github.com/llvm/llvm-project/pull/203334
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits