[Lldb-commits] [lldb] r263134 - [Renderscript] Add stack argument reading code for Mipsel 3

Aidan Dodds via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 10 09:50:01 PST 2016


Author: aidandodds
Date: Thu Mar 10 11:50:01 2016
New Revision: 263134

URL: http://llvm.org/viewvc/llvm-project?rev=263134&view=rev
Log:
[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 <dean at codeplay.com>

Modified:
    lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp

Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=263134&r1=263133&r2=263134&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Thu Mar 10 11:50:01 2016
@@ -141,6 +141,8 @@ GetArgsX86(const GetArgsCtx &ctx, ArgIte
 {
     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 *
         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;
         }
     }




More information about the lldb-commits mailing list