[Lldb-commits] [lldb] r118401 - in /lldb/trunk/source: Expression/ClangExpressionParser.cpp Expression/ClangUserExpression.cpp Target/ThreadPlanCallFunction.cpp
Sean Callanan
scallanan at apple.com
Sun Nov 7 19:49:50 PST 2010
Author: spyffe
Date: Sun Nov 7 21:49:50 2010
New Revision: 118401
URL: http://llvm.org/viewvc/llvm-project?rev=118401&view=rev
Log:
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.
Modified:
lldb/trunk/source/Expression/ClangExpressionParser.cpp
lldb/trunk/source/Expression/ClangUserExpression.cpp
lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=118401&r1=118400&r2=118401&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Sun Nov 7 21:49:50 2010
@@ -571,6 +571,24 @@
}
}
+ if (log)
+ {
+ log->Printf("Code can be run in the target.");
+
+ StreamString disassembly_stream;
+
+ Error err = DisassembleFunction(disassembly_stream, exe_ctx);
+
+ if (!err.Success())
+ {
+ log->Printf("Couldn't disassemble function : %s", err.AsCString("unknown error"));
+ }
+ else
+ {
+ log->Printf("Function disassembly:\n%s", disassembly_stream.GetData());
+ }
+ }
+
err.Clear();
return err;
}
Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=118401&r1=118400&r2=118401&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangUserExpression.cpp Sun Nov 7 21:49:50 2010
@@ -238,24 +238,6 @@
if (jit_error.Success())
{
- if (log)
- {
- log->Printf("Code can be run in the target.");
-
- StreamString disassembly_stream;
-
- Error err = parser.DisassembleFunction(disassembly_stream, exe_ctx);
-
- if (!err.Success())
- {
- log->Printf("Couldn't disassemble function : %s", err.AsCString("unknown error"));
- }
- else
- {
- log->Printf("Function disassembly:\n%s", disassembly_stream.GetData());
- }
- }
-
return true;
}
else
Modified: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallFunction.cpp?rev=118401&r1=118400&r2=118401&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Sun Nov 7 21:49:50 2010
@@ -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;
}
More information about the lldb-commits
mailing list