LLDB  mainline
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
lldb::SBTrace Class Reference

#include <SBTrace.h>

Collaboration diagram for lldb::SBTrace:
Collaboration graph
[legend]

Public Member Functions

 SBTrace ()
 
size_t GetTraceData (SBError &error, void *buf, size_t size, size_t offset=0, lldb::tid_t thread_id=LLDB_INVALID_THREAD_ID)
 Obtain the trace data as raw bytes. More...
 
size_t GetMetaData (SBError &error, void *buf, size_t size, size_t offset=0, lldb::tid_t thread_id=LLDB_INVALID_THREAD_ID)
 Obtain any meta data as raw bytes for the tracing instance. More...
 
void StopTrace (SBError &error, lldb::tid_t thread_id=LLDB_INVALID_THREAD_ID)
 Stop the tracing instance. More...
 
void GetTraceConfig (SBTraceOptions &options, SBError &error)
 Get the trace configuration being used for the trace instance. More...
 
lldb::user_id_t GetTraceUID ()
 
 operator bool () const
 
bool IsValid ()
 

Protected Types

typedef std::shared_ptr< TraceImplTraceImplSP
 

Protected Member Functions

void SetTraceUID (lldb::user_id_t uid)
 
lldb::ProcessSP GetSP () const
 
void SetSP (const ProcessSP &process_sp)
 

Protected Attributes

TraceImplSP m_trace_impl_sp
 
lldb::ProcessWP m_opaque_wp
 

Friends

class SBProcess
 

Detailed Description

Definition at line 19 of file SBTrace.h.

Member Typedef Documentation

◆ TraceImplSP

typedef std::shared_ptr<TraceImpl> lldb::SBTrace::TraceImplSP
protected

Definition at line 100 of file SBTrace.h.

Constructor & Destructor Documentation

◆ SBTrace()

SBTrace::SBTrace ( )

Definition at line 107 of file SBTrace.cpp.

References LLDB_INVALID_UID, and LLDB_RECORD_CONSTRUCTOR_NO_ARGS.

Member Function Documentation

◆ GetMetaData()

size_t SBTrace::GetMetaData ( SBError error,
void *  buf,
size_t  size,
size_t  offset = 0,
lldb::tid_t  thread_id = LLDB_INVALID_THREAD_ID 
)

Obtain any meta data as raw bytes for the tracing instance.

The input parameter definition is similar to the previous function.

Definition at line 46 of file SBTrace.cpp.

References lldb::SBError::Clear(), LLDB_RECORD_DUMMY, lldb::SBError::SetError(), and lldb::SBError::SetErrorString().

◆ GetSP()

lldb::ProcessSP SBTrace::GetSP ( ) const
protected

Definition at line 25 of file SBTrace.cpp.

◆ GetTraceConfig()

void SBTrace::GetTraceConfig ( SBTraceOptions options,
SBError error 
)

Get the trace configuration being used for the trace instance.

The threadid in the SBTraceOptions needs to be set when the configuration used by a specific thread is being requested.

Parameters
[out]optionsThe trace options actually used by the trace instance would be filled by the API.
[out]errorAn error explaining what went wrong.

Definition at line 79 of file SBTrace.cpp.

References lldb::SBError::Clear(), LLDB_RECORD_METHOD, lldb::SBTraceOptions::m_traceoptions_sp, lldb::SBError::SetError(), and lldb::SBError::SetErrorString().

◆ GetTraceData()

size_t SBTrace::GetTraceData ( SBError error,
void *  buf,
size_t  size,
size_t  offset = 0,
lldb::tid_t  thread_id = LLDB_INVALID_THREAD_ID 
)

Obtain the trace data as raw bytes.

Parameters
[out]errorAn error explaining what went wrong.
[in]bufBuffer to write the trace data to.
[in]sizeThe size of the buffer used to read the data. This is also the size of the data intended to read. It is also possible to partially read the trace data for some trace technologies by specifying a smaller buffer.
[in]offsetThe start offset to begin reading the trace data.
[in]thread_idTracing could be started for the complete process or a single thread, in the first case the traceid obtained would map to all the threads existing within the process and the ones spawning later. The thread_id parameter can be used in such a scenario to select the trace data for a specific thread.
Returns
The size of the trace data effectively read by the API call.

Definition at line 27 of file SBTrace.cpp.

References lldb::SBError::Clear(), LLDB_RECORD_DUMMY, lldb::SBError::SetError(), and lldb::SBError::SetErrorString().

◆ GetTraceUID()

lldb::user_id_t SBTrace::GetTraceUID ( )

Definition at line 94 of file SBTrace.cpp.

References LLDB_INVALID_UID, and LLDB_RECORD_METHOD_NO_ARGS.

◆ IsValid()

bool SBTrace::IsValid ( )

Definition at line 117 of file SBTrace.cpp.

References LLDB_RECORD_METHOD_NO_ARGS.

◆ operator bool()

SBTrace::operator bool ( ) const
explicit

Definition at line 121 of file SBTrace.cpp.

References LLDB_RECORD_METHOD_CONST_NO_ARGS.

◆ SetSP()

void SBTrace::SetSP ( const ProcessSP &  process_sp)
protected

Definition at line 115 of file SBTrace.cpp.

Referenced by lldb::SBProcess::StartTrace().

◆ SetTraceUID()

void SBTrace::SetTraceUID ( lldb::user_id_t  uid)
protected

Definition at line 102 of file SBTrace.cpp.

Referenced by lldb::SBProcess::StartTrace().

◆ StopTrace()

void SBTrace::StopTrace ( SBError error,
lldb::tid_t  thread_id = LLDB_INVALID_THREAD_ID 
)

Stop the tracing instance.

Stopping the trace will also lead to deletion of any gathered trace data.

Parameters
[out]errorAn error explaining what went wrong.
[in]thread_idThe trace id could map to a tracing instance for a thread or could also map to a group of threads being traced with the same trace options. A thread_id is normally optional except in the case of tracing a complete process and tracing needs to switched off on a particular thread. A situation could occur where initially a thread (lets say thread A) is being individually traced with a particular trace id and then tracing is started on the complete process, in this case thread A will continue without any change. All newly spawned threads would be traced with the trace id of the process. Now if the StopTrace API is called for the whole process, thread A will not be stopped and must be stopped separately.

Definition at line 65 of file SBTrace.cpp.

References lldb::SBError::Clear(), LLDB_RECORD_METHOD, lldb::SBError::SetError(), and lldb::SBError::SetErrorString().

Friends And Related Function Documentation

◆ SBProcess

friend class SBProcess
friend

Definition at line 102 of file SBTrace.h.

Member Data Documentation

◆ m_opaque_wp

lldb::ProcessWP lldb::SBTrace::m_opaque_wp
protected

Definition at line 112 of file SBTrace.h.

◆ m_trace_impl_sp

TraceImplSP lldb::SBTrace::m_trace_impl_sp
protected

Definition at line 106 of file SBTrace.h.


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