Static Value-Flow Analysis
Public Types | Public Member Functions | Protected Attributes | List of all members
SVF::SVFBugEvent Class Reference

#include <SVFBugReport.h>

Public Types

enum  EventType {
  Branch = 0x1 , Caller = 0x2 , CallSite = 0x3 , Loop = 0x4 ,
  SourceInst = 0x5
}
 

Public Member Functions

 SVFBugEvent (u32_t typeAndInfoFlag, const ICFGNode *eventInst)
 
virtual ~SVFBugEvent ()=default
 
u32_t getEventType () const
 
virtual const std::string getEventDescription () const
 
virtual const std::string getFuncName () const
 
virtual const std::string getEventLoc () const
 

Protected Attributes

u32_t typeAndInfoFlag
 
const ICFGNodeeventInst
 

Detailed Description

Bug Detector Recoder

Definition at line 51 of file SVFBugReport.h.

Member Enumeration Documentation

◆ EventType

Enumerator
Branch 
Caller 
CallSite 
Loop 
SourceInst 

Definition at line 54 of file SVFBugReport.h.

55  {
56  Branch = 0x1,
57  Caller = 0x2,
58  CallSite = 0x3,
59  Loop = 0x4,
60  SourceInst = 0x5
61  };

Constructor & Destructor Documentation

◆ SVFBugEvent()

SVF::SVFBugEvent::SVFBugEvent ( u32_t  typeAndInfoFlag,
const ICFGNode eventInst 
)
inline

Definition at line 68 of file SVFBugReport.h.

◆ ~SVFBugEvent()

virtual SVF::SVFBugEvent::~SVFBugEvent ( )
virtualdefault

Member Function Documentation

◆ getEventDescription()

const std::string SVFBugEvent::getEventDescription ( ) const
virtual

Definition at line 287 of file SVFBugReport.cpp.

288 {
289  switch(getEventType())
290  {
291  case SVFBugEvent::Branch:
292  {
294  {
295  return "True";
296  }
297  else
298  {
299  return "False";
300  }
301  break;
302  }
304  {
305  std::string description("calls ");
306  assert(SVFUtil::isa<CallICFGNode>(eventInst) && "not a call ICFGNode?");
307  const SVFFunction *callee = SVFUtil::cast<CallICFGNode>(eventInst)->getCalledFunction();
308  if(callee == nullptr)
309  {
310  description += "<unknown>";
311  }
312  else
313  {
314  description += callee->getName();
315  }
316  return description;
317  break;
318  }
320  {
321  return "None";
322  }
323  default:
324  {
325  assert(false && "No such type of event!");
326  abort();
327  }
328  }
329 }
#define BRANCHFLAGMASK
Definition: SVFBugReport.h:40
const char *const string
Definition: cJSON.h:172
u32_t getEventType() const
Definition: SVFBugReport.h:71
const std::string & getName() const
Definition: SVFValue.h:243

◆ getEventLoc()

const std::string SVFBugEvent::getEventLoc ( ) const
virtual

Definition at line 282 of file SVFBugReport.cpp.

283 {
284  return eventInst->getSourceLoc();
285 }
virtual const std::string getSourceLoc() const
Definition: GenericGraph.h:281

◆ getEventType()

u32_t SVF::SVFBugEvent::getEventType ( ) const
inline

Definition at line 71 of file SVFBugReport.h.

72  {
74  }
#define EVENTTYPEMASK
Definition: SVFBugReport.h:41

◆ getFuncName()

const std::string SVFBugEvent::getFuncName ( ) const
virtual

Definition at line 277 of file SVFBugReport.cpp.

278 {
279  return eventInst->getFun()->getName();
280 }
virtual const SVFFunction * getFun() const
Return the function of this ICFGNode.
Definition: ICFGNode.h:76

Member Data Documentation

◆ eventInst

const ICFGNode* SVF::SVFBugEvent::eventInst
protected

Definition at line 65 of file SVFBugReport.h.

◆ typeAndInfoFlag

u32_t SVF::SVFBugEvent::typeAndInfoFlag
protected

Definition at line 64 of file SVFBugReport.h.


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