summaryrefslogtreecommitdiff
path: root/rsApiContext.cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2016-03-30 17:54:01 -0700
committerStephen Hines <srhines@google.com>2016-03-31 08:17:37 -0700
commit98cb2d1420a22536649af2c493a58595f7c2542e (patch)
treea11e3f41ee7aa16b65fc044a5878e391ef31af9f /rsApiContext.cpp
parenta51b8f6b2916fb589d32bc902bb0ddfd6eedceee (diff)
downloadrs-98cb2d1420a22536649af2c493a58595f7c2542e.tar.gz
Move gDebuggerPresent to libRS.so, and fix up driver after split.
Now that libRS.so has been split into public/private libraries, we must also move gDebuggerPresent into the public side. lldb uses this as a flag to indicate that the driver can proceed (after waiting for the debugger to attach). Change-Id: I4c8f5c466644a51d50368ac8dd91f0bfd699302d
Diffstat (limited to 'rsApiContext.cpp')
-rw-r--r--rsApiContext.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/rsApiContext.cpp b/rsApiContext.cpp
index a5c7c3fd..8cb29930 100644
--- a/rsApiContext.cpp
+++ b/rsApiContext.cpp
@@ -24,8 +24,19 @@
using namespace android;
using namespace android::renderscript;
+/*
+ * This global will be found by the debugger and will have its value flipped.
+ * It's independent of the Context class to allow the debugger to do the above
+ * without knowing the type makeup. This allows the debugger to be attached at
+ * an earlier stage.
+ */
+extern "C" int gDebuggerPresent = 0;
+
extern "C" RsContext rsContextCreate(RsDevice vdev, uint32_t version, uint32_t sdkVersion,
RsContextType ct, uint32_t flags) {
+ if (!gInternalDebuggerPresent) {
+ gInternalDebuggerPresent = &gDebuggerPresent;
+ }
//ALOGV("rsContextCreate dev=%p", vdev);
Device * dev = static_cast<Device *>(vdev);
Context *rsc = Context::createContext(dev, nullptr, ct, flags);