diff options
-rw-r--r-- | lldb/source/Core/Address.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Target/SectionLoadList.cpp | 20 |
2 files changed, 21 insertions, 5 deletions
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp index 83100dea93b..a12d651bdf6 100644 --- a/lldb/source/Core/Address.cpp +++ b/lldb/source/Core/Address.cpp @@ -442,7 +442,11 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum case DumpStyleModuleWithFileAddress: if (section_sp) { - s->Printf("%s[", section_sp->GetModule()->GetFileSpec().GetFilename().AsCString("<Unknown>")); + ModuleSP module_sp = section_sp->GetModule(); + if (module_sp) + s->Printf("%s[", module_sp->GetFileSpec().GetFilename().AsCString("<Unknown>")); + else + s->Printf("%s[","<Unknown>"); } // Fall through case DumpStyleFileAddress: diff --git a/lldb/source/Target/SectionLoadList.cpp b/lldb/source/Target/SectionLoadList.cpp index da3aea5034d..d79c32eeb53 100644 --- a/lldb/source/Target/SectionLoadList.cpp +++ b/lldb/source/Target/SectionLoadList.cpp @@ -172,10 +172,16 @@ SectionLoadList::SetSectionUnloaded (const lldb::SectionSP §ion_sp) if (log) { - const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec()); + ModuleSP module_sp = section_sp->GetModule(); + std::string module_name("<Unknown>"); + if (module_sp) + { + const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec()); + module_name = module_file_spec.GetPath(); + } log->Printf ("SectionLoadList::%s (section = %p (%s.%s))", __FUNCTION__, static_cast<void*>(section_sp.get()), - module_file_spec.GetPath().c_str(), + module_name.c_str(), section_sp->GetName().AsCString()); } @@ -203,10 +209,16 @@ SectionLoadList::SetSectionUnloaded (const lldb::SectionSP §ion_sp, addr_t l if (log) { - const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec()); + ModuleSP module_sp = section_sp->GetModule(); + std::string module_name("<Unknown>"); + if (module_sp) + { + const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec()); + module_name = module_file_spec.GetPath(); + } log->Printf ("SectionLoadList::%s (section = %p (%s.%s), load_addr = 0x%16.16" PRIx64 ")", __FUNCTION__, static_cast<void*>(section_sp.get()), - module_file_spec.GetPath().c_str(), + module_name.c_str(), section_sp->GetName().AsCString(), load_addr); } bool erased = false; |