SBTrace#

class lldb.SBTrace#

Represents a processor trace.

Methods Summary

CreateNewCursor(error, thread)

Get a TraceCursor for the given thread's trace.

GetStartConfigurationHelp()

rtype:

string

IsValid(SBTrace self)

LoadTraceFromFile(error, debugger, ...)

See SBDebugger::LoadTraceFromFile.

SaveToDisk(error, bundle_dir[, compact])

Save the trace to the specified directory, which will be created if needed.

Start(*args)

Overload 1:

Stop(*args)

Overload 1: Stop tracing all threads in a live process.

Methods Documentation

CreateNewCursor(error, thread)#

Get a TraceCursor for the given thread’s trace.

Parameters:
  • error (SBError, out) – This will be set with an error in case of failures.

  • thread (SBThread, in) – The thread to get a TraceCursor for.

Return type:

SBTraceCursor

Returns:

A SBTraceCursor. If the thread is not traced or its trace information failed to load, an invalid SBTraceCursor is returned and the error parameter is set.

GetStartConfigurationHelp()#
Return type:

string

Returns:

A description of the parameters to use for the SBTrace::Start method, or null if the object is invalid.

IsValid(SBTrace self) bool#
static LoadTraceFromFile(error, debugger, trace_description_file)#

See SBDebugger::LoadTraceFromFile.

SaveToDisk(error, bundle_dir, compact=False)#

Save the trace to the specified directory, which will be created if needed. This will also create a file <directory>/trace.json with the main properties of the trace session, along with others files which contain the actual trace data. The trace.json file can be used later as input for the “trace load” command to load the trace in LLDB, or for the method SBDebugger.LoadTraceFromFile().

Parameters:
  • error (SBError, out) – This will be set with an error in case of failures.

  • bundle_dir (SBFileSpec, in) – The directory where the trace files will be saved.

  • compact (boolean, in, optional) – Try not to save to disk information irrelevant to the traced processes. Each trace plug-in implements this in a different fashion.

Return type:

SBFileSpec

Returns:

A SBFileSpec pointing to the bundle description file.

Start(*args)#
Overload 1:

Start tracing all current and future threads in a live process using a provided configuration. This is referred as “process tracing” in the documentation.

This is equivalent to the command “process trace start”.

This operation fails if it is invoked twice in a row without first stopping the process trace with SBTrace::Stop().

If a thread is already being traced explicitly, e.g. with

SBTrace::Start(const SBThread &thread, const SBStructuredData

&configuration), it is left unaffected by this operation.

type configuration:

SBStructuredData, in

param configuration:

Dictionary object with custom fields for the corresponding trace technology.

Full details for the trace start parameters that can be set can be retrieved by calling SBTrace::GetStartConfigurationHelp().

rtype:

SBError

return:

An error explaining any failures.


Overload 2:

Start tracing a specific thread in a live process using a provided configuration. This is referred as “thread tracing” in the documentation.

This is equivalent to the command “thread trace start”.

If the thread is already being traced by a “process tracing” operation, e.g. with SBTrace::Start(const SBStructuredData &configuration), this operation fails.

type configuration:

SBStructuredData, in

param configuration:

Dictionary object with custom fields for the corresponding trace technology.

Full details for the trace start parameters that can be set can be retrieved by calling SBTrace::GetStartConfigurationHelp().

rtype:

SBError

return:

An error explaining any failures.

Stop(*args)#

Overload 1: Stop tracing all threads in a live process.

If a “process tracing” operation is active, e.g. SBTrace::Start(const SBStructuredData &configuration), this effectively prevents future threads from being traced.

This is equivalent to the command “process trace stop”.

Return type:

SBError

Returns:

An error explaining any failures.


Overload 2: Stop tracing a specific thread in a live process regardless of whether the thread was traced explicitly or as part of a “process tracing” operation.

This is equivalent to the command “thread trace stop”.

Return type:

SBError

Returns:

An error explaining any failures.