LLVM  4.0.0
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
fuzzer::TracePC Class Reference

#include <FuzzerTracePC.h>

Collaboration diagram for fuzzer::TracePC:
[legend]

Public Member Functions

void HandleTrace (uint32_t *guard, uintptr_t PC)
 
void HandleInit (uint32_t *start, uint32_t *stop)
 
void HandleCallerCallee (uintptr_t Caller, uintptr_t Callee)
 
void HandleValueProfile (size_t Value)
 
template<class T >
void HandleCmp (void *PC, T Arg1, T Arg2)
 
size_t GetTotalPCCoverage ()
 
void SetUseCounters (bool UC)
 
void SetUseValueProfile (bool VP)
 
void SetPrintNewPCs (bool P)
 
template<class Callback >
size_t CollectFeatures (Callback CB)
 
bool UpdateValueProfileMap (ValueBitMap *MaxValueProfileMap)
 
void ResetMaps ()
 
void UpdateFeatureSet (size_t CurrentElementIdx, size_t CurrentElementSize)
 
void PrintFeatureSet ()
 
void PrintModuleInfo ()
 
void PrintCoverage ()
 
void DumpCoverage ()
 
void AddValueForMemcmp (void *caller_pc, const void *s1, const void *s2, size_t n)
 
void AddValueForStrcmp (void *caller_pc, const char *s1, const char *s2, size_t n)
 
bool UsingTracePcGuard () const
 
void PrintNewPCs ()
 
void InitializePrintNewPCs ()
 
size_t GetNumPCs () const
 
uintptr_t GetPC (size_t Idx)
 
template<class T >
ATTRIBUTE_TARGET_POPCNT void HandleCmp (void *PC, T Arg1, T Arg2)
 

Public Attributes

TableOfRecentCompares
< uint32_t, kTORCSize
TORC4
 
TableOfRecentCompares
< uint64_t, kTORCSize
TORC8
 

Static Public Attributes

static const size_t kFeatureSetSize = ValueBitMap::kNumberOfItems
 
static const size_t kTORCSize = 1 << 5
 

Detailed Description

Definition at line 45 of file FuzzerTracePC.h.

Member Function Documentation

ATTRIBUTE_NO_SANITIZE_MEMORY void fuzzer::TracePC::AddValueForMemcmp ( void *  caller_pc,
const void *  s1,
const void *  s2,
size_t  n 
)

Definition at line 214 of file FuzzerTracePC.cpp.

References HandleValueProfile(), I, fuzzer::min(), PC, and fuzzer::TPC.

Referenced by __sanitizer_weak_hook_memcmp().

ATTRIBUTE_NO_SANITIZE_MEMORY void fuzzer::TracePC::AddValueForStrcmp ( void *  caller_pc,
const char *  s1,
const char *  s2,
size_t  n 
)
template<class Callback >
size_t fuzzer::TracePC::CollectFeatures ( Callback  CB)
void fuzzer::TracePC::DumpCoverage ( )

Definition at line 199 of file FuzzerTracePC.cpp.

References GetNumPCs().

Referenced by fuzzer::Fuzzer::PrintFinalStats().

size_t fuzzer::TracePC::GetNumPCs ( ) const
inline
uintptr_t fuzzer::TracePC::GetPC ( size_t  Idx)
inline

Definition at line 90 of file FuzzerTracePC.h.

References assert(), and GetNumPCs().

size_t fuzzer::TracePC::GetTotalPCCoverage ( )

Definition at line 38 of file FuzzerTracePC.cpp.

References GetNumPCs(), and i.

void fuzzer::TracePC::HandleCallerCallee ( uintptr_t  Caller,
uintptr_t  Callee 
)

Definition at line 63 of file FuzzerTracePC.cpp.

References HandleValueProfile().

template<class T >
void fuzzer::TracePC::HandleCmp ( void *  PC,
T  Arg1,
T  Arg2 
)
template<class T >
ATTRIBUTE_TARGET_POPCNT void fuzzer::TracePC::HandleCmp ( void *  PC,
T  Arg1,
T  Arg2 
)
void fuzzer::TracePC::HandleInit ( uint32_t start,
uint32_t stop 
)

Definition at line 46 of file FuzzerTracePC.cpp.

References assert(), and P.

void fuzzer::TracePC::HandleTrace ( uint32_t guard,
uintptr_t  PC 
)

Definition at line 31 of file FuzzerTracePC.cpp.

References PC.

Referenced by __attribute__().

void fuzzer::TracePC::HandleValueProfile ( size_t  Value)
inline
void fuzzer::TracePC::InitializePrintNewPCs ( )

Definition at line 82 of file FuzzerTracePC.cpp.

References assert(), GetNumPCs(), and i.

Referenced by fuzzer::Fuzzer::Loop().

void fuzzer::TracePC::PrintCoverage ( )
void fuzzer::TracePC::PrintFeatureSet ( )
void fuzzer::TracePC::PrintModuleInfo ( )

Definition at line 56 of file FuzzerTracePC.cpp.

References i, and fuzzer::Printf().

Referenced by fuzzer::Fuzzer::Fuzzer().

void fuzzer::TracePC::PrintNewPCs ( )

Definition at line 91 of file FuzzerTracePC.cpp.

References assert(), GetNumPCs(), i, and fuzzer::PrintPC().

void fuzzer::TracePC::ResetMaps ( )
inline
void fuzzer::TracePC::SetPrintNewPCs ( bool  P)
inline

Definition at line 57 of file FuzzerTracePC.h.

References P.

Referenced by fuzzer::Fuzzer::Fuzzer().

void fuzzer::TracePC::SetUseCounters ( bool  UC)
inline

Definition at line 55 of file FuzzerTracePC.h.

Referenced by fuzzer::Fuzzer::Fuzzer().

void fuzzer::TracePC::SetUseValueProfile ( bool  VP)
inline

Definition at line 56 of file FuzzerTracePC.h.

Referenced by fuzzer::Fuzzer::Fuzzer().

void fuzzer::TracePC::UpdateFeatureSet ( size_t  CurrentElementIdx,
size_t  CurrentElementSize 
)
bool fuzzer::TracePC::UpdateValueProfileMap ( ValueBitMap MaxValueProfileMap)
inline

Definition at line 59 of file FuzzerTracePC.h.

References fuzzer::ValueBitMap::MergeFrom().

bool fuzzer::TracePC::UsingTracePcGuard ( ) const
inline

Definition at line 81 of file FuzzerTracePC.h.

Referenced by CollectFeatures().

Member Data Documentation

const size_t fuzzer::TracePC::kFeatureSetSize = ValueBitMap::kNumberOfItems
static

Definition at line 47 of file FuzzerTracePC.h.

const size_t fuzzer::TracePC::kTORCSize = 1 << 5
static

Definition at line 83 of file FuzzerTracePC.h.

TableOfRecentCompares<uint32_t, kTORCSize> fuzzer::TracePC::TORC4
TableOfRecentCompares<uint64_t, kTORCSize> fuzzer::TracePC::TORC8

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