diff options
| author | Greg Clayton <gclayton@apple.com> | 2016-05-16 21:14:44 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2016-05-16 21:14:44 +0000 |
| commit | 2920b3640164dce96381dfed228e4c9956d7876a (patch) | |
| tree | 863f8aa754fe6235ce830f4cdc83b8f27d1c919e | |
| parent | e64619ce6e9a67354668790e842d9313e3ac6e74 (diff) | |
| download | bcm5719-llvm-2920b3640164dce96381dfed228e4c9956d7876a.tar.gz bcm5719-llvm-2920b3640164dce96381dfed228e4c9956d7876a.zip | |
Make sure we notify that the section module was loaded when SBTarget::SetSectionLoadAddress() is called. Also make sure that the section module is unloaded when SBTarget::ClearSectionLoadAddress() or SBTarget::ClearModuleLoadAddress() is called.
<rdar://problem/25119335>
llvm-svn: 269707
| -rw-r--r-- | lldb/source/API/SBTarget.cpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 220e136430d..df3001b6c72 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -2204,6 +2204,13 @@ SBTarget::SetSectionLoadAddress (lldb::SBSection section, ProcessSP process_sp (target_sp->GetProcessSP()); if (target_sp->SetSectionLoadAddress (section_sp, section_base_addr)) { + ModuleSP module_sp(section_sp->GetModule()); + if (module_sp) + { + ModuleList module_list; + module_list.Append(module_sp); + target_sp->ModulesDidLoad (module_list); + } // Flush info in the process (stack frames, etc) if (process_sp) process_sp->Flush(); @@ -2233,12 +2240,27 @@ SBTarget::ClearSectionLoadAddress (lldb::SBSection section) } else { - ProcessSP process_sp (target_sp->GetProcessSP()); - if (target_sp->SetSectionUnloaded (section.GetSP())) + SectionSP section_sp (section.GetSP()); + if (section_sp) + { + ProcessSP process_sp (target_sp->GetProcessSP()); + if (target_sp->SetSectionUnloaded(section_sp)) + { + ModuleSP module_sp(section_sp->GetModule()); + if (module_sp) + { + ModuleList module_list; + module_list.Append(module_sp); + target_sp->ModulesDidUnload(module_list, false); + } + // Flush info in the process (stack frames, etc) + if (process_sp) + process_sp->Flush(); + } + } + else { - // Flush info in the process (stack frames, etc) - if (process_sp) - process_sp->Flush(); + sb_error.SetErrorStringWithFormat ("invalid section"); } } } @@ -2320,6 +2342,9 @@ SBTarget::ClearModuleLoadAddress (lldb::SBModule module) } if (changed) { + ModuleList module_list; + module_list.Append(module_sp); + target_sp->ModulesDidUnload(module_list, false); // Flush info in the process (stack frames, etc) ProcessSP process_sp (target_sp->GetProcessSP()); if (process_sp) |

