LLDB  mainline
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
lldb_private::CallEdge Class Referenceabstract

#include "lldb/Symbol/Function.h"

Inheritance diagram for lldb_private::CallEdge:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::CallEdge:
Collaboration graph
[legend]

Public Types

enum  AddrType : uint8_t { AddrType::Call, AddrType::AfterCall }
 

Public Member Functions

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

Protected Member Functions

 CallEdge (AddrType caller_address_type, lldb::addr_t caller_address, bool is_tail_call, CallSiteParameterArray &&parameters)
 
lldb::addr_t GetUnresolvedReturnPCAddress () const
 Like GetReturnPCAddress, but returns an unresolved file address. More...
 

Private Attributes

lldb::addr_t caller_address
 
AddrType caller_address_type
 
bool is_tail_call
 
CallSiteParameterArray parameters
 

Call site related structures

lldb::addr_t GetReturnPCAddress (Function &caller, Target &target) const
 Get the load PC address of the instruction which executes after the call returns. More...
 
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. More...
 

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 271 of file Function.h.

Member Enumeration Documentation

◆ AddrType

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

Definition at line 273 of file Function.h.

Constructor & Destructor Documentation

◆ ~CallEdge()

virtual lldb_private::CallEdge::~CallEdge ( )
virtualdefault

◆ CallEdge()

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

Definition at line 311 of file Function.h.

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::IndirectCallEdge, and lldb_private::DirectCallEdge.

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 291 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 300 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 123 of file Function.cpp.

References lldb_private::Function::GetAddressRange(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::Address::GetLoadAddress(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::Address::GetModule(), LIBLLDB_LOG_STEP, LLDB_INVALID_ADDRESS, and LLDB_LOG.

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 146 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 306 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 323 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 297 of file Function.h.

References is_tail_call.

Member Data Documentation

◆ caller_address

lldb::addr_t lldb_private::CallEdge::caller_address
private

Definition at line 330 of file Function.h.

Referenced by GetCallerAddress(), and GetUnresolvedReturnPCAddress().

◆ caller_address_type

AddrType lldb_private::CallEdge::caller_address_type
private

Definition at line 331 of file Function.h.

Referenced by GetCallerAddress(), and GetUnresolvedReturnPCAddress().

◆ is_tail_call

bool lldb_private::CallEdge::is_tail_call
private

Definition at line 332 of file Function.h.

Referenced by GetSortKey(), GetUnresolvedReturnPCAddress(), and IsTailCall().

◆ parameters

CallSiteParameterArray lldb_private::CallEdge::parameters
private

Definition at line 334 of file Function.h.

Referenced by GetCallSiteParameters().


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