diff options
| author | Zachary Turner <zturner@google.com> | 2014-12-05 18:46:04 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2014-12-05 18:46:04 +0000 |
| commit | 301d184784d8fd50f52e18f2b9516115a61786a2 (patch) | |
| tree | 01f43cad4c7e487b9337cc7c96f9b649ff23be9f /lldb/source/Plugins/Process/Windows/ProcessWindows.cpp | |
| parent | cfd3b1ae6fc3a7116a2d5484b8b4efd24c8bcf42 (diff) | |
| download | bcm5719-llvm-301d184784d8fd50f52e18f2b9516115a61786a2.tar.gz bcm5719-llvm-301d184784d8fd50f52e18f2b9516115a61786a2.zip | |
Load / unload modules in the target when the OS events occur.
This causes all deferred breakpoints to be correctly resolved as
the modules that they reside in are loaded.
llvm-svn: 223497
Diffstat (limited to 'lldb/source/Plugins/Process/Windows/ProcessWindows.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Windows/ProcessWindows.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp index 22aa3b435f4..0ab627f5815 100644 --- a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp @@ -16,7 +16,9 @@ // Other libraries and framework includes #include "lldb/Core/Module.h" +#include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" +#include "lldb/Core/Section.h" #include "lldb/Core/State.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostProcess.h" @@ -521,13 +523,26 @@ ProcessWindows::OnLoadDll(const ModuleSpec &module_spec, lldb::addr_t module_add ModuleSP module = GetTarget().GetSharedModule(module_spec, &error); bool load_addr_changed = false; module->SetLoadAddress(GetTarget(), module_addr, false, load_addr_changed); + + ModuleList loaded_modules; + loaded_modules.Append(module); + GetTarget().ModulesDidLoad(loaded_modules); } void ProcessWindows::OnUnloadDll(lldb::addr_t module_addr) { - // TODO: Figure out how to get the ModuleSP loaded at the specified address and remove - // it from the target's module list. + Address resolved_addr; + if (GetTarget().ResolveLoadAddress(module_addr, resolved_addr)) + { + ModuleSP module = resolved_addr.GetModule(); + if (module) + { + ModuleList unloaded_modules; + unloaded_modules.Append(module); + GetTarget().ModulesDidUnload(unloaded_modules, false); + } + } } void |

