4, // eBool,
}};
+ Error error;
+
// get the current stack pointer
uint64_t sp = ctx.reg_ctx->GetSP();
// step over the return address
// read the argument from memory
arg.value = 0;
// note: due to little endian layout reading 4 or 8 bytes will give the correct value.
- Error error;
size_t read = ctx.process->ReadMemory(sp, &arg.value, size, error);
success = (error.Success() && read==size);
// advance past 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;
}
}
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Error error;
+
// get the current stack pointer
uint64_t sp = ctx.reg_ctx->GetSP();
// clear all 64bits
arg.value = 0;
// read this argument from memory
- Error error;
size_t bytes_read = ctx.process->ReadMemory(sp, &arg.value, arg_size, error);
success = (error.Success() && bytes_read == arg_size);
// advance the stack pointer
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;
}
}
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Error error;
+
+ // find offset to arguments on the stack (+16 to skip over a0-a3 shadow space)
+ uint64_t sp = ctx.reg_ctx->GetSP() + 16;
+
for (size_t i = 0; i < num_args; ++i)
{
bool success = false;
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
+ Error error;
+
// get the current stack pointer
uint64_t sp = ctx.reg_ctx->GetSP();
// clear all 64bits
arg.value = 0;
// read this argument from memory
- Error error;
size_t bytes_read = ctx.process->ReadMemory(sp, &arg.value, arg_size, error);
success = (error.Success() && bytes_read == arg_size);
// advance the stack pointer
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;
}
}