LLDB mainline
Namespaces | Macros | Functions | Variables
ABISysV_loongarch.cpp File Reference
#include "ABISysV_loongarch.h"
#include <array>
#include <limits>
#include <sstream>
#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)   ConstString(#reg_num).GetCString()
 
#define DEFINE_REG_NAME_STR(reg_name)   ConstString(reg_name).GetCString()
 
#define DEFINE_GENERIC_REGISTER_STUB(dwarf_num, generic_num)
 
#define DEFINE_REGISTER_STUB(dwarf_num)    DEFINE_GENERIC_REGISTER_STUB(dwarf_num, LLDB_INVALID_REGNUM)
 

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: lldb-defines.h:87
@ eEncodingInvalid

Definition at line 34 of file ABISysV_loongarch.cpp.

◆ DEFINE_REG_NAME

#define DEFINE_REG_NAME (   reg_num)    ConstString(#reg_num).GetCString()

Definition at line 28 of file ABISysV_loongarch.cpp.

◆ DEFINE_REG_NAME_STR

#define DEFINE_REG_NAME_STR (   reg_name)    ConstString(reg_name).GetCString()

Definition at line 29 of file ABISysV_loongarch.cpp.

◆ DEFINE_REGISTER_STUB

#define DEFINE_REGISTER_STUB (   dwarf_num)     DEFINE_GENERIC_REGISTER_STUB(dwarf_num, LLDB_INVALID_REGNUM)

Definition at line 48 of file ABISysV_loongarch.cpp.

Function Documentation

◆ GetGenericNum()

static uint32_t GetGenericNum ( llvm::StringRef  name)
static

◆ GetValObjFromFPRegs()

static ValueObjectSP GetValObjFromFPRegs ( Thread thread,
const RegisterContextSP reg_ctx,
llvm::Triple::ArchType  machine,
uint32_t  type_flags,
uint32_t  byte_size 
)
static

◆ GetValObjFromIntRegs()

static ValueObjectSP GetValObjFromIntRegs ( Thread thread,
const RegisterContextSP reg_ctx,
llvm::Triple::ArchType  machine,
uint32_t  type_flags,
uint32_t  byte_size 
)
static

◆ LogInitInfo()

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 
)
static

◆ SetInteger()

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

Definition at line 324 of file ABISysV_loongarch.cpp.

◆ SetSizedFloat()

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

Definition at line 359 of file ABISysV_loongarch.cpp.

Referenced by GetValObjFromFPRegs(), and GetValObjFromIntRegs().

◆ SetSizedInteger()

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

Definition at line 333 of file ABISysV_loongarch.cpp.

Referenced by GetValObjFromIntRegs().

◆ UpdateRegister()

static bool UpdateRegister ( RegisterContext reg_ctx,
const lldb::RegisterKind  reg_kind,
const uint32_t  reg_num,
const addr_t  value 
)
static

Variable Documentation

◆ g_regs_for_args_count

constexpr size_t g_regs_for_args_count = 8U
staticconstexpr

Definition at line 136 of file ABISysV_loongarch.cpp.

Referenced by ABISysV_loongarch::PrepareTrivialCall().