LLDB mainline
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
ObjcObjectChecker Class Reference
Inheritance diagram for ObjcObjectChecker:
Inheritance graph
[legend]

Public Types

enum  msgSend_type {
  eMsgSend = 0 , eMsgSendSuper , eMsgSendSuper_stret , eMsgSend_fpret ,
  eMsgSend_stret
}
 

Public Member Functions

 ObjcObjectChecker (llvm::Module &module, std::shared_ptr< UtilityFunction > checker_function)
 
 ~ObjcObjectChecker () override=default
 
- Public Member Functions inherited from Instrumenter
 Instrumenter (llvm::Module &module, std::shared_ptr< UtilityFunction > checker_function)
 Constructor.
 
virtual ~Instrumenter ()=default
 
bool Inspect (llvm::Function &function)
 Inspect a function to find instructions to instrument.
 
bool Instrument ()
 Instrument all the instructions found by Inspect()
 

Public Attributes

std::map< llvm::Instruction *, msgSend_typemsgSend_types
 

Protected Member Functions

bool InstrumentInstruction (llvm::Instruction *inst) override
 Add instrumentation to a single instruction.
 
bool InspectInstruction (llvm::Instruction &i) override
 Determine whether a single instruction is interesting to instrument, and, if so, call RegisterInstruction.
 
- Protected Member Functions inherited from Instrumenter
virtual bool InstrumentInstruction (llvm::Instruction *inst)=0
 Add instrumentation to a single instruction.
 
void RegisterInstruction (llvm::Instruction &inst)
 Register a single instruction to be instrumented.
 
virtual bool InspectInstruction (llvm::Instruction &i)
 Determine whether a single instruction is interesting to instrument, and, if so, call RegisterInstruction.
 
virtual bool InspectBasicBlock (llvm::BasicBlock &bb)
 Scan a basic block to see if any instructions are interesting.
 
virtual bool InspectFunction (llvm::Function &f)
 Scan a function to see if any instructions are interesting.
 
llvm::FunctionCallee BuildPointerValidatorFunc (lldb::addr_t start_address)
 Build a function pointer for a function with signature void (*)(uint8_t*) with a given address.
 
llvm::FunctionCallee BuildObjectCheckerFunc (lldb::addr_t start_address)
 Build a function pointer for a function with signature void (*)(uint8_t*, uint8_t*) with a given address.
 
PointerType * GetI8PtrTy ()
 
IntegerType * GetIntptrTy ()
 

Static Protected Member Functions

static llvm::Function * GetFunction (llvm::Value *value)
 
static llvm::Function * GetCalledFunction (llvm::CallInst *inst)
 

Private Attributes

llvm::FunctionCallee m_objc_object_check_func
 

Additional Inherited Members

- Protected Types inherited from Instrumenter
typedef std::vector< llvm::Instruction * > InstVector
 
typedef InstVector::iterator InstIterator
 
- Protected Attributes inherited from Instrumenter
InstVector m_to_instrument
 List of instructions the inspector found.
 
llvm::Module & m_module
 The module which is being instrumented.
 
std::shared_ptr< UtilityFunctionm_checker_function
 The dynamic checker function for the process.
 

Detailed Description

Definition at line 351 of file IRDynamicChecks.cpp.

Member Enumeration Documentation

◆ msgSend_type

Enumerator
eMsgSend 
eMsgSendSuper 
eMsgSendSuper_stret 
eMsgSend_fpret 
eMsgSend_stret 

Definition at line 360 of file IRDynamicChecks.cpp.

Constructor & Destructor Documentation

◆ ObjcObjectChecker()

ObjcObjectChecker::ObjcObjectChecker ( llvm::Module &  module,
std::shared_ptr< UtilityFunction checker_function 
)
inline

Definition at line 353 of file IRDynamicChecks.cpp.

◆ ~ObjcObjectChecker()

ObjcObjectChecker::~ObjcObjectChecker ( )
overridedefault

Member Function Documentation

◆ GetCalledFunction()

static llvm::Function * ObjcObjectChecker::GetCalledFunction ( llvm::CallInst *  inst)
inlinestaticprotected

Definition at line 445 of file IRDynamicChecks.cpp.

◆ GetFunction()

static llvm::Function * ObjcObjectChecker::GetFunction ( llvm::Value *  value)
inlinestaticprotected

Definition at line 427 of file IRDynamicChecks.cpp.

◆ InspectInstruction()

bool ObjcObjectChecker::InspectInstruction ( llvm::Instruction &  i)
inlineoverrideprotectedvirtual

Determine whether a single instruction is interesting to instrument, and, if so, call RegisterInstruction.

Parameters
[in]iThe instruction to be inspected.
Returns
False if there was an error scanning; true otherwise.

Reimplemented from Instrumenter.

Definition at line 449 of file IRDynamicChecks.cpp.

References lldb_private::GetLog(), LLDB_LOGF, and PrintValue().

◆ InstrumentInstruction()

bool ObjcObjectChecker::InstrumentInstruction ( llvm::Instruction *  inst)
inlineoverrideprotectedvirtual

Add instrumentation to a single instruction.

Parameters
[in]instThe instruction to be instrumented.
Returns
True on success; false otherwise.

Implements Instrumenter.

Definition at line 371 of file IRDynamicChecks.cpp.

Member Data Documentation

◆ m_objc_object_check_func

llvm::FunctionCallee ObjcObjectChecker::m_objc_object_check_func
private

Definition at line 510 of file IRDynamicChecks.cpp.

◆ msgSend_types

std::map<llvm::Instruction *, msgSend_type> ObjcObjectChecker::msgSend_types

Definition at line 368 of file IRDynamicChecks.cpp.


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