Added more logging so we see the register state
when a function starts and ends, and also the
disassembly for anything that is a client of
ClangExpressionParser after it has been JIT
compiled.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118401 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/ThreadPlanCallFunction.cpp b/source/Target/ThreadPlanCallFunction.cpp
index 8db2d2b..95a7d0d 100644
--- a/source/Target/ThreadPlanCallFunction.cpp
+++ b/source/Target/ThreadPlanCallFunction.cpp
@@ -89,6 +89,25 @@
this_arg))
return;
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
+
+ if (log)
+ {
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+
+ log->PutCString("Function call was set up. Register state was:");
+
+ for (uint32_t register_index = 0, num_registers = reg_ctx->GetRegisterCount();
+ register_index < num_registers;
+ ++register_index)
+ {
+ const char *register_name = reg_ctx->GetRegisterName(register_index);
+ uint64_t register_value = reg_ctx->ReadRegisterAsUnsigned(register_index, LLDB_INVALID_ADDRESS);
+
+ log->Printf(" %s = 0x%llx", register_name, register_value);
+ }
+ }
+
m_valid = true;
}
@@ -145,6 +164,25 @@
*m_args))
return;
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
+
+ if (log)
+ {
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+
+ log->PutCString("Function call was set up. Register state was:");
+
+ for (uint32_t register_index = 0, num_registers = reg_ctx->GetRegisterCount();
+ register_index < num_registers;
+ ++register_index)
+ {
+ const char *register_name = reg_ctx->GetRegisterName(register_index);
+ uint64_t register_value = reg_ctx->ReadRegisterAsUnsigned(register_index, LLDB_INVALID_ADDRESS);
+
+ log->Printf(" %s = 0x%llx", register_name, register_value);
+ }
+ }
+
m_valid = true;
}