[Renderscript] Add stack argument reading code for Mipsel 2
authorAidan Dodds <aidan@codeplay.com>
Thu, 10 Mar 2016 17:37:02 +0000 (17:37 +0000)
committerAidan Dodds <aidan@codeplay.com>
Thu, 10 Mar 2016 17:37:02 +0000 (17:37 +0000)
This commit implements the reading of stack spilled function arguments for little endian MIPS targets.

Committed on behalf of: Dean De Leo <dean@codeplay.com>

llvm-svn: 263131

lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp

index d636178..1d8ea65 100644 (file)
@@ -364,8 +364,15 @@ GetArgsMipsel(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args)
         // arguments passed on the stack
         else
         {
-            if (log)
-                log->Printf("%s - reading arguments spilled to stack not implemented.", __FUNCTION__);
+            const size_t arg_size = sizeof(uint32_t);
+            uint64_t sp = ctx.reg_ctx->GetSP();
+            uint32_t offset = i * arg_size;
+            arg.value = 0;
+            Error error;
+            size_t bytes_read = ctx.process->ReadMemory(sp + offset, &arg.value, arg_size, error);
+            success = (error.Success() && bytes_read == arg_size);
+            if (!success && log)
+                log->Printf ("RenderScriptRuntime::GetArgSimple - error reading Mips stack: %s.", error.AsCString());
         }
         // fail if we couldn't read this argument
         if (!success)