summaryrefslogtreecommitdiff
path: root/cpu_ref
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-04-19 18:31:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-04-19 18:31:51 +0000
commit97222cef8fcc48378e5de96af51e0fc15ca0ae24 (patch)
treeef1e7acc1f63b3a52e284070c80f27d938dfe079 /cpu_ref
parent262b4f97d0592311a16fc53ede08443ab138e5b0 (diff)
parenta8b6960a8815bb1fff74c1d9dcf4c572a7a831d9 (diff)
downloadrs-97222cef8fcc48378e5de96af51e0fc15ca0ae24.tar.gz
Merge changes from topic 'rsDebugVersionInfo' into oc-dev
* changes: Update tests to reflect recent changes in lldb upstream and librs Add .rs.info versionInfo parser to the cpu_ref driver
Diffstat (limited to 'cpu_ref')
-rw-r--r--cpu_ref/rsCpuExecutable.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/cpu_ref/rsCpuExecutable.cpp b/cpu_ref/rsCpuExecutable.cpp
index 91d93556..045b915d 100644
--- a/cpu_ref/rsCpuExecutable.cpp
+++ b/cpu_ref/rsCpuExecutable.cpp
@@ -273,6 +273,7 @@ void* SharedLibraryUtils::loadSOHelper(const char *origName, const char *cacheDi
#define PRAGMA_STR "pragmaCount: "
#define THREADABLE_STR "isThreadable: "
#define CHECKSUM_STR "buildChecksum: "
+#define VERSIONINFO_STR "versionInfo: "
// Copy up to a newline or size chars from str -> s, updating str
// Returns s when successful and nullptr when '\0' is finally reached.
@@ -667,6 +668,26 @@ ScriptExecutable* ScriptExecutable::createFromSharedObject(
goto error;
}
+ {
+ // Parse the version info string, but ignore its contents as it's only
+ // used by the debugger
+ size_t nLines = 0;
+ if (strgets(line, MAXLINE, &rsInfo) != nullptr) {
+ if (sscanf(line, VERSIONINFO_STR "%zu", &nLines) != 1) {
+ ALOGE("invalid versionInfo count");
+ goto error;
+ } else {
+ // skip the versionInfo packet as libRs doesn't use it
+ while (nLines--) {
+ if (strgets(line, MAXLINE, &rsInfo) == nullptr)
+ goto error;
+ }
+ }
+ } else {
+ ALOGE(".rs.info is missing versionInfo section");
+ }
+ }
+
#endif // RS_COMPATIBILITY_LIB
// Read in information about mutable global variables provided by bcc's