LLDB mainline
|
"lldb/Expression/IRDynamicChecks.h" Adds dynamic checks to a user-entered expression to reduce its likelihood of crashing More...
#include <IRDynamicChecks.h>
Public Member Functions | |
IRDynamicChecks (ClangDynamicCheckerFunctions &checker_functions, const char *func_name="$__lldb_expr") | |
Constructor. | |
~IRDynamicChecks () override | |
Destructor. | |
bool | runOnModule (llvm::Module &M) override |
Run this IR transformer on a single module. | |
void | assignPassManager (llvm::PMStack &PMS, llvm::PassManagerType T=llvm::PMT_ModulePassManager) override |
Interface stub. | |
llvm::PassManagerType | getPotentialPassManagerType () const override |
Returns PMT_ModulePassManager. | |
Private Member Functions | |
bool | FindDataLoads (llvm::Module &M, llvm::BasicBlock &BB) |
A basic block-level pass to find all pointer dereferences and validate them before use. | |
Private Attributes | |
std::string | m_func_name |
The name of the function to add checks to. | |
ClangDynamicCheckerFunctions & | m_checker_functions |
The checker functions for the process. | |
"lldb/Expression/IRDynamicChecks.h" Adds dynamic checks to a user-entered expression to reduce its likelihood of crashing
When an IR function is executed in the target process, it may cause crashes or hangs by dereferencing NULL pointers, trying to call Objective-C methods on objects that do not respond to them, and so forth.
IRDynamicChecks adds calls to the functions in DynamicCheckerFunctions to appropriate locations in an expression's IR.
Definition at line 70 of file IRDynamicChecks.h.
IRDynamicChecks::IRDynamicChecks | ( | ClangDynamicCheckerFunctions & | checker_functions, |
const char * | func_name = "$__lldb_expr" |
||
) |
Constructor.
[in] | checker_functions | The checker functions for the target process. |
[in] | func_name | The name of the function to prepare for execution in the target. |
Definition at line 512 of file IRDynamicChecks.cpp.
|
overridedefault |
Destructor.
|
override |
Interface stub.
Definition at line 564 of file IRDynamicChecks.cpp.
|
private |
A basic block-level pass to find all pointer dereferences and validate them before use.
The top-level pass implementation
[in] | M | The module currently being processed. |
[in] | BB | The basic block currently being processed. |
|
override |
Returns PMT_ModulePassManager.
Definition at line 566 of file IRDynamicChecks.cpp.
|
override |
Run this IR transformer on a single module.
[in] | M | The module to run on. This module is searched for the function $__lldb_expr, and that function is passed to the passes one by one. |
Definition at line 519 of file IRDynamicChecks.cpp.
References lldb_private::Expressions, lldb_private::GetLog(), lldb_private::Log::GetVerbose(), Instrumenter::Inspect(), Instrumenter::Instrument(), LLDB_LOGF, m_checker_functions, m_func_name, lldb_private::ClangDynamicCheckerFunctions::m_objc_object_check, and lldb_private::ClangDynamicCheckerFunctions::m_valid_pointer_check.
Referenced by lldb_private::ClangExpressionParser::DoPrepareForExecution().
|
private |
The checker functions for the process.
Definition at line 122 of file IRDynamicChecks.h.
Referenced by runOnModule().
|
private |
The name of the function to add checks to.
Definition at line 120 of file IRDynamicChecks.h.
Referenced by runOnModule().