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

RAII object that records function invocations and their return value. More...

#include <ReproducerInstrumentation.h>

Public Member Functions

 Recorder (llvm::StringRef pretty_func={}, std::string &&pretty_args={})
 
 ~Recorder ()
 
template<typename Result , typename... FArgs, typename... RArgs>
void Record (Serializer &serializer, Registry &registry, Result(*f)(FArgs...), const RArgs &... args)
 Records a single function call. More...
 
template<typename... Args>
void Record (Serializer &serializer, Registry &registry, void(*f)(Args...), const Args &... args)
 Records a single function call. More...
 
template<typename Result >
Result RecordResult (Result &&r)
 Record the result of a function call. More...
 

Detailed Description

RAII object that records function invocations and their return value.

API calls are only captured when the API boundary is crossed. Once we're in the API layer, and another API function is called, it doesn't need to be recorded.

When a call is recored, its result is always recorded as well, even if the function returns a void. For functions that return by value, RecordResult should be used. Otherwise a sentinel value (0) will be serialized.

Because of the functional overlap between logging and recording API calls, this class is also used for logging.

Definition at line 617 of file ReproducerInstrumentation.h.

Constructor & Destructor Documentation

◆ Recorder()

Recorder::Recorder ( llvm::StringRef  pretty_func = {},
std::string &&  pretty_args = {} 
)

◆ ~Recorder()

Recorder::~Recorder ( )

Definition at line 117 of file ReproducerInstrumentation.cpp.

Member Function Documentation

◆ Record() [1/2]

template<typename Result , typename... FArgs, typename... RArgs>
void lldb_private::repro::Recorder::Record ( Serializer serializer,
Registry registry,
Result(*)(FArgs...)  f,
const RArgs &...  args 
)
inline

Records a single function call.

Definition at line 624 of file ReproducerInstrumentation.h.

References lldb_private::repro::Registry::GetID(), and lldb_private::repro::Serializer::SerializeAll().

◆ Record() [2/2]

template<typename... Args>
void lldb_private::repro::Recorder::Record ( Serializer serializer,
Registry registry,
void(*)(Args...)  f,
const Args &...  args 
)
inline

Records a single function call.

Definition at line 650 of file ReproducerInstrumentation.h.

References lldb_private::repro::Registry::GetID(), and lldb_private::repro::Serializer::SerializeAll().

◆ RecordResult()

template<typename Result >
Result lldb_private::repro::Recorder::RecordResult ( Result &&  r)
inline

Record the result of a function call.

Definition at line 671 of file ReproducerInstrumentation.h.


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