LLDB mainline
lldb_private::CallEdge Class Referenceabstract

Represent a call made within a Function. More...

#include "lldb/Symbol/Function.h"

Inheritance diagram for lldb_private::CallEdge:
[legend]

Public Types

enum class  AddrType : uint8_t { Call , AfterCall }

Public Member Functions

virtual FunctionGetCallee (ModuleList &images, ExecutionContext &exe_ctx)=0
 Get the callee's definition.
std::pair< AddrType, lldb::addr_tGetCallerAddress (Function &caller, Target &target) const
 Return an address in the caller.
bool IsTailCall () const
llvm::ArrayRef< CallSiteParameterGetCallSiteParameters () const
 Get the call site parameters available at this call edge.
std::pair< bool, lldb::addr_tGetSortKey () const
 Non-tail-calls go first, sorted by the return address.

Protected Member Functions

lldb::addr_t GetUnresolvedReturnPCAddress () const
 Like GetReturnPCAddress, but returns an unresolved file address.

Private Attributes

lldb::addr_t caller_address
AddrType caller_address_type
bool is_tail_call
CallSiteParameterArray parameters

Call site related structures

virtual ~CallEdge ()
lldb::addr_t GetReturnPCAddress (Function &caller, Target &target) const
 Get the load PC address of the instruction which executes after the call returns.
 CallEdge (AddrType caller_address_type, lldb::addr_t caller_address, bool is_tail_call, CallSiteParameterArray &&parameters)
static lldb::addr_t GetLoadAddress (lldb::addr_t unresolved_pc, Function &caller, Target &target)
 Helper that finds the load address of unresolved_pc, a file address which refers to an instruction within caller.

Detailed Description

Represent a call made within a Function.

This can be used to find a path in the call graph between two functions, or to evaluate DW_OP_entry_value.

Definition at line 268 of file Function.h.

Member Enumeration Documentation

◆ AddrType

enum class lldb_private::CallEdge::AddrType : uint8_t
strong
Enumerator
Call 
AfterCall 

Definition at line 270 of file Function.h.

Constructor & Destructor Documentation

◆ ~CallEdge()

CallEdge::~CallEdge ( )
virtualdefault

◆ CallEdge()

CallEdge::CallEdge ( AddrType caller_address_type,
lldb::addr_t caller_address,
bool is_tail_call,
CallSiteParameterArray && parameters )
protected

Member Function Documentation

◆ GetCallee()

virtual Function * lldb_private::CallEdge::GetCallee ( ModuleList & images,
ExecutionContext & exe_ctx )
pure virtual

Get the callee's definition.

Note that this might lazily invoke the DWARF parser. A register context from the caller's activation is needed to find indirect call targets.

Implemented in lldb_private::DirectCallEdge, and lldb_private::IndirectCallEdge.

Referenced by Evaluate_DW_OP_entry_value(), and FindInterveningFrames().

◆ GetCallerAddress()

std::pair< AddrType, lldb::addr_t > lldb_private::CallEdge::GetCallerAddress ( Function & caller,
Target & target ) const
inline

Return an address in the caller.

This can either be the address of the call instruction, or the address of the instruction after the call.

Definition at line 288 of file Function.h.

References caller_address, caller_address_type, and GetLoadAddress().

◆ GetCallSiteParameters()

llvm::ArrayRef< CallSiteParameter > lldb_private::CallEdge::GetCallSiteParameters ( ) const
inline

Get the call site parameters available at this call edge.

Definition at line 297 of file Function.h.

References parameters.

Referenced by Evaluate_DW_OP_entry_value().

◆ GetLoadAddress()

lldb::addr_t CallEdge::GetLoadAddress ( lldb::addr_t unresolved_pc,
Function & caller,
Target & target )
staticprotected

Helper that finds the load address of unresolved_pc, a file address which refers to an instruction within caller.

Definition at line 132 of file Function.cpp.

References lldb_private::Function::GetAddress(), lldb_private::Address::GetLoadAddress(), lldb_private::GetLog(), lldb_private::Address::GetModule(), LLDB_INVALID_ADDRESS, LLDB_LOG, and lldb_private::Step.

Referenced by GetCallerAddress(), and GetReturnPCAddress().

◆ GetReturnPCAddress()

lldb::addr_t CallEdge::GetReturnPCAddress ( Function & caller,
Target & target ) const

Get the load PC address of the instruction which executes after the call returns.

Returns LLDB_INVALID_ADDRESS iff this is a tail call. caller is the Function containing this call, and target is the Target which made the call.

Definition at line 155 of file Function.cpp.

References GetLoadAddress(), and GetUnresolvedReturnPCAddress().

◆ GetSortKey()

std::pair< bool, lldb::addr_t > lldb_private::CallEdge::GetSortKey ( ) const
inline

Non-tail-calls go first, sorted by the return address.

They are followed by tail calls, which have no specific order.

Definition at line 303 of file Function.h.

References GetUnresolvedReturnPCAddress(), and is_tail_call.

◆ GetUnresolvedReturnPCAddress()

lldb::addr_t lldb_private::CallEdge::GetUnresolvedReturnPCAddress ( ) const
inlineprotected

Like GetReturnPCAddress, but returns an unresolved file address.

Definition at line 317 of file Function.h.

References AfterCall, caller_address, caller_address_type, is_tail_call, and LLDB_INVALID_ADDRESS.

Referenced by GetReturnPCAddress(), and GetSortKey().

◆ IsTailCall()

bool lldb_private::CallEdge::IsTailCall ( ) const
inline

Definition at line 294 of file Function.h.

References is_tail_call.

Member Data Documentation

◆ caller_address

◆ caller_address_type

◆ is_tail_call

◆ parameters


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