LLDB mainline
|
"lldb/Expression/ClangUserExpression.h" Encapsulates a single expression for use with Clang More...
#include <ClangUserExpression.h>
Classes | |
class | ClangUserExpressionHelper |
class | ResultDelegate |
Public Types | |
enum | { kDefaultTimeout = 500000u } |
Public Types inherited from lldb_private::UserExpression | |
enum | { kDefaultTimeout = 500000u } |
Public Types inherited from lldb_private::Expression | |
enum | ResultType { eResultTypeAny , eResultTypeId } |
Public Member Functions | |
bool | isA (const void *ClassID) const override |
ClangUserExpression (ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, SourceLanguage language, ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj) | |
Constructor. | |
~ClangUserExpression () override | |
bool | Parse (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, bool keep_result_in_memory, bool generate_debug_info) override |
Parse the expression. | |
bool | Complete (ExecutionContext &exe_ctx, CompletionRequest &request, unsigned complete_pos) override |
Attempts to find possible command line completions for the given (possible incomplete) user expression. | |
ExpressionTypeSystemHelper * | GetTypeSystemHelper () override |
ClangExpressionDeclMap * | DeclMap () |
void | ResetDeclMap () |
void | ResetDeclMap (ExecutionContext &exe_ctx, Materializer::PersistentVariableDelegate &result_delegate, bool keep_result_in_memory) |
lldb::ExpressionVariableSP | GetResultAfterDematerialization (ExecutionContextScope *exe_scope) override |
bool | DidImportCxxModules () const |
Returns true iff this expression is using any imported C++ modules. | |
Public Member Functions inherited from lldb_private::LLVMUserExpression | |
bool | isA (const void *ClassID) const override |
LLVMUserExpression (ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, SourceLanguage language, ResultType desired_type, const EvaluateExpressionOptions &options) | |
~LLVMUserExpression () override | |
bool | FinalizeJITExecution (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb::ExpressionVariableSP &result, lldb::addr_t function_stack_bottom=LLDB_INVALID_ADDRESS, lldb::addr_t function_stack_top=LLDB_INVALID_ADDRESS) override |
Apply the side effects of the function to program state. | |
bool | CanInterpret () override |
Materializer * | GetMaterializer () override |
Return the Materializer that the parser should use when registering external values. | |
const char * | Text () override |
Return the string that the parser should parse. | |
Public Member Functions inherited from lldb_private::UserExpression | |
bool | isA (const void *ClassID) const override |
UserExpression (ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, SourceLanguage language, ResultType desired_type, const EvaluateExpressionOptions &options) | |
Constructor. | |
~UserExpression () override | |
Destructor. | |
virtual bool | Parse (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, bool keep_result_in_memory, bool generate_debug_info)=0 |
Parse the expression. | |
virtual bool | Complete (ExecutionContext &exe_ctx, CompletionRequest &request, unsigned complete_pos) |
Attempts to find possible command line completions for the given (possible incomplete) user expression. | |
virtual bool | CanInterpret ()=0 |
bool | MatchesContext (ExecutionContext &exe_ctx) |
lldb::ExpressionResults | Execute (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result) |
Execute the parsed expression by callinng the derived class's DoExecute method. | |
virtual bool | FinalizeJITExecution (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb::ExpressionVariableSP &result, lldb::addr_t function_stack_bottom=LLDB_INVALID_ADDRESS, lldb::addr_t function_stack_top=LLDB_INVALID_ADDRESS)=0 |
Apply the side effects of the function to program state. | |
const char * | Text () override |
Return the string that the parser should parse. | |
const char * | GetUserText () |
Return the string that the user typed. | |
const char * | FunctionName () override |
Return the function name that should be used for executing the expression. | |
virtual bool | IsParseCacheable () |
Returns whether the call to Parse on this user expression is cacheable. | |
SourceLanguage | Language () const override |
Return the language that should be used when parsing. | |
ResultType | DesiredResultType () const override |
Return the desired result type of the function, or eResultTypeAny if indifferent. | |
bool | NeedsValidation () override |
Return true if validation code should be inserted into the expression. | |
bool | NeedsVariableResolution () override |
Return true if external variables in the expression should be resolved. | |
EvaluateExpressionOptions * | GetOptions () override |
virtual lldb::ExpressionVariableSP | GetResultAfterDematerialization (ExecutionContextScope *exe_scope) |
llvm::StringRef | GetFixedText () |
Public Member Functions inherited from lldb_private::Expression | |
Expression (Target &target) | |
Expression (ExecutionContextScope &exe_scope) | |
virtual | ~Expression ()=default |
Destructor. | |
virtual const char * | Text ()=0 |
Return the string that the parser should parse. | |
virtual const char * | FunctionName ()=0 |
Return the function name that should be used for executing the expression. | |
virtual SourceLanguage | Language () const |
Return the language that should be used when parsing. | |
virtual Materializer * | GetMaterializer () |
Return the Materializer that the parser should use when registering external values. | |
virtual ResultType | DesiredResultType () const |
Return the desired result type of the function, or eResultTypeAny if indifferent. | |
virtual bool | NeedsValidation ()=0 |
Flags. | |
virtual bool | NeedsVariableResolution ()=0 |
Return true if external variables in the expression should be resolved. | |
virtual EvaluateExpressionOptions * | GetOptions () |
lldb::addr_t | StartAddress () |
Return the address of the function's JIT-compiled code, or LLDB_INVALID_ADDRESS if the function is not JIT compiled. | |
virtual void | WillStartExecuting () |
Called to notify the expression that it is about to be executed. | |
virtual void | DidFinishExecuting () |
Called to notify the expression that its execution has finished. | |
virtual ExpressionTypeSystemHelper * | GetTypeSystemHelper () |
virtual bool | isA (const void *ClassID) const =0 |
Static Public Member Functions | |
static bool | classof (const Expression *obj) |
Static Public Member Functions inherited from lldb_private::LLVMUserExpression | |
static bool | classof (const Expression *obj) |
Static Public Member Functions inherited from lldb_private::UserExpression | |
static bool | classof (const Expression *obj) |
static lldb::ExpressionResults | Evaluate (ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, llvm::StringRef expr_cstr, llvm::StringRef expr_prefix, lldb::ValueObjectSP &result_valobj_sp, Status &error, std::string *fixed_expression=nullptr, ValueObject *ctx_obj=nullptr) |
Evaluate one expression in the scratch context of the target passed in the exe_ctx and return its result. | |
Private Member Functions | |
bool | TryParse (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, bool keep_result_in_memory, bool generate_debug_info) |
Populate m_in_cplusplus_method and m_in_objectivec_method based on the environment. | |
void | SetupCppModuleImports (ExecutionContext &exe_ctx) |
void | ScanContext (ExecutionContext &exe_ctx, lldb_private::Status &err) override |
bool | AddArguments (ExecutionContext &exe_ctx, std::vector< lldb::addr_t > &args, lldb::addr_t struct_address, DiagnosticManager &diagnostic_manager) override |
void | CreateSourceCode (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, std::vector< std::string > modules_to_import, bool for_completion) |
lldb::addr_t | GetCppObjectPointer (lldb::StackFrameSP frame, llvm::StringRef object_name, Status &err) |
ClangExpressionSourceCode::WrapKind | GetWrapKind () const |
Defines how the current expression should be wrapped. | |
bool | SetupPersistentState (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx) |
bool | PrepareForParsing (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, bool for_completion) |
Private Attributes | |
ClangUserExpressionHelper | m_type_system_helper |
std::vector< std::string > | m_include_directories |
The include directories that should be used when parsing the expression. | |
std::optional< size_t > | m_user_expression_start_pos |
The absolute character position in the transformed source code where the user code (as typed by the user) starts. | |
ResultDelegate | m_result_delegate |
ClangPersistentVariables * | m_clang_state |
std::unique_ptr< ClangExpressionSourceCode > | m_source_code |
std::unique_ptr< ClangExpressionParser > | m_parser |
The parser instance we used to parse the expression. | |
std::string | m_filename |
File name used for the expression. | |
ValueObject * | m_ctx_obj |
The object (if any) in which context the expression is evaluated. | |
std::vector< std::string > | m_imported_cpp_modules |
A list of module names that should be imported when parsing. | |
bool | m_enforce_valid_object = true |
True if the expression parser should enforce the presence of a valid class pointer in order to generate the expression as a method. | |
bool | m_in_cplusplus_method = false |
True if the expression is compiled as a C++ member function (true if it was parsed when exe_ctx was in a C++ method). | |
bool | m_in_objectivec_method = false |
True if the expression is compiled as an Objective-C method (true if it was parsed when exe_ctx was in an Objective-C method). | |
bool | m_in_static_method = false |
True if the expression is compiled as a static (or class) method (currently true if it was parsed when exe_ctx was in an Objective-C class method). | |
bool | m_needs_object_ptr = false |
True if "this" or "self" must be looked up and passed in. | |
Static Private Attributes | |
static char | ID |
Additional Inherited Members | |
Static Public Attributes inherited from lldb_private::UserExpression | |
static const Status::ValueType | kNoResult |
ValueObject::GetError() returns this if there is no result from the expression. | |
Protected Member Functions inherited from lldb_private::LLVMUserExpression | |
lldb::ExpressionResults | DoExecute (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result) override |
virtual void | ScanContext (ExecutionContext &exe_ctx, lldb_private::Status &err)=0 |
bool | PrepareToExecuteJITExpression (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb::addr_t &struct_address) |
virtual bool | AddArguments (ExecutionContext &exe_ctx, std::vector< lldb::addr_t > &args, lldb::addr_t struct_address, DiagnosticManager &diagnostic_manager)=0 |
Protected Member Functions inherited from lldb_private::UserExpression | |
virtual lldb::ExpressionResults | DoExecute (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result)=0 |
void | InstallContext (ExecutionContext &exe_ctx) |
Populate m_in_cplusplus_method and m_in_objectivec_method based on the environment. | |
bool | LockAndCheckContext (ExecutionContext &exe_ctx, lldb::TargetSP &target_sp, lldb::ProcessSP &process_sp, lldb::StackFrameSP &frame_sp) |
Static Protected Member Functions inherited from lldb_private::UserExpression | |
static lldb::addr_t | GetObjectPointer (lldb::StackFrameSP frame_sp, llvm::StringRef object_name, Status &err) |
static lldb::ValueObjectSP | GetObjectPointerValueObject (lldb::StackFrameSP frame, llvm::StringRef object_name, Status &err) |
Return ValueObject for a given variable name in the current stack frame. | |
Protected Attributes inherited from lldb_private::LLVMUserExpression | |
lldb::addr_t | m_stack_frame_bottom |
The bottom of the allocated stack frame. | |
lldb::addr_t | m_stack_frame_top |
The top of the allocated stack frame. | |
bool | m_allow_cxx |
True if the language allows C++. | |
bool | m_allow_objc |
True if the language allows Objective-C. | |
std::string | m_transformed_text |
The text of the expression, as send to the parser. | |
std::shared_ptr< IRExecutionUnit > | m_execution_unit_sp |
The execution unit the expression is stored in. | |
std::unique_ptr< Materializer > | m_materializer_up |
The materializer to use when running the expression. | |
lldb::ModuleWP | m_jit_module_wp |
Target * | m_target |
The target for storing persistent data like types and variables. | |
bool | m_can_interpret |
True if the expression could be evaluated statically; false otherwise. | |
lldb::addr_t | m_materialized_address |
The address at which the arguments to the expression have been materialized. | |
Materializer::DematerializerSP | m_dematerializer_sp |
The dematerializer. | |
Protected Attributes inherited from lldb_private::UserExpression | |
Address | m_address |
The address the process is stopped in. | |
std::string | m_expr_text |
The text of the expression, as typed by the user. | |
std::string | m_expr_prefix |
The text of the translation-level definitions, as provided by the user. | |
std::string | m_fixed_text |
The text of the expression with fix-its applied this won't be set if the fixed text doesn't parse. | |
SourceLanguage | m_language |
The language to use when parsing (unknown means use defaults). | |
ResultType | m_desired_type |
The type to coerce the expression's result to. | |
EvaluateExpressionOptions | m_options |
Additional options provided by the user. | |
Protected Attributes inherited from lldb_private::Expression | |
lldb::TargetWP | m_target_wp |
lldb::ProcessWP | m_jit_process_wp |
Expression's always have to have a target... | |
lldb::addr_t | m_jit_start_addr |
An expression might have a process, but it doesn't need to (e.g. | |
lldb::addr_t | m_jit_end_addr |
The address of the JITted function within the JIT allocation. | |
"lldb/Expression/ClangUserExpression.h" Encapsulates a single expression for use with Clang
LLDB uses expressions for various purposes, notably to call functions and as a backend for the expr command. ClangUserExpression encapsulates the objects needed to parse and interpret or JIT an expression. It uses the Clang parser to produce LLVM IR from the expression.
Definition at line 42 of file ClangUserExpression.h.
anonymous enum |
Enumerator | |
---|---|
kDefaultTimeout |
Definition at line 52 of file ClangUserExpression.h.
ClangUserExpression::ClangUserExpression | ( | ExecutionContextScope & | exe_scope, |
llvm::StringRef | expr, | ||
llvm::StringRef | prefix, | ||
SourceLanguage | language, | ||
ResultType | desired_type, | ||
const EvaluateExpressionOptions & | options, | ||
ValueObject * | ctx_obj | ||
) |
Constructor.
[in] | expr | The expression to parse. |
[in] | prefix | If non-NULL, a C string containing translation-unit level definitions to be included when the expression is parsed. |
[in] | language | If not unknown, a language to use when parsing the expression. Currently restricted to those languages supported by Clang. |
[in] | desired_type | If not eResultTypeAny, the type to use for the expression result. |
[in] | options | Additional options for the expression. |
[in] | ctx_obj | The object (if any) in which context the expression must be evaluated. For details see the comment to UserExpression::Evaluate . |
Definition at line 65 of file ClangUserExpression.cpp.
References lldb_private::LLVMUserExpression::m_allow_cxx, lldb_private::LLVMUserExpression::m_allow_objc, lldb_private::UserExpression::m_language, and lldb_private::SourceLanguage::name.
|
overridedefault |
|
overrideprivatevirtual |
Implements lldb_private::LLVMUserExpression.
Definition at line 873 of file ClangUserExpression.cpp.
References lldb_private::Status::AsCString(), lldb_private::eAddressTypeLoad, lldb::eSeverityError, lldb::eSeverityWarning, lldb_private::ValueObject::GetAddressOf(), lldb_private::Debugger::GetAsyncOutputStream(), GetCppObjectPointer(), lldb_private::Target::GetDebugger(), lldb_private::ExecutionContext::GetFrameSP(), lldb_private::UserExpression::GetObjectPointer(), lldb_private::ExecutionContext::GetTargetRef(), LLDB_INVALID_ADDRESS, m_ctx_obj, m_in_cplusplus_method, m_in_objectivec_method, m_needs_object_ptr, lldb_private::DiagnosticManager::Printf(), lldb_private::DiagnosticManager::PutString(), lldb_private::Status::SetErrorString(), and lldb_private::Status::Success().
|
inlinestatic |
Definition at line 50 of file ClangUserExpression.h.
References ID, and lldb_private::Expression::isA().
|
overridevirtual |
Attempts to find possible command line completions for the given (possible incomplete) user expression.
[in] | exe_ctx | The execution context to use when looking up entities that are needed for parsing and completing (locations of functions, types of variables, persistent variables, etc.) |
[out] | request | The completion request to fill out. The completion should be a string that would complete the current token at the cursor position. Note that the string in the list replaces the current token in the command line. |
[in] | complete_pos | The position of the cursor inside the user expression string. The completion process starts on the token that the cursor is in. |
Reimplemented from lldb_private::UserExpression.
Definition at line 783 of file ClangUserExpression.cpp.
References AbsPosToLineColumnPos(), lldb_private::ClangExpressionParser::Complete(), DeclMap(), lldb_private::eExecutionPolicyTopLevel, lldb::eSeverityError, lldb_private::Expressions, lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::EvaluateExpressionOptions::GetExecutionPolicy(), lldb_private::GetLog(), lldb_private::LLVMUserExpression::GetMaterializer(), LLDB_LOGF, lldb_private::LLVMUserExpression::m_materializer_up, lldb_private::UserExpression::m_options, m_result_delegate, lldb_private::LLVMUserExpression::m_transformed_text, m_user_expression_start_pos, PrepareForParsing(), lldb_private::DiagnosticManager::PutString(), ResetDeclMap(), lldb_private::ClangASTSource::SetLookupsEnabled(), and lldb_private::ClangExpressionDeclMap::WillParse().
|
private |
Definition at line 412 of file ClangUserExpression.cpp.
References lldb_private::ClangExpressionSourceCode::CreateWrapped(), lldb_private::eExecutionPolicyTopLevel, lldb::eSeverityError, lldb_private::EvaluateExpressionOptions::GetExecutionPolicy(), GetWrapKind(), m_ctx_obj, lldb_private::UserExpression::m_expr_prefix, lldb_private::UserExpression::m_expr_text, m_filename, lldb_private::UserExpression::m_options, m_source_code, lldb_private::LLVMUserExpression::m_transformed_text, m_user_expression_start_pos, and lldb_private::DiagnosticManager::PutString().
Referenced by Parse(), and PrepareForParsing().
|
inline |
Definition at line 162 of file ClangUserExpression.h.
References lldb_private::ClangUserExpression::ClangUserExpressionHelper::DeclMap(), and m_type_system_helper.
Referenced by Complete(), and TryParse().
|
inline |
Returns true iff this expression is using any imported C++ modules.
Definition at line 178 of file ClangUserExpression.h.
References m_imported_cpp_modules.
|
private |
Definition at line 846 of file ClangUserExpression.cpp.
References lldb_private::UserExpression::GetObjectPointerValueObject(), LLDB_INVALID_ADDRESS, lldb_private::Status::SetErrorStringWithFormatv(), and lldb_private::Status::Success().
Referenced by AddArguments().
|
overridevirtual |
Reimplemented from lldb_private::UserExpression.
Definition at line 948 of file ClangUserExpression.cpp.
References lldb_private::ClangUserExpression::ResultDelegate::GetVariable(), and m_result_delegate.
|
inlineoverridevirtual |
Reimplemented from lldb_private::Expression.
Definition at line 158 of file ClangUserExpression.h.
References m_type_system_helper.
|
private |
Defines how the current expression should be wrapped.
Definition at line 396 of file ClangUserExpression.cpp.
References lldb_private::eExecutionPolicyTopLevel, lldb_private::EvaluateExpressionOptions::GetExecutionPolicy(), m_in_cplusplus_method, m_in_objectivec_method, m_in_static_method, and lldb_private::UserExpression::m_options.
Referenced by CreateSourceCode().
|
inlineoverridevirtual |
Reimplemented from lldb_private::LLVMUserExpression.
Definition at line 47 of file ClangUserExpression.h.
References ID, and lldb_private::LLVMUserExpression::isA().
|
overridevirtual |
Parse the expression.
[in] | diagnostic_manager | A diagnostic manager to report parse errors and warnings to. |
[in] | exe_ctx | The execution context to use when looking up entities that are needed for parsing (locations of functions, types of variables, persistent variables, etc.) |
[in] | execution_policy | Determines whether interpretation is possible or mandatory. |
[in] | keep_result_in_memory | True if the resulting persistent variable should reside in target memory, if applicable. |
Implements lldb_private::UserExpression.
Definition at line 646 of file ClangUserExpression.cpp.
References lldb_private::ModuleList::Append(), lldb_private::SourceLanguage::AsLanguageType(), CreateSourceCode(), lldb_private::eExecutionPolicyTopLevel, lldb::eSeverityError, lldb_private::Expressions, lldb_private::UserExpression::FunctionName(), lldb_private::EvaluateExpressionOptions::GetExecutionPolicy(), lldb_private::Target::GetImages(), lldb_private::GetLog(), lldb_private::Target::GetPersistentExpressionStateForLanguage(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::ExecutionContext::GetTargetPtr(), LLDB_INVALID_ADDRESS, LLDB_LOGF, lldb_private::LLVMUserExpression::m_execution_unit_sp, m_imported_cpp_modules, lldb_private::LLVMUserExpression::m_jit_module_wp, lldb_private::Expression::m_jit_process_wp, lldb_private::Expression::m_jit_start_addr, lldb_private::UserExpression::m_language, lldb_private::UserExpression::m_options, lldb_private::LLVMUserExpression::m_transformed_text, PrepareForParsing(), lldb_private::DiagnosticManager::PutString(), lldb_private::FileSpec::SetFilename(), SetupCppModuleImports(), shouldRetryWithCppModule(), and TryParse().
|
private |
Definition at line 521 of file ClangUserExpression.cpp.
References ApplyObjcCastHack(), lldb_private::Status::AsCString(), CreateSourceCode(), lldb_private::eImportStdModuleTrue, lldb::eSeverityWarning, lldb_private::TargetProperties::GetImportStdModule(), lldb_private::ClangPersistentVariables::GetNextExprFileName(), lldb_private::UserExpression::InstallContext(), m_clang_state, lldb_private::UserExpression::m_expr_text, m_filename, m_imported_cpp_modules, lldb_private::LLVMUserExpression::m_target, lldb_private::DiagnosticManager::PutString(), ScanContext(), SetupCppModuleImports(), SetupDeclVendor(), SetupPersistentState(), and lldb_private::Status::Success().
Referenced by Complete(), and Parse().
|
inline |
Definition at line 164 of file ClangUserExpression.h.
References m_type_system_helper, and lldb_private::ClangUserExpression::ClangUserExpressionHelper::ResetDeclMap().
Referenced by Complete(), and TryParse().
|
inline |
Definition at line 166 of file ClangUserExpression.h.
References m_ctx_obj, m_type_system_helper, and lldb_private::ClangUserExpression::ClangUserExpressionHelper::ResetDeclMap().
|
overrideprivatevirtual |
Implements lldb_private::LLVMUserExpression.
Definition at line 91 of file ClangUserExpression.cpp.
References lldb_private::TypeSystemClang::DeclContextGetAsCXXMethodDecl(), lldb_private::TypeSystemClang::DeclContextGetAsFunctionDecl(), lldb_private::TypeSystemClang::DeclContextGetAsObjCMethodDecl(), lldb_private::TypeSystemClang::DeclContextGetMetaData(), lldb::eLanguageTypeC, lldb::eLanguageTypeC11, lldb::eLanguageTypeC89, lldb::eLanguageTypeC99, lldb::eLanguageTypeC_plus_plus, lldb::eLanguageTypeC_plus_plus_03, lldb::eLanguageTypeC_plus_plus_11, lldb::eLanguageTypeC_plus_plus_14, lldb::eLanguageTypeObjC, lldb::eLanguageTypeObjC_plus_plus, lldb_private::Expressions, lldb_private::SymbolContext::function, lldb_private::Block::GetBlockVariableList(), lldb_private::Block::GetDeclContext(), lldb_private::Type::GetForwardCompilerType(), lldb_private::ExecutionContext::GetFramePtr(), lldb_private::SymbolContext::GetFunctionBlock(), lldb_private::GetLog(), lldb_private::ValueObject::GetObjectRuntimeLanguage(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::TypeSystemClang::IsObjCClassType(), lldb_private::TypeSystemClang::IsObjCObjectPointerType(), LLDB_LOGF, lldb_private::LLVMUserExpression::m_allow_cxx, lldb_private::LLVMUserExpression::m_allow_objc, m_ctx_obj, m_enforce_valid_object, m_in_cplusplus_method, m_in_objectivec_method, m_in_static_method, m_needs_object_ptr, lldb_private::LLVMUserExpression::m_target, and lldb_private::Status::SetErrorString().
Referenced by PrepareForParsing().
|
private |
Definition at line 623 of file ClangUserExpression.cpp.
References lldb_private::SourceLanguage::AsLanguageType(), lldb_private::Expressions, lldb_private::CppModuleConfiguration::GetImportedModules(), lldb_private::CppModuleConfiguration::GetIncludeDirs(), lldb_private::GetLog(), GetModuleConfig(), LLDB_LOG, m_imported_cpp_modules, m_include_directories, and lldb_private::UserExpression::m_language.
Referenced by Parse(), and PrepareForParsing().
|
private |
Definition at line 325 of file ClangUserExpression.cpp.
References lldb::eLanguageTypeC, lldb::eSeverityError, lldb_private::ExecutionContext::GetTargetPtr(), m_clang_state, m_result_delegate, lldb_private::DiagnosticManager::PutString(), and lldb_private::ClangUserExpression::ResultDelegate::RegisterPersistentState().
Referenced by PrepareForParsing().
|
private |
Populate m_in_cplusplus_method and m_in_objectivec_method based on the environment.
Contains the actual parsing implementation. The parameter have the same meaning as in ClangUserExpression::Parse.
Definition at line 554 of file ClangUserExpression.cpp.
References lldb_private::Status::AsCString(), DeclMap(), lldb_private::eExecutionPolicyTopLevel, lldb::eSeverityError, lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::EvaluateExpressionOptions::GetExecutionPolicy(), lldb_private::DiagnosticManager::GetFixedExpression(), lldb_private::LLVMUserExpression::GetMaterializer(), lldb_private::DiagnosticManager::HasFixIts(), lldb_private::LLVMUserExpression::m_can_interpret, lldb_private::LLVMUserExpression::m_execution_unit_sp, m_filename, lldb_private::UserExpression::m_fixed_text, m_include_directories, lldb_private::Expression::m_jit_end_addr, lldb_private::Expression::m_jit_start_addr, lldb_private::LLVMUserExpression::m_materializer_up, lldb_private::UserExpression::m_options, m_parser, m_result_delegate, m_source_code, lldb_private::DiagnosticManager::PutString(), ResetDeclMap(), lldb_private::ClangASTSource::SetLookupsEnabled(), lldb_private::Status::Success(), and lldb_private::ClangExpressionDeclMap::WillParse().
Referenced by Parse().
|
staticprivate |
Definition at line 44 of file ClangUserExpression.h.
|
private |
Definition at line 241 of file ClangUserExpression.h.
Referenced by PrepareForParsing(), and SetupPersistentState().
|
private |
The object (if any) in which context the expression is evaluated.
See the comment to UserExpression::Evaluate
for details.
Definition at line 250 of file ClangUserExpression.h.
Referenced by AddArguments(), CreateSourceCode(), ResetDeclMap(), and ScanContext().
|
private |
True if the expression parser should enforce the presence of a valid class pointer in order to generate the expression as a method.
Definition at line 258 of file ClangUserExpression.h.
Referenced by ScanContext().
|
private |
File name used for the expression.
Definition at line 246 of file ClangUserExpression.h.
Referenced by CreateSourceCode(), PrepareForParsing(), and TryParse().
|
private |
A list of module names that should be imported when parsing.
Definition at line 254 of file ClangUserExpression.h.
Referenced by DidImportCxxModules(), Parse(), PrepareForParsing(), and SetupCppModuleImports().
|
private |
True if the expression is compiled as a C++ member function (true if it was parsed when exe_ctx was in a C++ method).
Definition at line 261 of file ClangUserExpression.h.
Referenced by AddArguments(), GetWrapKind(), and ScanContext().
|
private |
True if the expression is compiled as an Objective-C method (true if it was parsed when exe_ctx was in an Objective-C method).
Definition at line 264 of file ClangUserExpression.h.
Referenced by AddArguments(), GetWrapKind(), and ScanContext().
|
private |
True if the expression is compiled as a static (or class) method (currently true if it was parsed when exe_ctx was in an Objective-C class method).
Definition at line 268 of file ClangUserExpression.h.
Referenced by GetWrapKind(), and ScanContext().
|
private |
The include directories that should be used when parsing the expression.
Definition at line 234 of file ClangUserExpression.h.
Referenced by SetupCppModuleImports(), and TryParse().
|
private |
True if "this" or "self" must be looked up and passed in.
False if the expression doesn't really use them and they can be NULL.
Definition at line 271 of file ClangUserExpression.h.
Referenced by AddArguments(), and ScanContext().
|
private |
The parser instance we used to parse the expression.
Definition at line 244 of file ClangUserExpression.h.
Referenced by TryParse().
|
private |
Definition at line 240 of file ClangUserExpression.h.
Referenced by Complete(), GetResultAfterDematerialization(), SetupPersistentState(), and TryParse().
|
private |
Definition at line 242 of file ClangUserExpression.h.
Referenced by CreateSourceCode(), and TryParse().
|
private |
Definition at line 216 of file ClangUserExpression.h.
Referenced by DeclMap(), GetTypeSystemHelper(), and ResetDeclMap().
|
private |
The absolute character position in the transformed source code where the user code (as typed by the user) starts.
If the variable is empty, then we were not able to calculate this position.
Definition at line 239 of file ClangUserExpression.h.
Referenced by Complete(), and CreateSourceCode().