forked from OSchip/llvm-project
Added a little bit of logging to ClangFunction to
make it more obvious what's going on. llvm-svn: 176575
This commit is contained in:
parent
60cdeb6aa8
commit
f58b12d8eb
|
@ -407,6 +407,11 @@ ClangFunction::GetThreadPlanToCallFunction (ExecutionContext &exe_ctx,
|
|||
lldb::addr_t *this_arg,
|
||||
lldb::addr_t *cmd_arg)
|
||||
{
|
||||
lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
|
||||
|
||||
if (log)
|
||||
log->Printf("-- [ClangFunction::GetThreadPlanToCallFunction] Creating thread plan to call function --");
|
||||
|
||||
// FIXME: Use the errors Stream for better error reporting.
|
||||
Thread *thread = exe_ctx.GetThreadPtr();
|
||||
if (thread == NULL)
|
||||
|
@ -439,6 +444,12 @@ ClangFunction::FetchFunctionResults (ExecutionContext &exe_ctx, lldb::addr_t arg
|
|||
// FIXME: How does clang tell us there's no return value? We need to handle that case.
|
||||
// FIXME: Create our ThreadPlanCallFunction with the return ClangASTType, and then use GetReturnValueObject
|
||||
// to fetch the value. That way we can fetch any values we need.
|
||||
|
||||
lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
|
||||
|
||||
if (log)
|
||||
log->Printf("-- [ClangFunction::FetchFunctionResults] Fetching function results --");
|
||||
|
||||
Process *process = exe_ctx.GetProcessPtr();
|
||||
|
||||
if (process == NULL)
|
||||
|
@ -516,6 +527,11 @@ ClangFunction::ExecuteFunction (
|
|||
Stream &errors,
|
||||
lldb::addr_t *this_arg)
|
||||
{
|
||||
lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
|
||||
|
||||
if (log)
|
||||
log->Printf("== [ClangFunction::ExecuteFunction] Executing function ==");
|
||||
|
||||
lldb::ThreadPlanSP call_plan_sp (ClangFunction::GetThreadPlanToCallFunction (exe_ctx,
|
||||
function_address,
|
||||
void_arg,
|
||||
|
@ -540,6 +556,18 @@ ClangFunction::ExecuteFunction (
|
|||
timeout_usec,
|
||||
errors);
|
||||
|
||||
if (log)
|
||||
{
|
||||
if (results != eExecutionCompleted)
|
||||
{
|
||||
log->Printf("== [ClangFunction::ExecuteFunction] Execution completed abnormally ==");
|
||||
}
|
||||
else
|
||||
{
|
||||
log->Printf("== [ClangFunction::ExecuteFunction] Execution completed normally ==");
|
||||
}
|
||||
}
|
||||
|
||||
if (exe_ctx.GetProcessPtr())
|
||||
exe_ctx.GetProcessPtr()->SetRunningUserExpression(false);
|
||||
|
||||
|
|
Loading…
Reference in New Issue