LLDB mainline
ABISysV_loongarch.cpp File Reference
#include "ABISysV_loongarch.h"
#include <array>
#include <limits>
#include <sstream>
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/Support/MathExtras.h"
#include "Utility/LoongArch_DWARF_Registers.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Value.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/ValueObject/ValueObjectConstResult.h"

Go to the source code of this file.

Namespaces

namespace  dwarf

Macros

#define DEFINE_REG_NAME(reg_num)
#define DEFINE_REG_NAME_STR(reg_name)
#define DEFINE_GENERIC_REGISTER_STUB(dwarf_num, generic_num)
#define DEFINE_REGISTER_STUB(dwarf_num)

Functions

static bool UpdateRegister (RegisterContext *reg_ctx, const lldb::RegisterKind reg_kind, const uint32_t reg_num, const addr_t value)
static void LogInitInfo (Log &log, const Thread &thread, addr_t sp, addr_t func_addr, addr_t return_addr, const llvm::ArrayRef< addr_t > args)
template<typename T>
static void SetInteger (Scalar &scalar, uint64_t raw_value, bool is_signed)
static bool SetSizedInteger (Scalar &scalar, uint64_t raw_value, uint8_t size_in_bytes, bool is_signed)
static bool SetSizedFloat (Scalar &scalar, uint64_t raw_value, uint8_t size_in_bytes)
static ValueObjectSP GetValObjFromIntRegs (Thread &thread, const RegisterContextSP &reg_ctx, llvm::Triple::ArchType machine, uint32_t type_flags, uint32_t byte_size)
static ValueObjectSP GetValObjFromFPRegs (Thread &thread, const RegisterContextSP &reg_ctx, llvm::Triple::ArchType machine, uint32_t type_flags, uint32_t byte_size)
static uint32_t GetGenericNum (llvm::StringRef name)

Variables

static constexpr size_t g_regs_for_args_count = 8U

Macro Definition Documentation

◆ DEFINE_GENERIC_REGISTER_STUB

#define DEFINE_GENERIC_REGISTER_STUB ( dwarf_num,
generic_num )
Value:
{ \
DEFINE_REG_NAME(dwarf_num), \
DEFINE_REG_NAME_STR(nullptr), \
0, \
0, \
{dwarf_num, dwarf_num, generic_num, LLDB_INVALID_REGNUM, dwarf_num}, \
nullptr, \
nullptr, \
nullptr, \
}
#define LLDB_INVALID_REGNUM

Definition at line 35 of file ABISysV_loongarch.cpp.

◆ DEFINE_REG_NAME

#define DEFINE_REG_NAME ( reg_num)
Value:
A uniqued constant string class.
Definition ConstString.h:40
const char * GetCString() const
Get the string value as a C string.

Definition at line 29 of file ABISysV_loongarch.cpp.

◆ DEFINE_REG_NAME_STR

#define DEFINE_REG_NAME_STR ( reg_name)
Value:

Definition at line 30 of file ABISysV_loongarch.cpp.

◆ DEFINE_REGISTER_STUB

#define DEFINE_REGISTER_STUB ( dwarf_num)
Value:
#define DEFINE_GENERIC_REGISTER_STUB(dwarf_num, str_name, generic_num)

Definition at line 49 of file ABISysV_loongarch.cpp.

Function Documentation

◆ GetGenericNum()

◆ GetValObjFromFPRegs()

◆ GetValObjFromIntRegs()

◆ LogInitInfo()

void LogInitInfo ( Log & log,
const Thread & thread,
addr_t sp,
addr_t func_addr,
addr_t return_addr,
const llvm::ArrayRef< addr_t > args )
static

Definition at line 179 of file ABISysV_loongarch.cpp.

References lldb_private::Log::PutString(), and sp.

Referenced by ABISysV_loongarch::PrepareTrivialCall().

◆ SetInteger()

template<typename T>
void SetInteger ( Scalar & scalar,
uint64_t raw_value,
bool is_signed )
static

Definition at line 325 of file ABISysV_loongarch.cpp.

Referenced by SetSizedInteger().

◆ SetSizedFloat()

bool SetSizedFloat ( Scalar & scalar,
uint64_t raw_value,
uint8_t size_in_bytes )
static

Definition at line 360 of file ABISysV_loongarch.cpp.

Referenced by GetValObjFromFPRegs(), and GetValObjFromIntRegs().

◆ SetSizedInteger()

bool SetSizedInteger ( Scalar & scalar,
uint64_t raw_value,
uint8_t size_in_bytes,
bool is_signed )
static

Definition at line 334 of file ABISysV_loongarch.cpp.

References SetInteger().

Referenced by GetValObjFromIntRegs().

◆ UpdateRegister()

Variable Documentation

◆ g_regs_for_args_count

size_t g_regs_for_args_count = 8U
staticconstexpr

Definition at line 137 of file ABISysV_loongarch.cpp.

Referenced by ABISysV_loongarch::PrepareTrivialCall().