status_t DebugReportGenerator::_GenerateReport(const entry_ref& outputPath) { BFile file(&outputPath, B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE); status_t result = file.InitCheck(); if (result != B_OK) return result; result = _GenerateReportHeader(file); if (result != B_OK) return result; result = _DumpRunningThreads(file); if (result != B_OK) return result; result = _DumpLoadedImages(file); if (result != B_OK) return result; result = _DumpAreas(file); if (result != B_OK) return result; result = _DumpSemaphores(file); if (result != B_OK) return result; BPath path(&outputPath); AutoLocker< ::Team> teamLocker(fTeam); fTeam->NotifyDebugReportChanged(path.Path()); return B_OK; }
status_t DebugReportGenerator::_GenerateReport(const entry_ref& outputPath) { BFile file(&outputPath, B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE); status_t result = file.InitCheck(); if (result != B_OK) return result; BString output; result = _GenerateReportHeader(output); if (result != B_OK) return result; result = _DumpLoadedImages(output); if (result != B_OK) return result; result = _DumpRunningThreads(output); if (result != B_OK) return result; result = file.Write(output.String(), output.Length()); if (result < 0) return result; BPath path(&outputPath); fTeam->NotifyDebugReportChanged(path.Path()); return B_OK; }