From 67dc3e1575b633bdc70bed6d278abd0f1ed0d8ce Mon Sep 17 00:00:00 2001 From: Aidan Dodds Date: Thu, 10 Mar 2016 17:50:01 +0000 Subject: [Renderscript] Add stack argument reading code for Mipsel 3 Fix a problem raised with the previous patches being applied in the wrong order. Committed on behalf of: Dean De Leo llvm-svn: 263134 --- .../RenderScriptRuntime/RenderScriptRuntime.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp') diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index 1d8ea656f09..654a8acec62 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -141,6 +141,8 @@ GetArgsX86(const GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) { Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE); + Error error; + // get the current stack pointer uint64_t sp = ctx.reg_ctx->GetSP(); @@ -365,20 +367,18 @@ GetArgsMipsel(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) else { 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); + size_t bytes_read = ctx.process->ReadMemory(sp, &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()); + // advance the stack pointer + sp += arg_size; } // fail if we couldn't read this argument if (!success) { if (log) - log->Printf("%s - error reading argument: %" PRIu64, __FUNCTION__, uint64_t(i)); + log->Printf("%s - error reading argument: %" PRIu64", reason: %s", + __FUNCTION__, uint64_t(i), error.AsCString("n/a")); return false; } } -- cgit v1.2.3