11#include "llvm/IR/DerivedTypes.h"
12#include "llvm/TargetParser/Triple.h"
1004 if (arch.
GetTriple().getArch() == llvm::Triple::hexagon) {
1013 llvm::ArrayRef<addr_t> args)
const {
1049#define HEX_ABI_DEBUG 0
1052 llvm::Type &prototype, llvm::ArrayRef<ABI::CallArgument> args)
const {
1054 const int nVArgRegParams = 1;
1081 for (
size_t i = 0; i < args.size(); i++) {
1087 size_t argSize = (arg.
size | 0x7) + 1;
1104 printf(
"sp : %04" PRIx64
" \n",
sp);
1108 assert(prototype.getFunctionNumParams() == args.size());
1111 bool isVArg = prototype.isFunctionVarArg();
1114 int nRegArgs = nVArgRegParams;
1117 nRegArgs = args.size();
1123 for (
int i = 0; i < nRegArgs; i++) {
1125 uint32_t param = (uint32_t)args[i].value;
1132 int nSpillArgs = args.size() - nRegArgs;
1134 sp -= 4 * nSpillArgs;
1140 for (
size_t i = nRegArgs, offs = 0; i < args.size(); i++) {
1142 uint32_t param = (uint32_t)args[i].value;
1144 proc->WriteMemory(
sp + offs, (
void *)¶m,
sizeof(param),
error);
1145 if (!
error.Success())
1158 for (
int i = -8; i < 8; i++) {
1161 proc->ReadMemory(addr, (
void *)&data,
sizeof(data),
error);
1162 printf(
"\n0x%04" PRIx64
" 0x%08x ", addr, data);
1187 return return_valobj_sp;
1193 return return_valobj_sp;
1199 unwind_plan.
Clear();
1220 unwind_plan.
Clear();
1229 row->SetUnspecifiedRegistersAreUndefined(
true);
1232 row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, -8,
true);
1233 row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4,
true);
1234 row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0,
true);
1265 bool save = (reg >= 16) && (reg <= 27);
1266 save |= (reg >= 29) && (reg <= 32);
1273 "System V ABI for hexagon targets",
1284 llvm::Type &retType)
const {
1296 if (r0_info ==
nullptr)
1300 if (retType.isVoidTy()) {
1304 else if (retType.isIntegerTy() || retType.isPointerTy()) {
1314 if (retType.isIntegerTy() && retType.isSized()) {
1315 uint64_t size = retType.getScalarSizeInBits();
1316 uint64_t mask = (1ull << size) - 1;
static const uint32_t k_num_register_infos
static const RegisterInfo g_register_infos[]
static const uint32_t k_num_register_infos
static const RegisterInfo g_register_infos[]
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName)
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
bool PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp, lldb::addr_t functionAddress, lldb::addr_t returnAddress, llvm::ArrayRef< lldb::addr_t > args) const override
static llvm::StringRef GetPluginNameStatic()
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info)
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
bool CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
size_t GetRedZoneSize() const override
static std::unique_ptr< llvm::MCRegisterInfo > MakeMCRegisterInfo(const ArchSpec &arch)
Utility function to construct a MCRegisterInfo using the ArchSpec triple.
An architecture specification class.
llvm::Triple & GetTriple()
Architecture triple accessor.
Generic representation of a type in a programming language.
A uniqued constant string class.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
virtual uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num)
Convert from a given register numbering scheme to the lldb register numbering scheme.
virtual const RegisterInfo * GetRegisterInfoAtIndex(size_t reg)=0
bool WriteRegisterFromUnsigned(uint32_t reg, uint64_t uval)
virtual bool ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value)=0
uint32_t GetAsUInt32(uint32_t fail_value=UINT32_MAX, bool *success_ptr=nullptr) const
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
virtual lldb::RegisterContextSP GetRegisterContext()=0
lldb::ProcessSP GetProcess() const
void SetUnwindPlanForSignalTrap(lldb_private::LazyBool is_for_signal_trap)
void SetRegisterKind(lldb::RegisterKind kind)
void SetReturnAddressRegister(uint32_t regnum)
void AppendRow(const RowSP &row_sp)
std::shared_ptr< Row > RowSP
void SetSourcedFromCompiler(lldb_private::LazyBool from_compiler)
void SetSourceName(const char *)
void SetUnwindPlanValidAtAllInstructions(lldb_private::LazyBool valid_at_all_insn)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
const Scalar & GetScalar() const
#define LLDB_REGNUM_GENERIC_RA
#define LLDB_REGNUM_GENERIC_SP
#define LLDB_INVALID_REGNUM
#define LLDB_REGNUM_GENERIC_PC
#define LLDB_REGNUM_GENERIC_FP
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ABI > ABISP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
@ eFormatAddressInfo
Describe what an address points to (func + offset.
std::shared_ptr< lldb_private::Process > ProcessSP
@ eEncodingUint
unsigned integer
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
std::unique_ptr< uint8_t[]> data_up
Every register is described in detail including its name, alternate name (optional),...
uint32_t byte_offset
The byte offset in the register context data where this register's value is found.