LLDB mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
lldb_private::ClangUserExpression Class Reference

"lldb/Expression/ClangUserExpression.h" Encapsulates a single expression for use with Clang More...

#include <ClangUserExpression.h>

Inheritance diagram for lldb_private::ClangUserExpression:
Inheritance graph
[legend]

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, lldb::LanguageType 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.
 
ExpressionTypeSystemHelperGetTypeSystemHelper () override
 
ClangExpressionDeclMapDeclMap ()
 
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, lldb::LanguageType 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
 
MaterializerGetMaterializer () 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, lldb::LanguageType 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.
 
lldb::LanguageType Language () const override
 Return the language that should be used when parsing.
 
ResultType DesiredResultType () 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.
 
EvaluateExpressionOptionsGetOptions () 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 lldb::LanguageType Language () const
 Return the language that should be used when parsing.
 
virtual MaterializerGetMaterializer ()
 Return the Materializer that the parser should use when registering external values.
 
virtual ResultType DesiredResultType ()
 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 EvaluateExpressionOptionsGetOptions ()
 
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 ExpressionTypeSystemHelperGetTypeSystemHelper ()
 
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
 
ClangPersistentVariablesm_clang_state
 
std::unique_ptr< ClangExpressionSourceCodem_source_code
 
std::unique_ptr< ClangExpressionParserm_parser
 The parser instance we used to parse the expression.
 
std::string m_filename
 File name used for the expression.
 
ValueObjectm_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< IRExecutionUnitm_execution_unit_sp
 The execution unit the expression is stored in.
 
std::unique_ptr< Materializerm_materializer_up
 The materializer to use when running the expression.
 
lldb::ModuleWP m_jit_module_wp
 
Targetm_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.
 
lldb::LanguageType m_language
 The language to use when parsing (eLanguageTypeUnknown 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.
 

Detailed Description

"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.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kDefaultTimeout 

Definition at line 52 of file ClangUserExpression.h.

Constructor & Destructor Documentation

◆ ClangUserExpression()

ClangUserExpression::ClangUserExpression ( ExecutionContextScope exe_scope,
llvm::StringRef  expr,
llvm::StringRef  prefix,
lldb::LanguageType  language,
ResultType  desired_type,
const EvaluateExpressionOptions options,
ValueObject ctx_obj 
)

Constructor.

Parameters
[in]exprThe expression to parse.
[in]prefixIf non-NULL, a C string containing translation-unit level definitions to be included when the expression is parsed.
[in]languageIf not eLanguageTypeUnknown, a language to use when parsing the expression. Currently restricted to those languages supported by Clang.
[in]desired_typeIf not eResultTypeAny, the type to use for the expression result.
[in]optionsAdditional options for the expression.
[in]ctx_objThe object (if any) in which context the expression must be evaluated. For details see the comment to UserExpression::Evaluate.

Definition at line 64 of file ClangUserExpression.cpp.

References lldb::eLanguageTypeC_plus_plus, lldb::eLanguageTypeObjC, lldb::eLanguageTypeObjC_plus_plus, lldb_private::LLVMUserExpression::m_allow_cxx, lldb_private::LLVMUserExpression::m_allow_objc, and lldb_private::UserExpression::m_language.

◆ ~ClangUserExpression()

ClangUserExpression::~ClangUserExpression ( )
overridedefault

Member Function Documentation

◆ AddArguments()

bool ClangUserExpression::AddArguments ( ExecutionContext exe_ctx,
std::vector< lldb::addr_t > &  args,
lldb::addr_t  struct_address,
DiagnosticManager diagnostic_manager 
)
overrideprivatevirtual

◆ classof()

static bool lldb_private::ClangUserExpression::classof ( const Expression obj)
inlinestatic

Definition at line 50 of file ClangUserExpression.h.

References ID, and lldb_private::Expression::isA().

◆ Complete()

bool ClangUserExpression::Complete ( ExecutionContext exe_ctx,
CompletionRequest request,
unsigned  complete_pos 
)
overridevirtual

Attempts to find possible command line completions for the given (possible incomplete) user expression.

Parameters
[in]exe_ctxThe 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]requestThe 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_posThe position of the cursor inside the user expression string. The completion process starts on the token that the cursor is in.
Returns
True if we added any completion results to the output; false otherwise.

