LLDB  mainline
Classes | Public Member Functions | Protected Member Functions | List of all members
lldb_private::repro::Registry Class Reference

The registry contains a unique mapping between functions and their ID. More...

#include <ReproducerInstrumentation.h>

Inheritance diagram for lldb_private::repro::Registry:
Inheritance graph
[legend]

Public Member Functions

 Registry ()=default
 
virtual ~Registry ()=default
 
template<typename Signature >
void Register (Signature *f, llvm::StringRef result={}, llvm::StringRef scope={}, llvm::StringRef name={}, llvm::StringRef args={})
 Register a default replayer for a function. More...
 
template<typename Signature >
void Register (Signature *f, Signature *g, llvm::StringRef result={}, llvm::StringRef scope={}, llvm::StringRef name={}, llvm::StringRef args={})
 Register a replayer that invokes a custom function with the same signature as the replayed function. More...
 
bool Replay (const FileSpec &file)
 Replay functions from a file. More...
 
bool Replay (llvm::StringRef buffer)
 Replay functions from a buffer. More...
 
unsigned GetID (uintptr_t addr)
 Returns the ID for a given function address. More...
 

Protected Member Functions

void DoRegister (uintptr_t RunID, std::unique_ptr< Replayer > replayer, SignatureStr signature)
 Register the given replayer for a function (and the ID mapping). More...
 

Detailed Description

The registry contains a unique mapping between functions and their ID.

The IDs can be serialized and deserialized to replay a function. Functions need to be registered with the registry for this to work.

Definition at line 421 of file ReproducerInstrumentation.h.

Constructor & Destructor Documentation

◆ Registry()

lldb_private::repro::Registry::Registry ( )
default

◆ ~Registry()

virtual lldb_private::repro::Registry::~Registry ( )
virtualdefault

Member Function Documentation

◆ DoRegister()

void Registry::DoRegister ( uintptr_t  RunID,
std::unique_ptr< Replayer replayer,
SignatureStr  signature 
)
protected

Register the given replayer for a function (and the ID mapping).

Definition at line 66 of file ReproducerInstrumentation.cpp.

◆ GetID()

unsigned Registry::GetID ( uintptr_t  addr)

Returns the ID for a given function address.

Definition at line 75 of file ReproducerInstrumentation.cpp.

Referenced by lldb_private::repro::Recorder::Record().

◆ Register() [1/2]

template<typename Signature >
void lldb_private::repro::Registry::Register ( Signature *  f,
llvm::StringRef  result = {},
llvm::StringRef  scope = {},
llvm::StringRef  name = {},
llvm::StringRef  args = {} 
)
inline

Register a default replayer for a function.

Definition at line 442 of file ReproducerInstrumentation.h.

◆ Register() [2/2]

template<typename Signature >
void lldb_private::repro::Registry::Register ( Signature *  f,
Signature *  g,
llvm::StringRef  result = {},
llvm::StringRef  scope = {},
llvm::StringRef  name = {},
llvm::StringRef  args = {} 
)
inline

Register a replayer that invokes a custom function with the same signature as the replayed function.

Definition at line 452 of file ReproducerInstrumentation.h.

References lldb_private::repro::Replay.

◆ Replay() [1/2]

bool Registry::Replay ( const FileSpec file)

Replay functions from a file.

Definition at line 37 of file ReproducerInstrumentation.cpp.

References lldb_private::FileSpec::GetPath(), and lldb_private::repro::Replay.

Referenced by lldb::SBReproducer::Replay().

◆ Replay() [2/2]

bool Registry::Replay ( llvm::StringRef  buffer)

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