Lines Matching full:error_msg
72 bool DexFile::GetChecksum(const char* filename, uint32_t* checksum, std::string* error_msg) {
88 ScopedFd fd(OpenAndReadMagic(file_part, &magic, error_msg));
90 DCHECK(!error_msg->empty());
95 ZipArchive::OpenFromFd(fd.release(), filename, error_msg));
97 *error_msg = StringPrintf("Failed to open zip archive '%s' (error msg: %s)", file_part,
98 error_msg->c_str());
101 std::unique_ptr<ZipEntry> zip_entry(zip_archive->Find(zip_entry_name, error_msg));
103 *error_msg = StringPrintf("Zip archive '%s' doesn't contain %s (error msg: %s)", file_part,
104 zip_entry_name, error_msg->c_str());
112 DexFile::OpenFile(fd.release(), filename, false, error_msg));
119 *error_msg = StringPrintf("Expected valid zip or dex file: '%s'", filename);
123 bool DexFile::Open(const char* filename, const char* location, std::string* error_msg,
128 ScopedFd fd(OpenAndReadMagic(filename, &magic, error_msg));
130 DCHECK(!error_msg->empty());
134 return DexFile::OpenZip(fd.release(), location, error_msg, dex_files);
138 error_msg));
146 *error_msg = StringPrintf("Expected valid zip or dex file: '%s'", filename);
151 std::string error_msg;
152 std::unique_ptr<ZipArchive> zip_archive(ZipArchive::OpenFromFd(fd, filename, &error_msg));
156 std::unique_ptr<ZipEntry> zip_entry(zip_archive->Find(DexFile::kClassesDex, &error_msg));
162 std::string error_msg;
163 ScopedFd fd(OpenAndReadMagic(filename, &magic, &error_msg));
210 std::string* error_msg) {
218 error_msg);
223 error_msg)) {
231 std::string* error_msg) {
240 *error_msg = StringPrintf("DexFile: fstat '%s' failed: %s", location, strerror(errno));
244 *error_msg = StringPrintf("Attempt to mmap directory '%s'", location);
255 error_msg));
257 DCHECK(!error_msg->empty());
263 *error_msg = StringPrintf(
271 error_msg));
273 *error_msg = StringPrintf("Failed to open dex file '%s' from memory: %s", location,
274 error_msg->c_str());
279 location, error_msg)) {
288 bool DexFile::OpenZip(int fd, const std::string& location, std::string* error_msg,
292 std::unique_ptr<ZipArchive> zip_archive(ZipArchive::OpenFromFd(fd, location.c_str(), error_msg));
294 DCHECK(!error_msg->empty());
297 return DexFile::OpenFromZip(*zip_archive, location, error_msg, dex_files);
303 std::string* error_msg) {
310 error_msg);
314 const std::string& location, std::string* error_msg,
318 std::unique_ptr<ZipEntry> zip_entry(zip_archive.Find(entry_name, error_msg));
323 std::unique_ptr<MemMap> map(zip_entry->ExtractToMemMap(location.c_str(), entry_name, error_msg));
325 *error_msg = StringPrintf("Failed to extract '%s' from '%s': %s", entry_name, location.c_str(),
326 error_msg->c_str());
331 error_msg));
333 *error_msg = StringPrintf("Failed to open dex file '%s' from memory: %s", location.c_str(),
334 error_msg->c_str());
339 *error_msg = StringPrintf("Failed to make dex file '%s' read only", location.c_str());
345 location.c_str(), error_msg)) {
360 std::string* error_msg,
365 std::unique_ptr<const DexFile> dex_file(Open(zip_archive, kClassesDex, location, error_msg,
382 error_msg, &error_code));
385 LOG(WARNING) << error_msg;
415 std::string* error_msg) {
419 if (!dex_file->Init(error_msg)) {
464 bool DexFile::Init(std::string* error_msg) {
465 if (!CheckMagicAndVersion(error_msg)) {
471 bool DexFile::CheckMagicAndVersion(std::string* error_msg) const {
479 *error_msg = oss.str();
489 *error_msg = oss.str();