diff options
Diffstat (limited to 'lldb/source/Target/Target.cpp')
| -rw-r--r-- | lldb/source/Target/Target.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 46216ba2d566..8d7709747765 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -270,12 +270,18 @@ void Target::DeleteCurrentProcess() { if (m_process_sp) { // We dispose any active tracing sessions on the current process m_trace_sp.reset(); - m_section_load_history.Clear(); + if (m_process_sp->IsAlive()) m_process_sp->Destroy(false); m_process_sp->Finalize(false /* not destructing */); + // Let the process finalize itself first, then clear the section load + // history. Some objects owned by the process might end up calling + // SectionLoadHistory::SetSectionUnloaded() which can create entries in + // the section load history that can mess up subsequent processes. + m_section_load_history.Clear(); + CleanupProcess(); m_process_sp.reset(); @@ -3217,8 +3223,9 @@ Status Target::Install(ProcessLaunchInfo *launch_info) { } bool Target::ResolveLoadAddress(addr_t load_addr, Address &so_addr, - uint32_t stop_id) { - return m_section_load_history.ResolveLoadAddress(stop_id, load_addr, so_addr); + uint32_t stop_id, bool allow_section_end) { + return m_section_load_history.ResolveLoadAddress(stop_id, load_addr, so_addr, + allow_section_end); } bool Target::ResolveFileAddress(lldb::addr_t file_addr, @@ -5147,3 +5154,15 @@ Target::ReportStatistics(const lldb_private::StatisticsOptions &options) { } void Target::ResetStatistics() { m_stats.Reset(*this); } + +bool Target::HasLoadedSections() { return !GetSectionLoadList().IsEmpty(); } + +lldb::addr_t Target::GetSectionLoadAddress(const lldb::SectionSP §ion_sp) { + return GetSectionLoadList().GetSectionLoadAddress(section_sp); +} + +void Target::ClearSectionLoadList() { GetSectionLoadList().Clear(); } + +void Target::DumpSectionLoadList(Stream &s) { + GetSectionLoadList().Dump(s, this); +} |
