diff options
-rw-r--r-- | lldb/source/API/SBTarget.cpp | 30 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Target/SectionLoadList.cpp | 1 |
3 files changed, 33 insertions, 4 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 79b038b2766..f4582da5e1d 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -2329,7 +2329,13 @@ SBTarget::SetSectionLoadAddress (lldb::SBSection section, } else { - target_sp->GetSectionLoadList().SetSectionLoadAddress (section_sp, section_base_addr); + if (target_sp->GetSectionLoadList().SetSectionLoadAddress (section_sp, section_base_addr)) + { + // Flush info in the process (stack frames, etc) + ProcessSP process_sp (target_sp->GetProcessSP()); + if (process_sp) + process_sp->Flush(); + } } } } @@ -2355,7 +2361,13 @@ SBTarget::ClearSectionLoadAddress (lldb::SBSection section) } else { - target_sp->GetSectionLoadList().SetSectionUnloaded (section.GetSP()); + if (target_sp->GetSectionLoadList().SetSectionUnloaded (section.GetSP())) + { + // Flush info in the process (stack frames, etc) + ProcessSP process_sp (target_sp->GetProcessSP()); + if (process_sp) + process_sp->Flush(); + } } } else @@ -2386,6 +2398,10 @@ SBTarget::SetModuleLoadAddress (lldb::SBModule module, int64_t slide_offset) ModuleList module_list; module_list.Append(module_sp); target_sp->ModulesDidLoad (module_list); + // Flush info in the process (stack frames, etc) + ProcessSP process_sp (target_sp->GetProcessSP()); + if (process_sp) + process_sp->Flush(); } } } @@ -2420,12 +2436,20 @@ SBTarget::ClearModuleLoadAddress (lldb::SBModule module) SectionList *section_list = objfile->GetSectionList(); if (section_list) { + bool changed = false; const size_t num_sections = section_list->GetSize(); for (size_t sect_idx = 0; sect_idx < num_sections; ++sect_idx) { SectionSP section_sp (section_list->GetSectionAtIndex(sect_idx)); if (section_sp) - target_sp->GetSectionLoadList().SetSectionUnloaded (section_sp); + changed |= target_sp->GetSectionLoadList().SetSectionUnloaded (section_sp) > 0; + } + if (changed) + { + // Flush info in the process (stack frames, etc) + ProcessSP process_sp (target_sp->GetProcessSP()); + if (process_sp) + process_sp->Flush(); } } else diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 55168ca0cae..64d2684a51e 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -2915,7 +2915,12 @@ protected: } if (changed) + { target->ModulesDidLoad (matching_modules); + Process *process = m_exe_ctx.GetProcessPtr(); + if (process) + process->Flush(); + } } else { @@ -4171,7 +4176,6 @@ public: { LoadSubCommand ("add", CommandObjectSP (new CommandObjectTargetModulesAdd (interpreter))); LoadSubCommand ("load", CommandObjectSP (new CommandObjectTargetModulesLoad (interpreter))); - //LoadSubCommand ("unload", CommandObjectSP (new CommandObjectTargetModulesUnload (interpreter))); LoadSubCommand ("dump", CommandObjectSP (new CommandObjectTargetModulesDump (interpreter))); LoadSubCommand ("list", CommandObjectSP (new CommandObjectTargetModulesList (interpreter))); LoadSubCommand ("lookup", CommandObjectSP (new CommandObjectTargetModulesLookup (interpreter))); diff --git a/lldb/source/Target/SectionLoadList.cpp b/lldb/source/Target/SectionLoadList.cpp index 68aa7f0c1bc..17e558144ce 100644 --- a/lldb/source/Target/SectionLoadList.cpp +++ b/lldb/source/Target/SectionLoadList.cpp @@ -155,6 +155,7 @@ SectionLoadList::SetSectionUnloaded (const lldb::SectionSP §ion_sp) sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section_sp.get()); if (sta_pos != m_sect_to_addr.end()) { + ++unload_count; addr_t load_addr = sta_pos->second; m_sect_to_addr.erase (sta_pos); |