aboutsummaryrefslogtreecommitdiff
path: root/src/resolve-system-dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve-system-dependencies')
-rw-r--r--src/resolve-system-dependencies/resolve-system-dependencies.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/resolve-system-dependencies/resolve-system-dependencies.cc b/src/resolve-system-dependencies/resolve-system-dependencies.cc
index 8f0c99c84..dcea72529 100644
--- a/src/resolve-system-dependencies/resolve-system-dependencies.cc
+++ b/src/resolve-system-dependencies/resolve-system-dependencies.cc
@@ -39,12 +39,20 @@ std::set<std::string> runResolver(const Path & filename)
throw SysError("statting '%s'", filename);
if (!S_ISREG(st.st_mode)) {
- printError("file '%s' is not a regular file", filename);
+ logError(
+ ErrorInfo {
+ .name = "Regular MACH file",
+ .hint = hintfmt("file '%s' is not a regular file", filename)
+ });
return {};
}
if (st.st_size < sizeof(mach_header_64)) {
- printError("file '%s' is too short for a MACH binary", filename);
+ logError(
+ ErrorInfo {
+ .name = "File too short",
+ .hint = hintfmt("file '%s' is too short for a MACH binary", filename)
+ });
return {};
}
@@ -66,13 +74,21 @@ std::set<std::string> runResolver(const Path & filename)
}
}
if (mach64_offset == 0) {
- printError(format("Could not find any mach64 blobs in file '%1%', continuing...") % filename);
+ logError(
+ ErrorInfo {
+ .name = "No mach64 blobs",
+ .hint = hintfmt("Could not find any mach64 blobs in file '%1%', continuing...", filename)
+ });
return {};
}
} else if (magic == MH_MAGIC_64 || magic == MH_CIGAM_64) {
mach64_offset = 0;
} else {
- printError(format("Object file has unknown magic number '%1%', skipping it...") % magic);
+ logError(
+ ErrorInfo {
+ .name = "Magic number",
+ .hint = hintfmt("Object file has unknown magic number '%1%', skipping it...", magic)
+ });
return {};
}