Index: source/Symbol/ObjectFile.cpp =================================================================== --- source/Symbol/ObjectFile.cpp +++ source/Symbol/ObjectFile.cpp @@ -78,8 +78,8 @@ // and object container plug-ins can use these bytes to see if they // can parse this file. if (file_size > 0) { - data_sp = - DataBufferLLVM::CreateSliceFromPath(file->GetPath(), 512, file_offset); + data_sp = DataBufferLLVM::CreateSliceFromPath(file->GetPath(), 512, + file_offset); data_offset = 0; } } @@ -122,8 +122,8 @@ } // We failed to find any cached object files in the container // plug-ins, so lets read the first 512 bytes and try again below... - data_sp = DataBufferLLVM::CreateSliceFromPath(archive_file.GetPath(), - 512, file_offset); + data_sp = DataBufferLLVM::CreateSliceFromPath( + archive_file.GetPath(), 512, file_offset); } } } @@ -211,7 +211,8 @@ lldb::offset_t file_offset, lldb::offset_t file_size, ModuleSpecList &specs) { - DataBufferSP data_sp = DataBufferLLVM::CreateSliceFromPath(file.GetPath(), 512, file_offset); + DataBufferSP data_sp = + DataBufferLLVM::CreateSliceFromPath(file.GetPath(), 512, file_offset); if (data_sp) { if (file_size == 0) { const lldb::offset_t actual_file_size = file.GetByteSize(); @@ -665,7 +666,6 @@ } Status ObjectFile::LoadInMemory(Target &target, bool set_pc) { - Status error; ProcessSP process = target.CalculateProcess(); if (!process) return Status("No Process"); @@ -675,6 +675,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 +689,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) { @@ -701,6 +708,4 @@ return error; } -void ObjectFile::RelocateSection(lldb_private::Section *section) -{ -} +void ObjectFile::RelocateSection(lldb_private::Section *section) {}