Index: source/Symbol/ObjectFile.cpp =================================================================== --- source/Symbol/ObjectFile.cpp +++ source/Symbol/ObjectFile.cpp @@ -665,7 +665,6 @@ } Status ObjectFile::LoadInMemory(Target &target, bool set_pc) { - Status error; ProcessSP process = target.CalculateProcess(); if (!process) return Status("No Process"); @@ -675,6 +674,8 @@ SectionList *section_list = GetSectionList(); if (!section_list) return Status("No section in object file"); + + Status error; size_t section_count = section_list->GetNumSections(0); for (size_t i = 0; i < section_count; ++i) { SectionSP section_sp = section_list->GetSectionAtIndex(i); @@ -687,8 +688,13 @@ section_sp->GetSectionData(section_data); lldb::offset_t written = process->WriteMemory( addr, section_data.GetDataStart(), section_data.GetByteSize(), error); - if (written != section_data.GetByteSize()) + if (written != section_data.GetByteSize()) { + if (!error.Fail()) + error.SetErrorStringWithFormat( + "One or more breakpoints intersect section '%s'", + section_sp->GetName().AsCString()); return error; + } } } if (set_pc) {