LLDB mainline
Classes | Public Member Functions | Private Attributes | List of all members
lldb_private::TraceDumper::FunctionCall Class Reference

#include <TraceDumper.h>

Classes

class  TracedSegment
 
class  UntracedPrefixSegment
 

Public Member Functions

 FunctionCall (const lldb::TraceCursorSP &cursor_sp, const SymbolInfo &symbol_info)
 Create a new function call given an instruction.
 
void AppendSegment (const lldb::TraceCursorSP &cursor_sp, const SymbolInfo &symbol_info)
 Append a new traced segment to this function call.
 
const SymbolInfoGetSymbolInfo () const
 
bool IsError () const
 
const std::deque< TracedSegment > & GetTracedSegments () const
 
TracedSegmentGetLastTracedSegment ()
 
void SetUntracedPrefixSegment (FunctionCallUP &&nested_call)
 Create an untraced segment for this call that jumps to the provided nested call.
 
const std::optional< UntracedPrefixSegment > & GetUntracedPrefixSegment () const
 
FunctionCallGetParentCall () const
 
void SetParentCall (FunctionCall &parent_call)
 

Private Attributes

std::optional< UntracedPrefixSegmentm_untraced_prefix_segment
 An optional untraced segment that precedes all the traced segments.
 
std::deque< TracedSegmentm_traced_segments
 The traced segments in order.
 
FunctionCallm_parent_call = nullptr
 The parent call, which might be null.
 
bool m_is_error
 Whether this call represents a list of consecutive errors.
 

Detailed Description

Definition at line 209 of file TraceDumper.h.

Constructor & Destructor Documentation

◆ FunctionCall()

TraceDumper::FunctionCall::FunctionCall ( const lldb::TraceCursorSP cursor_sp,
const SymbolInfo symbol_info 
)

Create a new function call given an instruction.

This will also create a segment for that instruction.

Parameters
[in]cursor_spA cursor pointing to the first instruction of that function call.
[in]symbol_infoThe symbol information of that first instruction.

Definition at line 643 of file TraceDumper.cpp.

References AppendSegment(), and m_is_error.

Member Function Documentation

◆ AppendSegment()

void TraceDumper::FunctionCall::AppendSegment ( const lldb::TraceCursorSP cursor_sp,
const SymbolInfo symbol_info 
)

Append a new traced segment to this function call.

Parameters
[in]cursor_spA cursor pointing to the first instruction of the new segment.
[in]symbol_infoThe symbol information of that first instruction.

Definition at line 650 of file TraceDumper.cpp.

References m_traced_segments.

Referenced by AppendReturnedInstructionToFunctionCallForest(), and FunctionCall().

◆ GetLastTracedSegment()

TraceDumper::FunctionCall::TracedSegment & TraceDumper::FunctionCall::GetLastTracedSegment ( )
Returns
A non-const reference to the most-recent traced segment.

Definition at line 669 of file TraceDumper.cpp.

References m_traced_segments.

Referenced by AppendErrorToFunctionCallForest(), and AppendInstructionToFunctionCallForest().

◆ GetParentCall()

TraceDumper::FunctionCall * TraceDumper::FunctionCall::GetParentCall ( ) const
Returns
A pointer to the parent call. It may be nullptr.

Definition at line 683 of file TraceDumper.cpp.

References m_parent_call.

Referenced by AppendReturnedInstructionToFunctionCallForest().

◆ GetSymbolInfo()

const TraceDumper::SymbolInfo & TraceDumper::FunctionCall::GetSymbolInfo ( ) const
Returns
The symbol info of some traced instruction of this call.

Definition at line 657 of file TraceDumper.cpp.

References m_traced_segments.

Referenced by AppendReturnedInstructionToFunctionCallForest(), and OutputWriterCLI::DumpUntracedContext().

◆ GetTracedSegments()

const std::deque< TraceDumper::FunctionCall::TracedSegment > & TraceDumper::FunctionCall::GetTracedSegments ( ) const
Returns
The list of traced segments of this call.

Definition at line 664 of file TraceDumper.cpp.

References m_traced_segments.

Referenced by OutputWriterCLI::DumpFunctionCallTree(), and OutputWriterJSON::DumpFunctionCallTree().

◆ GetUntracedPrefixSegment()

const std::optional< TraceDumper::FunctionCall::UntracedPrefixSegment > & TraceDumper::FunctionCall::GetUntracedPrefixSegment ( ) const
Returns
A optional to the untraced prefix segment of this call.

Definition at line 674 of file TraceDumper.cpp.

References m_untraced_prefix_segment.

Referenced by OutputWriterCLI::DumpFunctionCallTree(), and OutputWriterJSON::DumpFunctionCallTree().

◆ IsError()

bool TraceDumper::FunctionCall::IsError ( ) const
Returns
true if and only if the instructions in this function call are trace errors, in which case this function call is a fake one.

Definition at line 661 of file TraceDumper.cpp.

References m_is_error.

Referenced by AppendErrorToFunctionCallForest(), AppendInstructionToFunctionCallForest(), OutputWriterCLI::DumpSegmentContext(), and OutputWriterCLI::DumpUntracedContext().

◆ SetParentCall()

void TraceDumper::FunctionCall::SetParentCall ( TraceDumper::FunctionCall parent_call)

Definition at line 687 of file TraceDumper.cpp.

References m_parent_call.

◆ SetUntracedPrefixSegment()

void TraceDumper::FunctionCall::SetUntracedPrefixSegment ( TraceDumper::FunctionCallUP &&  nested_call)

Create an untraced segment for this call that jumps to the provided nested call.

Definition at line 678 of file TraceDumper.cpp.

References m_untraced_prefix_segment.

Member Data Documentation

◆ m_is_error

bool lldb_private::TraceDumper::FunctionCall::m_is_error
private

Whether this call represents a list of consecutive errors.

Definition at line 373 of file TraceDumper.h.

Referenced by FunctionCall(), and IsError().

◆ m_parent_call

FunctionCall* lldb_private::TraceDumper::FunctionCall::m_parent_call = nullptr
private

The parent call, which might be null.

Useful for reconstructing callstacks.

Definition at line 371 of file TraceDumper.h.

Referenced by GetParentCall(), and SetParentCall().

◆ m_traced_segments

std::deque<TracedSegment> lldb_private::TraceDumper::FunctionCall::m_traced_segments
private

The traced segments in order.

We used a deque to prevent moving these objects when appending to the list, which would happen with vector.

Definition at line 368 of file TraceDumper.h.

Referenced by AppendSegment(), GetLastTracedSegment(), GetSymbolInfo(), and GetTracedSegments().

◆ m_untraced_prefix_segment

std::optional<UntracedPrefixSegment> lldb_private::TraceDumper::FunctionCall::m_untraced_prefix_segment
private

An optional untraced segment that precedes all the traced segments.

Definition at line 365 of file TraceDumper.h.

Referenced by GetUntracedPrefixSegment(), and SetUntracedPrefixSegment().


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