From b97dddae0a3ba67c84e976de4b8660fc2f2659da Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 19 Aug 2014 13:24:22 -0700 Subject: [PATCH] Provide some minimal debugging on @import MS fail. --- modules/com/saurik/substrate/MS.cy | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/com/saurik/substrate/MS.cy b/modules/com/saurik/substrate/MS.cy index f3ee4d8..2ff60a4 100644 --- a/modules/com/saurik/substrate/MS.cy +++ b/modules/com/saurik/substrate/MS.cy @@ -22,15 +22,20 @@ (function(exports) { var libcycript = dlopen("/usr/lib/libcycript.dylib", RTLD_NOLOAD); -if (libcycript == null) +if (libcycript == null) { + exports.error = dlerror(); return; +} var CYHandleServer = dlsym(libcycript, "CYHandleServer"); -if (CYHandleServer == null) +if (CYHandleServer == null) { + exports.error = dlerror(); return; +} var info = new Dl_info; if (dladdr(CYHandleServer, info) == 0) { + exports.error = dlerror(); free(info); return; } @@ -41,9 +46,12 @@ free(info); var slash = path.lastIndexOf('/'); if (slash == -1) return; + var libsubstrate = dlopen(path.substr(0, slash) + "/libsubstrate.dylib", RTLD_GLOBAL | RTLD_LAZY); -if (libsubstrate == null) +if (libsubstrate == null) { + exports.error = dlerror(); return; +} MSGetImageByName = @encode(void *(const char *))(dlsym(libsubstrate, "MSGetImageByName")); MSFindSymbol = @encode(void *(void *, const char *))(dlsym(libsubstrate, "MSFindSymbol")); -- 2.50.0