Reimplemented from lldb_private::UserExpression.

Definition at line 800 of file ClangUserExpression.cpp.

References AbsPosToLineColumnPos(), lldb_private::ClangExpressionParser::Complete(), DeclMap(), lldb_private::eDiagnosticSeverityError, lldb_private::eExecutionPolicyTopLevel, 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().

◆ CreateSourceCode()

void ClangUserExpression::CreateSourceCode ( DiagnosticManager diagnostic_manager,
ExecutionContext exe_ctx,
std::vector< std::string >  modules_to_import,
bool  for_completion 
)
private

◆ DeclMap()

ClangExpressionDeclMap * lldb_private::ClangUserExpression::DeclMap ( )
inline

◆ DidImportCxxModules()

bool lldb_private::ClangUserExpression::DidImportCxxModules ( ) const
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.

◆ GetCppObjectPointer()

lldb::addr_t ClangUserExpression::GetCppObjectPointer ( lldb::StackFrameSP  frame,
llvm::StringRef  object_name,
Status err 
)
private

◆ GetResultAfterDematerialization()

lldb::ExpressionVariableSP ClangUserExpression::GetResultAfterDematerialization ( ExecutionContextScope exe_scope)
overridevirtual

◆ GetTypeSystemHelper()

ExpressionTypeSystemHelper * lldb_private::ClangUserExpression::GetTypeSystemHelper ( )
inlineoverridevirtual

Reimplemented from lldb_private::Expression.

Definition at line 158 of file ClangUserExpression.h.

References m_type_system_helper.

◆ GetWrapKind()

ClangExpressionSourceCode::WrapKind ClangUserExpression::GetWrapKind ( ) const
private

◆ isA()

bool lldb_private::ClangUserExpression::isA ( const void *  ClassID) const
inlineoverridevirtual

Reimplemented from lldb_private::LLVMUserExpression.

Definition at line 47 of file ClangUserExpression.h.

References ID, and lldb_private::LLVMUserExpression::isA().

◆ Parse()

bool ClangUserExpression::Parse ( DiagnosticManager diagnostic_manager,
ExecutionContext exe_ctx,
lldb_private::ExecutionPolicy  execution_policy,
bool  keep_result_in_memory,
bool  generate_debug_info 
)
overridevirtual

Parse the expression.

Parameters
[in]diagnostic_managerA diagnostic manager to report parse errors and warnings to.
[in]exe_ctxThe execution context to use when looking up entities that are needed for parsing (locations of functions, types of variables, persistent variables, etc.)
[in]execution_policyDetermines whether interpretation is possible or mandatory.
[in]keep_result_in_memoryTrue if the resulting persistent variable should reside in target memory, if applicable.
Returns
True on success (no errors); false otherwise.

Implements lldb_private::UserExpression.

Definition at line 646 of file ClangUserExpression.cpp.

References lldb_private::ModuleList::Append(), lldb_private::Status::AsCString(), CreateSourceCode(), lldb_private::eDiagnosticSeverityError, lldb_private::eExecutionPolicyTopLevel, 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, m_parser, lldb_private::LLVMUserExpression::m_transformed_text, PrepareForParsing(), lldb_private::DiagnosticManager::Printf(), lldb_private::DiagnosticManager::PutString(), lldb_private::FileSpec::SetFilename(), SetupCppModuleImports(), shouldRetryWithCppModule(), lldb_private::Status::Success(), and TryParse().

◆ PrepareForParsing()

bool ClangUserExpression::PrepareForParsing ( DiagnosticManager diagnostic_manager,
ExecutionContext exe_ctx,
bool  for_completion 
)
private

◆ ResetDeclMap() [1/2]

void lldb_private::ClangUserExpression::ResetDeclMap ( )
inline

◆ ResetDeclMap() [2/2]

