Add some useful android logging for post-mortem debugging

This commit is contained in:
baldurk
2019-01-04 16:59:26 +00:00
parent f3dda7959e
commit a3ff33368b
4 changed files with 26 additions and 5 deletions
+4
View File
@@ -630,6 +630,10 @@ extern "C" RENDERDOC_API ReplayStatus RENDERDOC_CC RENDERDOC_StartAndroidRemoteS
std::vector<Android::ABI> abis = Android::GetSupportedABIs(deviceID);
RDCLOG("Starting RenderDoc server, supported ABIs:");
for(Android::ABI abi : abis)
RDCLOG(" - %s", ToStr(abi).c_str());
if(abis.empty())
return ReplayStatus::UnknownError;
+15 -1
View File
@@ -173,4 +173,18 @@ std::string GetFriendlyName(std::string deviceID)
return combined;
}
};
};
template <>
std::string DoStringise(const Android::ABI &el)
{
BEGIN_ENUM_STRINGISE(Android::ABI);
{
STRINGISE_ENUM_CLASS(unknown);
STRINGISE_ENUM_CLASS(armeabi_v7a);
STRINGISE_ENUM_CLASS(arm64_v8a);
STRINGISE_ENUM_CLASS(x86);
STRINGISE_ENUM_CLASS(x86_64);
}
END_ENUM_STRINGISE();
}
+2
View File
@@ -69,3 +69,5 @@ std::string GetPathForPackage(const std::string &deviceID, const std::string &pa
bool PatchManifest(std::vector<byte> &manifest);
};
DECLARE_REFLECTION_ENUM(Android::ABI);
+5 -4
View File
@@ -157,6 +157,8 @@ bool InjectLibraries(const std::string &deviceID, Network::Socket *sock)
case Android::ABI::x86: libPath += "lib/x86"; break;
}
RDCLOG("Injecting RenderDoc from library in %s", libPath.c_str());
if(conn.IsErrored())
return false;
@@ -377,13 +379,12 @@ bool InjectLibraries(const std::string &deviceID, Network::Socket *sock)
// call Runtime.load() on our library. This will load the library and from then on it's
// responsible for injecting its hooks into GLES on its own. See android_hook.cpp for more
// information on the implementation
value ret =
conn.InvokeInstance(thread, runtime, load, runtimeObject.Object,
{conn.NewString(thread, libPath + "/libVkLayer_GLES_RenderDoc.so")});
value ret = conn.InvokeInstance(thread, runtime, load, runtimeObject.Object,
{conn.NewString(thread, libPath + "/" RENDERDOC_ANDROID_LIBRARY)});
if(ret.tag != Tag::Void)
{
RDCERR("Failed to call load()!");
RDCERR("Failed to call load(%s/%s)!", libPath.c_str(), RENDERDOC_ANDROID_LIBRARY);
return false;
}