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

Mapping between serialized indices and their corresponding objects. More...

#include <ReproducerInstrumentation.h>

Public Member Functions

template<typename T >
T * GetObjectForIndex (unsigned idx)
 Returns an object as a pointer for the given index or nullptr if not present in the map. More...
 
template<typename T >
void AddObjectForIndex (unsigned idx, T *object)
 Adds a pointer to an object to the mapping for the given index. More...
 
template<typename T >
void AddObjectForIndex (unsigned idx, T &object)
 Adds a reference to an object to the mapping for the given index. More...
 

Detailed Description

Mapping between serialized indices and their corresponding objects.

This class is used during replay to map indices back to in-memory objects.

When objects are constructed, they are added to this mapping using AddObjectForIndex.

When an object is passed to a function, its index is deserialized and AddObjectForIndex returns the corresponding object. If there is no object for the given index, a nullptr is returend. The latter is valid when custom replay code is in place and the actual object is ignored.

Definition at line 193 of file ReproducerInstrumentation.h.

Member Function Documentation

◆ AddObjectForIndex() [1/2]

template<typename T >
void lldb_private::repro::IndexToObject::AddObjectForIndex ( unsigned  idx,
T *  object 
)
inline

Adds a pointer to an object to the mapping for the given index.

Definition at line 204 of file ReproducerInstrumentation.h.

◆ AddObjectForIndex() [2/2]

template<typename T >
void lldb_private::repro::IndexToObject::AddObjectForIndex ( unsigned  idx,
T &  object 
)
inline

Adds a reference to an object to the mapping for the given index.

Definition at line 211 of file ReproducerInstrumentation.h.

◆ GetObjectForIndex()

template<typename T >
T* lldb_private::repro::IndexToObject::GetObjectForIndex ( unsigned  idx)
inline

Returns an object as a pointer for the given index or nullptr if not present in the map.

Definition at line 197 of file ReproducerInstrumentation.h.


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