Go to the documentation of this file.
11 #include "llvm/ADT/Triple.h"
12 #include "llvm/IR/DerivedTypes.h"
894 const lldb_private::RegisterInfo *
919 if (arch.
GetTriple().getArch() == llvm::Triple::hexagon) {
928 llvm::ArrayRef<addr_t> args)
const {
964 #define HEX_ABI_DEBUG 0
967 llvm::Type &prototype, llvm::ArrayRef<ABI::CallArgument> args)
const {
969 const int nVArgRegParams = 1;
996 for (
size_t i = 0; i < args.size(); i++) {
999 if (arg.
type == ABI::CallArgument::TargetValue)
1002 size_t argSize = (arg.
size | 0x7) + 1;
1019 printf(
"sp : %04" PRIx64
" \n",
sp);
1023 assert(prototype.getFunctionNumParams() == args.size());
1026 bool isVArg = prototype.isFunctionVarArg();
1029 int nRegArgs = nVArgRegParams;
1032 nRegArgs = args.size();
1038 for (
int i = 0; i < nRegArgs; i++) {
1047 int nSpillArgs = args.size() - nRegArgs;
1049 sp -= 4 * nSpillArgs;
1055 for (
size_t i = nRegArgs, offs = 0; i < args.size(); i++) {
1059 proc->WriteMemory(
sp + offs, (
void *)¶m,
sizeof(param),
error);
1060 if (!
error.Success())
1073 for (
int i = -8; i < 8; i++) {
1076 proc->ReadMemory(addr, (
void *)&data,
sizeof(data),
error);
1077 printf(
"\n0x%04" PRIx64
" 0x%08x ", addr, data);
1094 lldb::ValueObjectSP &new_value_sp) {
1101 ValueObjectSP return_valobj_sp;
1102 return return_valobj_sp;
1107 ValueObjectSP return_valobj_sp;
1108 return return_valobj_sp;
1114 unwind_plan.
Clear();
1135 unwind_plan.
Clear();
1144 row->SetUnspecifiedRegistersAreUndefined(
true);
1147 row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, -8,
true);
1148 row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4,
true);
1149 row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0,
true);
1174 return !RegisterIsCalleeSaved(reg_info);
1178 int reg = ((reg_info->byte_offset) / 4);
1180 bool save = (reg >= 16) && (reg <= 27);
1181 save |= (reg >= 29) && (reg <= 32);
1187 PluginManager::RegisterPlugin(GetPluginNameStatic(),
1188 "System V ABI for hexagon targets",
1193 PluginManager::UnregisterPlugin(CreateInstance);
1199 llvm::Type &retType)
const {
1201 ValueObjectSP vObjSP;
1209 const lldb_private::RegisterInfo *r0_info =
1211 if (r0_info ==
nullptr)
1215 if (retType.isVoidTy()) {
1219 else if (retType.isIntegerTy() || retType.isPointerTy()) {
1229 if (retType.isIntegerTy() && retType.isSized()) {
1230 uint64_t size = retType.getScalarSizeInBits();
1231 uint64_t mask = (1ull << size) - 1;
void AppendRow(const RowSP &row_sp)
#define LLDB_INVALID_REGNUM
void SetRegisterKind(lldb::RegisterKind kind)
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
void SetUnwindPlanValidAtAllInstructions(lldb_private::LazyBool valid_at_all_insn)
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
virtual bool ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value)=0
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
virtual uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num)
Convert from a given register numbering scheme to the lldb register numbering scheme.
void SetUnwindPlanForSignalTrap(lldb_private::LazyBool is_for_signal_trap)
llvm::Triple & GetTriple()
Architecture triple accessor.
virtual const RegisterInfo * GetRegisterInfoAtIndex(size_t reg)=0
void SetSourceName(const char *)
LLDB_PLUGIN_DEFINE_ADV(ObjectContainerUniversalMachO, ObjectContainerMachOArchive) void ObjectContainerUniversalMachO
const Scalar & GetScalar() const
lldb::ProcessSP GetProcess() const
static llvm::raw_ostream & error(Stream &strm)
void SetReturnAddressRegister(uint32_t regnum)
size_t GetRedZoneSize() const override
void SetSourcedFromCompiler(lldb_private::LazyBool from_compiler)
@ eEncodingUint
unsigned integer
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
static const uint32_t k_num_register_infos
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info)
std::shared_ptr< Row > RowSP
bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
bool WriteRegisterFromUnsigned(uint32_t reg, uint64_t uval)
#define LLDB_REGNUM_GENERIC_SP
static const RegisterInfo g_register_infos[]
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
Generic representation of a type in a programming language.
A class that represents a running process on the host machine.
#define LLDB_REGNUM_GENERIC_FP
const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override
#define LLDB_REGNUM_GENERIC_PC
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
virtual lldb::RegisterContextSP GetRegisterContext()=0
uint32_t GetAsUInt32(uint32_t fail_value=UINT32_MAX, bool *success_ptr=nullptr) const
@ eFormatAddressInfo
Describe what an address points to (func + offset.
std::unique_ptr< uint8_t[]> data_up
#define LLDB_REGNUM_GENERIC_RA
bool CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override