From 838e7bbf1f6aede97d49eedeb8a0c909e4715a2d Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Wed, 14 Oct 2015 09:02:20 +0000 Subject: RenderScript command for printing allocation contents This patch adds the command 'language renderscript allocation dump ' for printing the contents of a RS allocation. Displaying the coordinate of each element as well as its formatted value e.g (lldb) language renderscript allocation dump 1 Data (X, Y, Z): (0, 0, 0) = {0 1} (1, 0, 0) = {2 3} (2, 0, 0) = {4 5} A --file option is also included, since for large allocations it may be more helpful to view this text as a file. Reviewed by: jingham, clayborg Subscribers: lldb-commits, ADodds, domipheus, brucem Differential Revision: http://reviews.llvm.org/D13699 llvm-svn: 250281 --- .../RenderScript/RenderScriptRuntime/RenderScriptRuntime.h | 8 ++++++++ 1 file changed, 8 insertions(+) (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 ab4e8b1e85d..740ab32ed14 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h @@ -202,6 +202,8 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime void DumpKernels(Stream &strm) const; + bool DumpAllocation(Stream &strm, StackFrame* frame_ptr, const uint32_t id); + void ListAllocations(Stream &strm, StackFrame* frame_ptr, bool recompute); void AttemptBreakpointAtKernelName(Stream &strm, const char *name, Error &error, lldb::TargetSP target); @@ -298,6 +300,8 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime void CaptureAllocationInit1(RuntimeHook* hook_info, ExecutionContext& context); void CaptureSetGlobalVar1(RuntimeHook* hook_info, ExecutionContext& context); + AllocationDetails* FindAllocByID(Stream &strm, const uint32_t alloc_id); + // // Helper functions for jitting the runtime // @@ -310,6 +314,10 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime bool JITElementPacked(AllocationDetails* allocation, StackFrame* frame_ptr); + bool JITAllocationSize(AllocationDetails* allocation, StackFrame* frame_ptr, const uint32_t elem_size); + + bool JITAllocationStride(AllocationDetails* allocation, StackFrame* frame_ptr); + // Search for a script detail object using a target address. // If a script does not currently exist this function will return nullptr. // If 'create' is true and there is no previous script with this address, -- cgit v1.2.3