LLDB  mainline
Public Member Functions | List of all members
lldb_private::IRDynamicChecks Class Reference

"lldb/Expression/IRDynamicChecks.h" Adds dynamic checks to a user-entered expression to reduce its likelihood of crashing More...

#include <IRDynamicChecks.h>

Inheritance diagram for lldb_private::IRDynamicChecks:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::IRDynamicChecks:
Collaboration graph
[legend]

Public Member Functions

 IRDynamicChecks (DynamicCheckerFunctions &checker_functions, const char *func_name="$__lldb_expr")
 Constructor. More...
 
 ~IRDynamicChecks () override
 Destructor. More...
 
bool runOnModule (llvm::Module &M) override
 Run this IR transformer on a single module. More...
 
void assignPassManager (llvm::PMStack &PMS, llvm::PassManagerType T=llvm::PMT_ModulePassManager) override
 Interface stub. More...
 
llvm::PassManagerType getPotentialPassManagerType () const override
 Returns PMT_ModulePassManager. More...
 

Detailed Description

"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 85 of file IRDynamicChecks.h.

Constructor & Destructor Documentation

◆ IRDynamicChecks()

IRDynamicChecks::IRDynamicChecks ( DynamicCheckerFunctions checker_functions,
const char *  func_name = "$__lldb_expr" 
)

Constructor.

Parameters
[in]checker_functionsThe checker functions for the target process.
[in]func_nameThe name of the function to prepare for execution in the target.
[in]decl_mapThe mapping used to look up entities in the target process. In this case, used to find objc_msgSend

Definition at line 535 of file IRDynamicChecks.cpp.

References ~IRDynamicChecks().

◆ ~IRDynamicChecks()

IRDynamicChecks::~IRDynamicChecks ( )
overridedefault

Destructor.

Referenced by IRDynamicChecks().

Member Function Documentation

◆ assignPassManager()

void IRDynamicChecks::assignPassManager ( llvm::PMStack &  PMS,
llvm::PassManagerType  T = llvm::PMT_ModulePassManager 
)
override

Interface stub.

Definition at line 588 of file IRDynamicChecks.cpp.

◆ getPotentialPassManagerType()

PassManagerType IRDynamicChecks::getPotentialPassManagerType ( ) const
override

Returns PMT_ModulePassManager.

Definition at line 590 of file IRDynamicChecks.cpp.

◆ runOnModule()

bool IRDynamicChecks::runOnModule ( llvm::Module M)
override

Run this IR transformer on a single module.

Parameters
[in]MThe module to run on. This module is searched for the function $__lldb_expr, and that function is passed to the passes one by one.
Returns
True on success; false otherwise

Definition at line 542 of file IRDynamicChecks.cpp.

References lldb_private::Function, lldb_private::GetLogIfAllCategoriesSet(), lldb_private::Log::GetVerbose(), Instrumenter::Inspect(), Instrumenter::Instrument(), LIBLLDB_LOG_EXPRESSIONS, lldb_private::DynamicCheckerFunctions::m_objc_object_check, lldb_private::DynamicCheckerFunctions::m_valid_pointer_check, and lldb_private::Log::Printf().


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