From 55232f0948ab98c285bc65537f03f8e36d2ab9fa Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Wed, 21 Oct 2015 08:50:42 +0000 Subject: [RenderScript] New commands to save/load RS allocations to file. Patch adds command 'language renderscript allocation save' to store the contents of an allocation in a binary file. And 'language renderscript allocation load' to restore an allocation with the saved data from a binary file. Binary file format contains a header FileHeader with meta information preceding the raw data. Reviewed by: jingham, clayborg Subscribers: lldb-commits, domipheus Differential Revision: http://reviews.llvm.org/D13903 llvm-svn: 250886 --- .../RenderScript/RenderScriptRuntime/RenderScriptRuntime.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h') diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h index 740ab32ed14..b8342e0fd07 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h @@ -218,6 +218,10 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime virtual void ModulesDidLoad(const ModuleList &module_list ); + bool LoadAllocation(Stream &strm, const uint32_t alloc_id, const char* filename, StackFrame* frame_ptr); + + bool SaveAllocation(Stream &strm, const uint32_t alloc_id, const char* filename, StackFrame* frame_ptr); + void Update(); void Initiate(); @@ -264,7 +268,7 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime const HookDefn *defn; lldb::BreakpointSP bp_sp; }; - + typedef std::shared_ptr RuntimeHookSP; lldb::ModuleSP m_libRS; @@ -301,6 +305,8 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime void CaptureSetGlobalVar1(RuntimeHook* hook_info, ExecutionContext& context); AllocationDetails* FindAllocByID(Stream &strm, const uint32_t alloc_id); + std::shared_ptr GetAllocationData(AllocationDetails* allocation, StackFrame* frame_ptr); + unsigned int GetElementSize(const AllocationDetails* allocation); // // Helper functions for jitting the runtime -- cgit v1.2.3