aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Expression/IRExecutionUnit.cpp
diff options
context:
space:
mode:
authordlav-sc <daniil.avdeev@syntacore.com>2024-10-02 12:08:22 +0300
committerGitHub <noreply@github.com>2024-10-02 12:08:22 +0300
commit87121403e251828ed0fee8a9c2a2993ce8f57861 (patch)
tree34fb1fe56802b89177004c36624c0dcf06ed43e8 /lldb/source/Expression/IRExecutionUnit.cpp
parente64ef74e64577ecff16b7f5f7491b580c7e2f10a (diff)
downloadllvm-87121403e251828ed0fee8a9c2a2993ce8f57861.tar.gz
llvm-87121403e251828ed0fee8a9c2a2993ce8f57861.tar.bz2
llvm-87121403e251828ed0fee8a9c2a2993ce8f57861.zip
[lldb][RISCV] function calls support in lldb expressions (#99336)
[lldb][RISCV] add jitted function calls to ABI Function calls support in LLDB expressions for RISCV: 1 of 4 Augments corresponding functionality to RISCV ABI, which allows to jit lldb expressions and thus make function calls inside them. Only function calls with integer and void function arguments and return value are supported. [lldb][RISCV] add JIT relocations resolver Function calls support in LLDB expressions for RISCV: 2 of 4 Adds required RISCV relocations resolving functionality in lldb ExecutionEngine. [lldb][RISCV] RISC-V large code model in lldb expressions Function calls support in LLDB expressions for RISCV: 3 of 4 This patch sets large code model in MCJIT settings for RISC-V 64-bit targets that allows to make assembly jumps at any 64bit address. This is needed, because resulted jitted code may contain more that +-2GB jumps, that are not available in RISC-V with medium code model. [lldb][RISCV] doubles support in lldb expressions Function calls support in LLDB expressions for RISCV: 4 of 4 This patch adds desired feature flags in MCJIT compiler to enable hard-float instructions if target supports them and allows to use floats and doubles in lldb expressions.
Diffstat (limited to 'lldb/source/Expression/IRExecutionUnit.cpp')
-rw-r--r--lldb/source/Expression/IRExecutionUnit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp
index 15ca2ddbbae0..baf70cbccc8c 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -277,6 +277,12 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
.setMCJITMemoryManager(std::make_unique<MemoryManager>(*this))
.setOptLevel(llvm::CodeGenOptLevel::Less);
+ // Resulted jitted code can be placed too far from the code in the binary
+ // and thus can contain more than +-2GB jumps, that are not available
+ // in RISC-V without large code model.
+ if (triple.isRISCV64())
+ builder.setCodeModel(llvm::CodeModel::Large);
+
llvm::StringRef mArch;
llvm::StringRef mCPU;
llvm::SmallVector<std::string, 0> mAttrs;