Lines Matching refs:filename

53 bool IsValidElfPath(const std::string& filename) {
54 if (!IsRegularFile(filename)) {
58 FILE* fp = fopen(filename.c_str(), mode.c_str());
90 bool GetBuildIdFromNoteFile(const std::string& filename, BuildId* build_id) {
92 if (!android::base::ReadFileToString(filename, &content)) {
93 LOG(DEBUG) << "can't read note file " << filename;
97 LOG(DEBUG) << "can't read build_id from note file " << filename;
146 static BinaryRet OpenObjectFile(const std::string& filename, uint64_t file_offset = 0,
149 FileHelper fhelper = FileHelper::OpenReadOnly(filename);
151 PLOG(DEBUG) << "failed to open " << filename;
155 file_size = GetFileSize(filename);
157 PLOG(ERROR) << "failed to get size of file " << filename;
161 auto buffer_or_err = llvm::MemoryBuffer::getOpenFileSlice(fhelper.fd(), filename, file_size, file_offset);
163 LOG(ERROR) << "failed to read " << filename << " [" << file_offset << "-" << (file_offset + file_size)
169 LOG(ERROR) << filename << " [" << file_offset << "-" << (file_offset + file_size)
177 LOG(ERROR) << filename << " [" << file_offset << "-" << (file_offset + file_size)
183 bool GetBuildIdFromElfFile(const std::string& filename, BuildId* build_id) {
184 if (!IsValidElfPath(filename)) {
187 bool result = GetBuildIdFromEmbeddedElfFile(filename, 0, 0, build_id);
188 LOG(VERBOSE) << "GetBuildIdFromElfFile(" << filename << ") => " << build_id->ToString();
192 bool GetBuildIdFromEmbeddedElfFile(const std::string& filename, uint64_t file_offset,
194 BinaryRet ret = OpenObjectFile(filename, file_offset, file_size);
286 bool ParseSymbolsFromElfFile(const std::string& filename, const BuildId& expected_build_id,
288 if (!IsValidElfPath(filename)) {
291 return ParseSymbolsFromEmbeddedElfFile(filename, 0, 0, expected_build_id, callback);
294 bool ParseSymbolsFromEmbeddedElfFile(const std::string& filename, uint64_t file_offset,
297 BinaryRet ret = OpenObjectFile(filename, file_offset, file_size);
298 if (ret.obj == nullptr || !MatchBuildId(ret.obj, expected_build_id, filename)) {
306 LOG(ERROR) << "unknown elf format in file " << filename;
330 bool ReadMinExecutableVirtualAddressFromElfFile(const std::string& filename,
333 if (!IsValidElfPath(filename)) {
336 BinaryRet ret = OpenObjectFile(filename);
337 if (ret.obj == nullptr || !MatchBuildId(ret.obj, expected_build_id, filename)) {
347 LOG(ERROR) << "unknown elf format in file" << filename;
352 LOG(ERROR) << "no program header in file " << filename;
376 bool ReadSectionFromElfFile(const std::string& filename, const std::string& section_name,
378 if (!IsValidElfPath(filename)) {
381 BinaryRet ret = OpenObjectFile(filename);
391 LOG(ERROR) << "unknown elf format in file" << filename;