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

Deserializes data from a buffer. More...

#include <ReproducerInstrumentation.h>

Public Member Functions

 Deserializer (llvm::StringRef buffer)
 
bool HasData (unsigned size)
 Returns true when the buffer has unread data. More...
 
template<typename T >
Deserialize ()
 Deserialize and interpret value as T. More...
 
template<typename T >
void HandleReplayResult (const T &t)
 Store the returned value in the index-to-object mapping. More...
 
template<typename T >
void HandleReplayResult (T *t)
 Store the returned value in the index-to-object mapping. More...
 
void HandleReplayResultVoid ()
 All returned types are recorded, even when the function returns a void. More...
 
template<>
const char * Deserialize ()
 Partial specialization for C-style strings. More...
 
template<>
char * Deserialize ()
 
template<>
char * Deserialize ()
 
template<>
const char * Deserialize ()
 

Detailed Description

Deserializes data from a buffer.

It is used to deserialize function indices to replay, their arguments and return values.

Fundamental types and strings are read by value. Objects are read by their index, which get translated by the IndexToObject mapping maintained in this class.

Additional bookkeeping with regards to the IndexToObject is required to deserialize objects. When a constructor is run or an object is returned by value, we need to capture the object and add it to the index together with its index. This is the job of HandleReplayResult(Void).

Definition at line 262 of file ReproducerInstrumentation.h.

Constructor & Destructor Documentation

◆ Deserializer()

lldb_private::repro::Deserializer::Deserializer ( llvm::StringRef  buffer)
inline

Definition at line 264 of file ReproducerInstrumentation.h.

Member Function Documentation

◆ Deserialize() [1/5]

template<>
char* lldb_private::repro::Deserializer::Deserialize ( )

Definition at line 24 of file ReproducerInstrumentation.cpp.

◆ Deserialize() [2/5]

template<>
const char* lldb_private::repro::Deserializer::Deserialize ( )

Definition at line 28 of file ReproducerInstrumentation.cpp.

◆ Deserialize() [3/5]

template<typename T >
T lldb_private::repro::Deserializer::Deserialize ( )
inline

◆ Deserialize() [4/5]

template<>
const char* lldb_private::repro::Deserializer::Deserialize ( )

Partial specialization for C-style strings.

We read the string value instead of treating it as pointer.

◆ Deserialize() [5/5]

template<>
char* lldb_private::repro::Deserializer::Deserialize ( )

◆ HandleReplayResult() [1/2]

template<typename T >
void lldb_private::repro::Deserializer::HandleReplayResult ( const T &  t)
inline

Store the returned value in the index-to-object mapping.

Definition at line 278 of file ReproducerInstrumentation.h.

Referenced by lldb_private::repro::DefaultReplayer< Result(Args...)>::operator()().

◆ HandleReplayResult() [2/2]

template<typename T >
void lldb_private::repro::Deserializer::HandleReplayResult ( T *  t)
inline

Store the returned value in the index-to-object mapping.

Definition at line 287 of file ReproducerInstrumentation.h.

◆ HandleReplayResultVoid()

void lldb_private::repro::Deserializer::HandleReplayResultVoid ( )
inline

All returned types are recorded, even when the function returns a void.

The latter requires special handling.

Definition at line 296 of file ReproducerInstrumentation.h.

Referenced by lldb_private::repro::DefaultReplayer< void(Args...)>::operator()().

◆ HasData()

bool lldb_private::repro::Deserializer::HasData ( unsigned  size)
inline

Returns true when the buffer has unread data.

Definition at line 267 of file ReproducerInstrumentation.h.

Referenced by lldb_private::repro::Registry::Replay().


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