LLDB mainline
lldb_private::TraceDumper Class Reference

Class used to dump the instructions of a TraceCursor using its current state and granularity. More...

#include <TraceDumper.h>

Classes

class  FunctionCall
class  OutputWriter
 Interface used to abstract away the format in which the instruction information will be dumped. More...
struct  SymbolInfo
 Helper struct that holds symbol, disassembly and address information of an instruction. More...
struct  TraceItem
 Helper struct that holds all the information we know about a trace item. More...

Public Types

using FunctionCallUP = std::unique_ptr<FunctionCall>

Public Member Functions

 TraceDumper (lldb::TraceCursorSP cursor_sp, Stream &s, const TraceDumperOptions &options)
 Create a instruction dumper for the cursor.
std::optional< lldb::user_id_tDumpInstructions (size_t count)
 Dump count instructions of the thread trace starting at the current cursor position.
void DumpFunctionCalls ()
 Dump all function calls forwards chronologically and hierarchically.

Private Member Functions

TraceItem CreatRawTraceItem ()
 Create a trace item for the current position without symbol information.

Private Attributes

lldb::TraceCursorSP m_cursor_sp
TraceDumperOptions m_options
std::unique_ptr< OutputWriterm_writer_up

Detailed Description

Class used to dump the instructions of a TraceCursor using its current state and granularity.

Definition at line 51 of file TraceDumper.h.

Member Typedef Documentation

◆ FunctionCallUP

Definition at line 207 of file TraceDumper.h.

Constructor & Destructor Documentation

◆ TraceDumper()

TraceDumper::TraceDumper ( lldb::TraceCursorSP cursor_sp,
Stream & s,
const TraceDumperOptions & options )

Create a instruction dumper for the cursor.

Parameters
[in]cursorThe cursor whose instructions will be dumped.
[in]sThe stream where to dump the instructions to.
[in]optionsAdditional options for configuring the dumping.

Definition at line 441 of file TraceDumper.cpp.

References CreateWriter(), lldb::eTraceCursorSeekTypeBeginning, lldb::eTraceCursorSeekTypeEnd, m_cursor_sp, m_options, and m_writer_up.

Member Function Documentation

◆ CreatRawTraceItem()

TraceDumper::TraceItem TraceDumper::CreatRawTraceItem ( )
private

Create a trace item for the current position without symbol information.

Definition at line 461 of file TraceDumper.cpp.

References lldb_private::TraceDumper::TraceItem::id, m_cursor_sp, m_options, and lldb_private::TraceDumper::TraceItem::timestamp.

Referenced by DumpInstructions().

◆ DumpFunctionCalls()

void TraceDumper::DumpFunctionCalls ( )

Dump all function calls forwards chronologically and hierarchically.

Definition at line 907 of file TraceDumper.cpp.

References CreateFunctionCallForest(), m_cursor_sp, and m_writer_up.

Referenced by CommandObjectTraceDumpFunctionCalls::DoExecute().

◆ DumpInstructions()

std::optional< lldb::user_id_t > TraceDumper::DumpInstructions ( size_t count)

Dump count instructions of the thread trace starting at the current cursor position.

This effectively moves the cursor to the next unvisited position, so that a subsequent call to this method continues where it left off.

Parameters
[in]countThe number of instructions to print.
Returns
The instruction id of the last traversed instruction, or std::nullopt if no instructions were visited.

Definition at line 536 of file TraceDumper.cpp.

References CalculateSymbolInfo(), lldb_private::TraceDumper::TraceItem::cpu_id, CreatRawTraceItem(), lldb_private::TraceDumper::TraceItem::error, lldb::eTraceEventCPUChanged, lldb::eTraceEventDisabledHW, lldb::eTraceEventDisabledSW, lldb::eTraceEventHWClockTick, lldb::eTraceEventSyncPoint, lldb_private::TraceDumper::TraceItem::event, lldb_private::TraceDumper::TraceItem::hw_clock, lldb_private::TraceDumper::TraceItem::load_address, m_cursor_sp, m_options, m_writer_up, lldb_private::TraceDumper::TraceItem::prev_symbol_info, lldb_private::TraceDumper::TraceItem::symbol_info, and lldb_private::TraceDumper::TraceItem::sync_point_metadata.

Referenced by CommandObjectTraceDumpInstructions::DoExecute().

Member Data Documentation

◆ m_cursor_sp

lldb::TraceCursorSP lldb_private::TraceDumper::m_cursor_sp
private

Definition at line 427 of file TraceDumper.h.

Referenced by CreatRawTraceItem(), DumpFunctionCalls(), DumpInstructions(), and TraceDumper().

◆ m_options

TraceDumperOptions lldb_private::TraceDumper::m_options
private

Definition at line 428 of file TraceDumper.h.

Referenced by CreatRawTraceItem(), DumpInstructions(), and TraceDumper().

◆ m_writer_up

std::unique_ptr<OutputWriter> lldb_private::TraceDumper::m_writer_up
private

Definition at line 429 of file TraceDumper.h.

Referenced by DumpFunctionCalls(), DumpInstructions(), and TraceDumper().


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