// . handle 64bit values and their register / stack requirements
*/
-#define HEX_ABI_DEBUG 1
+#define HEX_ABI_DEBUG 0
bool
ABISysV_hexagon::PrepareTrivialCall ( Thread &thread,
lldb::addr_t sp ,
// grab the process so we have access to the memory for spilling
lldb::ProcessSP proc = thread.GetProcess( );
+ // get the register context for modifying all of the registers
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
+ if (!reg_ctx)
+ return false;
+
+ uint32_t pc_reg = reg_ctx->ConvertRegisterKindToRegisterNumber(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
+ if (pc_reg == LLDB_INVALID_REGNUM)
+ return false;
+
+ uint32_t ra_reg = reg_ctx->ConvertRegisterKindToRegisterNumber(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
+ if (ra_reg == LLDB_INVALID_REGNUM)
+ return false;
+
+ uint32_t sp_reg = reg_ctx->ConvertRegisterKindToRegisterNumber(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
+ if (sp_reg == LLDB_INVALID_REGNUM)
+ return false;
+
// push host data onto target
for ( size_t i = 0; i < args.size( ); i++ )
{
// check if this is a variable argument function
bool isVArg = prototype.isFunctionVarArg();
- // get the register context for modifying all of the registers
- RegisterContext *reg_ctx = thread.GetRegisterContext().get();
- if (!reg_ctx)
- return false;
-
// number of arguments passed by register
int nRegArgs = nVArgRegParams;
if (! isVArg )
}
// update registers with current function call state
- reg_ctx->WriteRegisterFromUnsigned ( 41, pc );
- reg_ctx->WriteRegisterFromUnsigned ( 31, ra );
- reg_ctx->WriteRegisterFromUnsigned ( 29, sp );
-// reg_ctx->WriteRegisterFromUnsigned ( FP ??? );
+ reg_ctx->WriteRegisterFromUnsigned(pc_reg, pc);
+ reg_ctx->WriteRegisterFromUnsigned(ra_reg, ra);
+ reg_ctx->WriteRegisterFromUnsigned(sp_reg, sp);
#if HEX_ABI_DEBUG
// quick and dirty stack dumper for debugging