From ece96492648552c5ed55ceaf896fa89ad84d99d5 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Mon, 8 Nov 2010 03:49:50 +0000 Subject: 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. llvm-svn: 118401 --- lldb/source/Target/ThreadPlanCallFunction.cpp | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'lldb/source/Target/ThreadPlanCallFunction.cpp') diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index 8db2d2b82d2..95a7d0d8047 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -89,6 +89,25 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, 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 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, *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; } -- cgit v1.2.3