LLDB
mainline
llvm-project
lldb
include
lldb
Target
StackID.h
Go to the documentation of this file.
1
//===-- StackID.h -----------------------------------------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLDB_TARGET_STACKID_H
10
#define LLDB_TARGET_STACKID_H
11
12
#include "
lldb/Core/AddressRange.h
"
13
14
namespace
lldb_private
{
15
16
class
Process
;
17
18
class
StackID
{
19
public
:
20
StackID
() =
default
;
21
22
explicit
StackID
(
lldb::addr_t
pc
,
lldb::addr_t
cfa,
23
SymbolContextScope
*symbol_scope,
Process
*process);
24
25
~StackID
() =
default
;
26
27
lldb::addr_t
GetPC
()
const
{
return
m_pc
; }
28
29
lldb::addr_t
GetCallFrameAddressWithMetadata
()
const
{
30
return
m_cfa_with_metadata
;
31
}
32
33
lldb::addr_t
GetCallFrameAddressWithoutMetadata
()
const
{
return
m_cfa
; }
34
35
SymbolContextScope
*
GetSymbolContextScope
()
const
{
return
m_symbol_scope
; }
36
37
void
SetSymbolContextScope
(
SymbolContextScope
*symbol_scope) {
38
m_symbol_scope
= symbol_scope;
39
}
40
41
void
Clear
() {
42
m_pc
=
LLDB_INVALID_ADDRESS
;
43
m_cfa
=
LLDB_INVALID_ADDRESS
;
44
m_symbol_scope
=
nullptr
;
45
}
46
47
bool
IsValid
()
const
{
48
return
m_pc
!=
LLDB_INVALID_ADDRESS
||
m_cfa
!=
LLDB_INVALID_ADDRESS
;
49
}
50
51
void
Dump
(
Stream
*s);
52
53
protected
:
54
friend
class
StackFrame
;
55
56
void
SetPC
(
lldb::addr_t
pc
,
Process
*process);
57
void
SetCFA
(
lldb::addr_t
cfa,
Process
*process);
58
59
/// The pc value for the function/symbol for this frame. This will only get
60
/// used if the symbol scope is nullptr (the code where we are stopped is not
61
/// represented by any function or symbol in any shared library).
62
lldb::addr_t
m_pc
=
LLDB_INVALID_ADDRESS
;
63
64
/// The call frame address (stack pointer) value at the beginning of the
65
/// function that uniquely identifies this frame (along with m_symbol_scope
66
/// below)
67
lldb::addr_t
m_cfa
=
LLDB_INVALID_ADDRESS
;
68
69
/// The cfa with metadata (i.e. prior to Process::FixAddress).
70
lldb::addr_t
m_cfa_with_metadata
=
LLDB_INVALID_ADDRESS
;
71
72
/// If nullptr, there is no block or symbol for this frame. If not nullptr,
73
/// this will either be the scope for the lexical block for the frame, or the
74
/// scope for the symbol. Symbol context scopes are always be unique pointers
75
/// since the are part of the Block and Symbol objects and can easily be used
76
/// to tell if a stack ID is the same as another.
77
SymbolContextScope
*
m_symbol_scope
=
nullptr
;
78
};
79
80
bool
operator==
(
const
StackID
&lhs,
const
StackID
&rhs);
81
bool
operator!=
(
const
StackID
&lhs,
const
StackID
&rhs);
82
83
// frame_id_1 < frame_id_2 means "frame_id_1 is YOUNGER than frame_id_2"
84
bool
operator<
(
const
StackID
&lhs,
const
StackID
&rhs);
85
86
}
// namespace lldb_private
87
88
#endif
// LLDB_TARGET_STACKID_H
AddressRange.h
pc
@ pc
Definition
CompactUnwindInfo.cpp:1240
lldb_private::Process
A plug-in interface definition class for debugging a process.
Definition
Process.h:357
lldb_private::StackID
Definition
StackID.h:18
lldb_private::StackID::Dump
void Dump(Stream *s)
Definition
StackID.cpp:37
lldb_private::StackID::m_cfa
lldb::addr_t m_cfa
The call frame address (stack pointer) value at the beginning of the function that uniquely identifie...
Definition
StackID.h:67
lldb_private::StackID::GetCallFrameAddressWithoutMetadata
lldb::addr_t GetCallFrameAddressWithoutMetadata() const
Definition
StackID.h:33
lldb_private::StackID::SetPC
void SetPC(lldb::addr_t pc, Process *process)
Definition
StackID.cpp:28
lldb_private::StackID::IsValid
bool IsValid() const
Definition
StackID.h:47
lldb_private::StackID::GetSymbolContextScope
SymbolContextScope * GetSymbolContextScope() const
Definition
StackID.h:35
lldb_private::StackID::Clear
void Clear()
Definition
StackID.h:41
lldb_private::StackID::~StackID
~StackID()=default
lldb_private::StackID::m_pc
lldb::addr_t m_pc
The pc value for the function/symbol for this frame.
Definition
StackID.h:62
lldb_private::StackID::GetPC
lldb::addr_t GetPC() const
Definition
StackID.h:27
lldb_private::StackID::m_cfa_with_metadata
lldb::addr_t m_cfa_with_metadata
The cfa with metadata (i.e. prior to Process::FixAddress).
Definition
StackID.h:70
lldb_private::StackID::StackID
StackID()=default
lldb_private::StackID::StackFrame
friend class StackFrame
Definition
StackID.h:54
lldb_private::StackID::m_symbol_scope
SymbolContextScope * m_symbol_scope
If nullptr, there is no block or symbol for this frame.
Definition
StackID.h:77
lldb_private::StackID::SetSymbolContextScope
void SetSymbolContextScope(SymbolContextScope *symbol_scope)
Definition
StackID.h:37
lldb_private::StackID::GetCallFrameAddressWithMetadata
lldb::addr_t GetCallFrameAddressWithMetadata() const
Definition
StackID.h:29
lldb_private::StackID::SetCFA
void SetCFA(lldb::addr_t cfa, Process *process)
Definition
StackID.cpp:32
lldb_private::Stream
A stream class that can stream formatted output to a file.
Definition
Stream.h:28
lldb_private::SymbolContextScope
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Definition
SymbolContextScope.h:64
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition
lldb-defines.h:82
lldb_private
A class that represents a running process on the host machine.
Definition
SBAddressRange.h:14
lldb_private::operator!=
bool operator!=(const Address &lhs, const Address &rhs)
Definition
Address.cpp:1017
lldb_private::operator==
bool operator==(const Address &lhs, const Address &rhs)
Definition
Address.cpp:1011
lldb_private::operator<
bool operator<(const Address &lhs, const Address &rhs)
Definition
Address.cpp:980
lldb::addr_t
uint64_t addr_t
Definition
lldb-types.h:80
Generated on
for LLDB by
1.14.0