aboutsummaryrefslogtreecommitdiff
path: root/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp')
-rw-r--r--source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp b/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
index 69129df1f16b..e0299b6f0b94 100644
--- a/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
+++ b/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
@@ -20,7 +20,6 @@
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/Core/ValueObjectRegister.h"
#include "lldb/Core/ValueObjectMemory.h"
-#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Process.h"
@@ -30,7 +29,7 @@
#include "llvm/ADT/Triple.h"
-#include "llvm/IR/Type.h"
+#include "llvm/IR/DerivedTypes.h"
using namespace lldb;
using namespace lldb_private;
@@ -227,7 +226,7 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread,
// . 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 ,
@@ -243,6 +242,23 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread,
// 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++ )
{
@@ -277,11 +293,6 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread,
// 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 )
@@ -324,10 +335,9 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread,
}
// 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
@@ -359,14 +369,14 @@ ABISysV_hexagon::SetReturnValueObject ( lldb::StackFrameSP &frame_sp, lldb::Valu
}
ValueObjectSP
-ABISysV_hexagon::GetReturnValueObjectSimple ( Thread &thread, ClangASTType &return_clang_type ) const
+ABISysV_hexagon::GetReturnValueObjectSimple ( Thread &thread, CompilerType &return_compiler_type ) const
{
ValueObjectSP return_valobj_sp;
return return_valobj_sp;
}
ValueObjectSP
-ABISysV_hexagon::GetReturnValueObjectImpl ( Thread &thread, ClangASTType &return_clang_type ) const
+ABISysV_hexagon::GetReturnValueObjectImpl ( Thread &thread, CompilerType &return_compiler_type ) const
{
ValueObjectSP return_valobj_sp;
return return_valobj_sp;