summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp46
-rw-r--r--lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h1
2 files changed, 46 insertions, 1 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
index be839b9e576..6b8e64b9d7c 100644
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -556,6 +556,14 @@ const RenderScriptRuntime::HookDefn RenderScriptRuntime::s_runtimeHookDefns[] =
RenderScriptRuntime::eModuleKindDriver, // type
nullptr // handler
},
+ {
+ "rsdAllocationDestroy", // name
+ "_Z20rsdAllocationDestroyPKN7android12renderscript7ContextEPNS0_10AllocationE", // symbol name 32bit
+ "_Z20rsdAllocationDestroyPKN7android12renderscript7ContextEPNS0_10AllocationE", // symbol name 64bit
+ 0, // version
+ RenderScriptRuntime::eModuleKindDriver, // type
+ &lldb_private::RenderScriptRuntime::CaptureAllocationDestroy // handler
+ },
};
const size_t RenderScriptRuntime::s_runtimeHookCount = sizeof(s_runtimeHookDefns)/sizeof(s_runtimeHookDefns[0]);
@@ -857,6 +865,43 @@ RenderScriptRuntime::CaptureAllocationInit1(RuntimeHook* hook_info, ExecutionCon
alloc->context = rs_context_u64;
}
+void
+RenderScriptRuntime::CaptureAllocationDestroy(RuntimeHook* hook_info, ExecutionContext& context)
+{
+ Log* log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
+
+ // Context, Alloc
+ uint64_t rs_context_u64 = 0U;
+ uint64_t rs_alloc_u64 = 0U;
+
+ bool success = GetArgSimple(context, 0, &rs_context_u64) && GetArgSimple(context, 1, &rs_alloc_u64);
+ if (!success) // error case
+ {
+ if (log)
+ log->Printf("RenderScriptRuntime::CaptureAllocationDestroy - Error while reading the function parameters");
+ return; // abort
+ }
+
+ if (log)
+ log->Printf("RenderScriptRuntime::CaptureAllocationDestroy - 0x%" PRIx64 ", 0x%" PRIx64 ".",
+ rs_context_u64, rs_alloc_u64);
+
+ for (auto iter = m_allocations.begin(); iter != m_allocations.end(); ++iter)
+ {
+ auto& allocation_ap = *iter; // get the unique pointer
+ if (allocation_ap->address.isValid() && *allocation_ap->address.get() == rs_alloc_u64)
+ {
+ m_allocations.erase(iter);
+ if (log)
+ log->Printf("RenderScriptRuntime::CaptureAllocationDestroy - Deleted allocation entry");
+ return;
+ }
+ }
+
+ if (log)
+ log->Printf("RenderScriptRuntime::CaptureAllocationDestroy - Couldn't find destroyed allocation");
+}
+
void
RenderScriptRuntime::CaptureScriptInit1(RuntimeHook* hook_info, ExecutionContext& context)
{
@@ -2304,7 +2349,6 @@ RenderScriptRuntime::Status(Stream &strm) const
strm.Indent(b.second->defn->name);
strm.EOL();
}
- strm.EOL();
}
else
{
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
index 971c26bae16..0ca268c93b0 100644
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
@@ -326,6 +326,7 @@ private:
void CaptureScriptInit1(RuntimeHook* hook_info, ExecutionContext& context);
void CaptureAllocationInit1(RuntimeHook* hook_info, ExecutionContext& context);
+ void CaptureAllocationDestroy(RuntimeHook* hook_info, ExecutionContext& context);
void CaptureSetGlobalVar1(RuntimeHook* hook_info, ExecutionContext& context);
AllocationDetails* FindAllocByID(Stream &strm, const uint32_t alloc_id);
OpenPOWER on IntegriCloud