1010#define LLDB_TARGET_STACKID_H
1111
1212#include " lldb/Core/AddressRange.h"
13- #include " lldb/lldb-private.h"
1413
1514namespace lldb_private {
1615
16+ class Process ;
17+
1718class StackID {
1819public:
19- // Constructors and Destructors
2020 StackID () = default ;
2121
22- StackID (const StackID &rhs) = default ;
22+ explicit StackID (lldb::addr_t pc, lldb::addr_t cfa,
23+ SymbolContextScope *symbol_scope, Process *process);
2324
2425 ~StackID () = default ;
2526
2627 lldb::addr_t GetPC () const { return m_pc; }
2728
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; }
2934
3035 SymbolContextScope *GetSymbolContextScope () const { return m_symbol_scope; }
3136
@@ -46,17 +51,6 @@ class StackID {
4651
4752 void Dump (Stream *s);
4853
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-
6054 // / Check if the CFA is on the stack, or elsewhere in the process, such as on
6155 // / the heap.
6256 bool IsCFAOnStack (Process &process) const ;
@@ -68,34 +62,34 @@ class StackID {
6862protected:
6963 friend class StackFrame ;
7064
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).
9091 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
9993};
10094
10195bool operator ==(const StackID &lhs, const StackID &rhs);
0 commit comments