diff options
author | Sean Callanan <scallanan@apple.com> | 2012-12-01 00:08:33 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2012-12-01 00:08:33 +0000 |
commit | 70385081c91c9de927e3f0e5708097c0951cc080 (patch) | |
tree | 890d6bbfae0a3bbd623161d9f46ab02f2ddf06b2 | |
parent | 9c2ecd93d016454fa697c29744c8815b2c695fb7 (diff) | |
download | bcm5719-llvm-70385081c91c9de927e3f0e5708097c0951cc080.tar.gz bcm5719-llvm-70385081c91c9de927e3f0e5708097c0951cc080.zip |
Added logging to the code that determines
whether the current frame is in a C++/Objective-C
class or instance method.
llvm-svn: 169062
-rw-r--r-- | lldb/source/Expression/ClangUserExpression.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 91cb886f126..231432d29e0 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -106,31 +106,56 @@ ClangUserExpression::ASTTransformer (clang::ASTConsumer *passthrough) void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Error &err) { + lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); + + if (log) + log->Printf("ClangUserExpression::ScanContext()"); + m_target = exe_ctx.GetTargetPtr(); if (!(m_allow_cxx || m_allow_objc)) + { + if (log) + log->Printf(" [CUE::SC] Settings inhibit C++ and Objective-C"); return; + } StackFrame *frame = exe_ctx.GetFramePtr(); if (frame == NULL) + { + if (log) + log->Printf(" [CUE::SC] Null stack frame"); return; + } SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction | lldb::eSymbolContextBlock); if (!sym_ctx.function) + { + if (log) + log->Printf(" [CUE::SC] Null function"); return; + } // Find the block that defines the function represented by "sym_ctx" Block *function_block = sym_ctx.GetFunctionBlock(); if (!function_block) + { + if (log) + log->Printf(" [CUE::SC] Null function block"); return; + } clang::DeclContext *decl_context = function_block->GetClangDeclContext(); if (!decl_context) + { + if (log) + log->Printf(" [CUE::SC] Null decl context"); return; - + } + if (clang::CXXMethodDecl *method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(decl_context)) { if (m_allow_cxx && method_decl->isInstance()) |