|
LLDB mainline
|
"lldb/Expression/ClangUtilityFunction.h" Encapsulates a single expression for use with Clang More...
#include <ClangUtilityFunction.h>
Classes | |
| class | ClangUtilityFunctionHelper |
Public Member Functions | |
| bool | isA (const void *ClassID) const override |
| ClangUtilityFunction (ExecutionContextScope &exe_scope, std::string text, std::string name, bool enable_debugging) | |
| Constructor. | |
| ~ClangUtilityFunction () override | |
| ExpressionTypeSystemHelper * | GetTypeSystemHelper () override |
| ClangExpressionDeclMap * | DeclMap () |
| void | ResetDeclMap () |
| void | ResetDeclMap (ExecutionContext &exe_ctx, bool keep_result_in_memory) |
| bool | Install (DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx) override |
| Install the utility function into a process. | |
| Public Member Functions inherited from lldb_private::UtilityFunction | |
| bool | isA (const void *ClassID) const override |
| UtilityFunction (ExecutionContextScope &exe_scope, std::string text, std::string name, bool enable_debugging) | |
| Constructor. | |
| ~UtilityFunction () override | |
| bool | ContainsAddress (lldb::addr_t address) |
| Check whether the given address is inside the function. | |
| const char * | Text () override |
| Return the string that the parser should parse. | |
| const char * | FunctionName () override |
| Return the function name that should be used for executing the expression. | |
| ExpressionVariableList * | LocalVariables () |
| Return the object that the parser should use when registering local variables. | |
| 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. | |
| FunctionCaller * | MakeFunctionCaller (const CompilerType &return_type, const ValueList &arg_value_list, lldb::ThreadSP compilation_thread, Status &error) |
| FunctionCaller * | GetFunctionCaller () |
| Public Member Functions inherited from lldb_private::Expression | |
| Expression (Target &target) | |
| Expression (ExecutionContextScope &exe_scope) | |
| virtual | ~Expression ()=default |
| Destructor. | |
| 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 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. | |
Static Public Member Functions | |
| static bool | classof (const Expression *obj) |
| Static Public Member Functions inherited from lldb_private::UtilityFunction | |
| static bool | classof (const Expression *obj) |
Private Attributes | |
| ClangUtilityFunctionHelper | m_type_system_helper |
| The map to use when parsing and materializing the expression. | |
Static Private Attributes | |
| static char | ID |
Additional Inherited Members | |
| Public Types inherited from lldb_private::Expression | |
| enum | ResultType { eResultTypeAny , eResultTypeId } |
| Protected Attributes inherited from lldb_private::UtilityFunction | |
| std::shared_ptr< IRExecutionUnit > | m_execution_unit_sp |
| lldb::ModuleWP | m_jit_module_wp |
| std::string | m_function_text |
| The text of the function. Must be a well-formed translation unit. | |
| std::string | m_function_name |
| The name of the function. | |
| std::unique_ptr< FunctionCaller > | m_caller_up |
| 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/ClangUtilityFunction.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. ClangUtilityFunction encapsulates a self-contained function meant to be used from other code. Utility functions can perform error-checking for ClangUserExpressions, or can simply provide a way to push a function into the target for the debugger to call later on.
Definition at line 34 of file ClangUtilityFunction.h.
| ClangUtilityFunction::ClangUtilityFunction | ( | ExecutionContextScope & | exe_scope, |
| std::string | text, | ||
| std::string | name, | ||
| bool | enable_debugging ) |
Constructor.
| [in] | text | The text of the function. Must be a full translation unit. |
| [in] | name | The name of the function, as used in the text. |
| [in] | enable_debugging | Enable debugging of this function. |
Definition at line 32 of file ClangUtilityFunction.cpp.
References lldb_private::NativeFile::Close(), lldb_private::File::eOpenOptionWriteOnly, lldb_private::ClangExpressionSourceCode::g_expression_prefix, lldb_private::ClangExpressionSourceCode::g_expression_suffix, lldb_private::UtilityFunction::m_function_text, lldb_private::UtilityFunction::UtilityFunction(), and lldb_private::NativeFile::Write().
|
overridedefault |
|
inlinestatic |
Definition at line 42 of file ClangUtilityFunction.h.
References ID, and lldb_private::Expression::isA().
|
inline |
Definition at line 63 of file ClangUtilityFunction.h.
References m_type_system_helper.
Referenced by Install().
|
inlineoverridevirtual |
Reimplemented from lldb_private::Expression.
Definition at line 59 of file ClangUtilityFunction.h.
References m_type_system_helper.
|
overridevirtual |
Install the utility function into a process.
| [in] | diagnostic_manager | A diagnostic manager to report errors and warnings to. |
| [in] | exe_ctx | The execution context to install the utility function to. |
Implements lldb_private::UtilityFunction.
Definition at line 75 of file ClangUtilityFunction.cpp.
References lldb_private::ModuleList::Append(), lldb_private::Status::AsCString(), DeclMap(), lldb_private::ClangExpressionDeclMap::DidParse(), lldb_private::eExecutionPolicyAlways, lldb::eSeverityError, lldb::eSeverityWarning, lldb::eStateStopped, lldb_private::UtilityFunction::FunctionName(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::ExpressionParser::GetGenerateDebugInfo(), lldb_private::Target::GetImages(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::Process::GetState(), lldb_private::ExecutionContext::GetTargetPtr(), LLDB_INVALID_ADDRESS, lldb_private::UtilityFunction::m_execution_unit_sp, lldb_private::Expression::m_jit_end_addr, lldb_private::UtilityFunction::m_jit_module_wp, lldb_private::Expression::m_jit_process_wp, lldb_private::Expression::m_jit_start_addr, lldb_private::ClangExpressionParser::Parse(), lldb_private::ExpressionParser::PrepareForExecution(), lldb_private::DiagnosticManager::Printf(), lldb_private::DiagnosticManager::PutString(), ResetDeclMap(), lldb_private::FileSpec::SetFilename(), and lldb_private::Status::Success().
|
inlineoverridevirtual |
Implements lldb_private::Expression.
Definition at line 39 of file ClangUtilityFunction.h.
References ID, and lldb_private::UtilityFunction::isA().
|
inline |
Definition at line 65 of file ClangUtilityFunction.h.
References m_type_system_helper.
Referenced by Install().
|
inline |
Definition at line 67 of file ClangUtilityFunction.h.
References m_type_system_helper.
|
staticprivate |
Definition at line 36 of file ClangUtilityFunction.h.
|
private |
The map to use when parsing and materializing the expression.
Definition at line 108 of file ClangUtilityFunction.h.
Referenced by DeclMap(), GetTypeSystemHelper(), ResetDeclMap(), and ResetDeclMap().