void lldb_private::ClangUserExpression::ResetDeclMap ( ExecutionContext exe_ctx,
Materializer::PersistentVariableDelegate result_delegate,
bool  keep_result_in_memory 
)
inline

◆ ScanContext()

void ClangUserExpression::ScanContext ( ExecutionContext exe_ctx,
lldb_private::Status err 
)
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::ClangASTMetadata::GetObjectPtrLanguage(), lldb_private::ValueObject::GetObjectRuntimeLanguage(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::ClangASTMetadata::HasObjectPtr(), 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().

◆ SetupCppModuleImports()

void ClangUserExpression::SetupCppModuleImports ( ExecutionContext exe_ctx)
private

◆ SetupPersistentState()

bool ClangUserExpression::SetupPersistentState ( DiagnosticManager diagnostic_manager,
ExecutionContext exe_ctx 
)
private

◆ TryParse()

bool ClangUserExpression::TryParse ( DiagnosticManager diagnostic_manager,
ExecutionContext exe_ctx,
lldb_private::ExecutionPolicy  execution_policy,
bool  keep_result_in_memory,
bool  generate_debug_info 
)
private

Member Data Documentation

◆ ID

char ClangUserExpression::ID
staticprivate

Definition at line 44 of file ClangUserExpression.h.

Referenced by classof(), and isA().

◆ m_clang_state

ClangPersistentVariables* lldb_private::ClangUserExpression::m_clang_state
private

Definition at line 241 of file ClangUserExpression.h.

Referenced by PrepareForParsing(), and SetupPersistentState().

◆ m_ctx_obj

ValueObject* lldb_private::ClangUserExpression::m_ctx_obj
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().

◆ m_enforce_valid_object

bool lldb_private::ClangUserExpression::m_enforce_valid_object = true
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().

◆ m_filename

std::string lldb_private::ClangUserExpression::m_filename
private

File name used for the expression.

Definition at line 246 of file ClangUserExpression.h.

Referenced by CreateSourceCode(), PrepareForParsing(), and TryParse().

◆ m_imported_cpp_modules

std::vector<std::string> lldb_private::ClangUserExpression::m_imported_cpp_modules
private

A list of module names that should be imported when parsing.

See also
CppModuleConfiguration::GetImportedModules

Definition at line 254 of file ClangUserExpression.h.

Referenced by DidImportCxxModules(), Parse(), PrepareForParsing(), and SetupCppModuleImports().

◆ m_in_cplusplus_method

bool lldb_private::ClangUserExpression::m_in_cplusplus_method = false
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().

◆ m_in_objectivec_method

bool lldb_private::ClangUserExpression::m_in_objectivec_method = false
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().

◆ m_in_static_method

bool lldb_private::ClangUserExpression::m_in_static_method = false
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().

◆ m_include_directories

std::vector<std::string> lldb_private::ClangUserExpression::m_include_directories
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().

◆ m_needs_object_ptr

bool lldb_private::ClangUserExpression::m_needs_object_ptr = false
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().

◆ m_parser

std::unique_ptr<ClangExpressionParser> lldb_private::ClangUserExpression::m_parser
private

The parser instance we used to parse the expression.

Definition at line 244 of file ClangUserExpression.h.

Referenced by Parse(), and TryParse().

◆ m_result_delegate

ResultDelegate lldb_private::ClangUserExpression::m_result_delegate
private

◆ m_source_code

std::unique_ptr<ClangExpressionSourceCode> lldb_private::ClangUserExpression::m_source_code
private

Definition at line 242 of file ClangUserExpression.h.

Referenced by CreateSourceCode(), and TryParse().

◆ m_type_system_helper

ClangUserExpressionHelper lldb_private::ClangUserExpression::m_type_system_helper
private

Definition at line 216 of file ClangUserExpression.h.

Referenced by DeclMap(), GetTypeSystemHelper(), and ResetDeclMap().

◆ m_user_expression_start_pos

std::optional<size_t> lldb_private::ClangUserExpression::m_user_expression_start_pos
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().


The documentation for this class was generated from the following files: