[Lldb-commits] [lldb] r223273 - Manually call ModulesDidLoad when the executable is loaded.

Zachary Turner zturner at google.com
Wed Dec 3 14:04:32 PST 2014


Author: zturner
Date: Wed Dec  3 16:04:31 2014
New Revision: 223273

URL: http://llvm.org/viewvc/llvm-project?rev=223273&view=rev
Log:
Manually call ModulesDidLoad when the executable is loaded.

This is a temporary workaround to get deferred breakpoint
resolution working until Bug 21720 is addressed.  Even with this
workaround, it will only resolve deferred breakpoints in the
executable module, and not in a shared library.

Modified:
    lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp

Modified: lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp?rev=223273&r1=223272&r2=223273&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp Wed Dec  3 16:04:31 2014
@@ -418,6 +418,11 @@ ProcessWindows::CanDebug(Target &target,
 void
 ProcessWindows::OnExitProcess(uint32_t exit_code)
 {
+    ModuleSP executable_module = GetTarget().GetExecutableModule();
+    ModuleList unloaded_modules;
+    unloaded_modules.Append(executable_module);
+    GetTarget().ModulesDidUnload(unloaded_modules, true);
+
     SetProcessExitStatus(nullptr, GetID(), true, 0, exit_code);
     SetPrivateState(eStateExited);
 }
@@ -431,6 +436,12 @@ ProcessWindows::OnDebuggerConnected(lldb
     bool load_addr_changed;
     module->SetLoadAddress(GetTarget(), image_base, false, load_addr_changed);
 
+    // Notify the target that the executable module has loaded.  This will cause any pending
+    // breakpoints to be resolved to explicit brekapoint sites.
+    ModuleList loaded_modules;
+    loaded_modules.Append(module);
+    GetTarget().ModulesDidLoad(loaded_modules);
+
     DebuggerThreadSP debugger = m_session_data->m_debugger;
     const HostThreadWindows &wmain_thread = debugger->GetMainThread().GetNativeThread();
     m_session_data->m_new_threads[wmain_thread.GetThreadId()] = debugger->GetMainThread();





More information about the lldb-commits mailing list