[Lldb-commits] [lldb] [llvm] [lldb][RISCV] function calls support in lldb expressions (PR #99336)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 19 10:43:28 PDT 2024


================
@@ -163,11 +166,83 @@ TotalArgsSizeInWords(bool is_rv64,
   return total_size;
 }
 
+static bool UpdateRegister(RegisterContext *reg_ctx,
+                           const lldb::RegisterKind reg_kind,
+                           const uint32_t reg_num, const addr_t value) {
+  Log *log = GetLog(LLDBLog::Expressions);
+
+  const RegisterInfo *reg_info = reg_ctx->GetRegisterInfo(reg_kind, reg_num);
+
+  LLDB_LOG(log, "Writing %s: 0x%" PRIx64, reg_info->name,
+           static_cast<uint64_t>(value));
+  if (!reg_ctx->WriteRegisterFromUnsigned(reg_info, value)) {
+    LLDB_LOG(log, "Writing %s: failed", reg_info->name);
----------------
JDevlieghere wrote:

You'll want to use `LLDB_LOGF` for printf-style formatters. `LLDB_LOG` (sans F) uses llvm's [formatv](https://llvm.org/doxygen/FormatVariadic_8h_source.html) formatters. 

https://github.com/llvm/llvm-project/pull/99336


More information about the lldb-commits mailing list