10
10
#define LLDB_TARGET_STACKID_H
11
11
12
12
#include " lldb/Core/AddressRange.h"
13
- #include " lldb/lldb-private.h"
14
13
15
14
namespace lldb_private {
16
15
16
+ class Process ;
17
+
17
18
class StackID {
18
19
public:
19
- // Constructors and Destructors
20
20
StackID () = default ;
21
21
22
- StackID (const StackID &rhs) = default ;
22
+ explicit StackID (lldb::addr_t pc, lldb::addr_t cfa,
23
+ SymbolContextScope *symbol_scope, Process *process);
23
24
24
25
~StackID () = default ;
25
26
26
27
lldb::addr_t GetPC () const { return m_pc; }
27
28
28
- lldb::addr_t GetCallFrameAddress () const { return m_cfa; }
29
+ lldb::addr_t GetCallFrameAddressWithMetadata () const {
30
+ return m_cfa_with_metadata;
31
+ }
32
+
33
+ lldb::addr_t GetCallFrameAddressWithoutMetadata () const { return m_cfa; }
29
34
30
35
SymbolContextScope *GetSymbolContextScope () const { return m_symbol_scope; }
31
36
@@ -46,17 +51,6 @@ class StackID {
46
51
47
52
void Dump (Stream *s);
48
53
49
- // Operators
50
- const StackID &operator =(const StackID &rhs) {
51
- if (this != &rhs) {
52
- m_pc = rhs.m_pc ;
53
- m_cfa = rhs.m_cfa ;
54
- m_cfa_on_stack = rhs.m_cfa_on_stack ;
55
- m_symbol_scope = rhs.m_symbol_scope ;
56
- }
57
- return *this ;
58
- }
59
-
60
54
// / Check if the CFA is on the stack, or elsewhere in the process, such as on
61
55
// / the heap.
62
56
bool IsCFAOnStack (Process &process) const ;
@@ -68,34 +62,34 @@ class StackID {
68
62
protected:
69
63
friend class StackFrame ;
70
64
71
- explicit StackID (lldb::addr_t pc, lldb::addr_t cfa) : m_pc(pc), m_cfa(cfa) {}
72
-
73
- void SetPC (lldb::addr_t pc) { m_pc = pc; }
74
-
75
- void SetCFA (lldb::addr_t cfa) { m_cfa = cfa; }
76
-
77
- lldb::addr_t m_pc =
78
- LLDB_INVALID_ADDRESS; // The pc value for the function/symbol for this
79
- // frame. This will
80
- // only get used if the symbol scope is nullptr (the code where we are
81
- // stopped is not represented by any function or symbol in any shared
82
- // library).
83
- lldb::addr_t m_cfa =
84
- LLDB_INVALID_ADDRESS; // The call frame address (stack pointer) value
85
- // at the beginning of the function that uniquely
86
- // identifies this frame (along with m_symbol_scope
87
- // below)
88
- // True if the CFA is an address on the stack, false if it's an address
89
- // elsewhere (ie heap).
65
+ void SetPC (lldb::addr_t pc, Process *process);
66
+ void SetCFA (lldb::addr_t cfa, Process *process);
67
+
68
+ // / The pc value for the function/symbol for this frame. This will only get
69
+ // / used if the symbol scope is nullptr (the code where we are stopped is not
70
+ // / represented by any function or symbol in any shared library).
71
+ lldb::addr_t m_pc = LLDB_INVALID_ADDRESS;
72
+
73
+ // / The call frame address (stack pointer) value at the beginning of the
74
+ // / function that uniquely identifies this frame (along with m_symbol_scope
75
+ // / below)
76
+ lldb::addr_t m_cfa = LLDB_INVALID_ADDRESS;
77
+
78
+ // / The cfa with metadata (i.e. prior to Process::FixAddress).
79
+ lldb::addr_t m_cfa_with_metadata = LLDB_INVALID_ADDRESS;
80
+
81
+ // / If nullptr, there is no block or symbol for this frame. If not nullptr,
82
+ // / this will either be the scope for the lexical block for the frame, or the
83
+ // / scope for the symbol. Symbol context scopes are always be unique pointers
84
+ // / since the are part of the Block and Symbol objects and can easily be used
85
+ // / to tell if a stack ID is the same as another.
86
+ SymbolContextScope *m_symbol_scope = nullptr ;
87
+
88
+ // BEGIN SWIFT
89
+ // / True if the CFA is an address on the stack, false if it's an address
90
+ // / elsewhere (ie heap).
90
91
mutable LazyBool m_cfa_on_stack = eLazyBoolCalculate;
91
- SymbolContextScope *m_symbol_scope =
92
- nullptr ; // If nullptr, there is no block or symbol for this frame.
93
- // If not nullptr, this will either be the scope for the
94
- // lexical block for the frame, or the scope for the
95
- // symbol. Symbol context scopes are always be unique
96
- // pointers since the are part of the Block and Symbol
97
- // objects and can easily be used to tell if a stack ID
98
- // is the same as another.
92
+ // END SWIFT
99
93
};
100
94
101
95
bool operator ==(const StackID &lhs, const StackID &rhs);
0 commit comments