@@ -35,7 +35,8 @@ bool StackID::IsCFAOnStack(Process &process) const {
3535
3636StackID::StackID (lldb::addr_t pc, lldb::addr_t cfa,
3737 SymbolContextScope *symbol_scope, Process *process)
38- : m_pc(pc), m_cfa(cfa), m_symbol_scope(symbol_scope) {
38+ : m_pc(pc), m_cfa(cfa), m_cfa_with_metadata(cfa),
39+ m_symbol_scope(symbol_scope) {
3940 if (process) {
4041 m_pc = process->FixCodeAddress (m_pc);
4142 m_cfa = process->FixDataAddress (m_cfa);
@@ -47,6 +48,7 @@ void StackID::SetPC(lldb::addr_t pc, Process *process) {
4748}
4849
4950void StackID::SetCFA (lldb::addr_t cfa, Process *process) {
51+ m_cfa_with_metadata = cfa;
5052 m_cfa = process ? process->FixDataAddress (cfa) : cfa;
5153}
5254
@@ -67,7 +69,8 @@ void StackID::Dump(Stream *s) {
6769}
6870
6971bool lldb_private::operator ==(const StackID &lhs, const StackID &rhs) {
70- if (lhs.GetCallFrameAddress () != rhs.GetCallFrameAddress ())
72+ if (lhs.GetCallFrameAddressWithoutMetadata () !=
73+ rhs.GetCallFrameAddressWithoutMetadata ())
7174 return false ;
7275
7376 SymbolContextScope *lhs_scope = lhs.GetSymbolContextScope ();
@@ -134,8 +137,8 @@ CompareHeapCFAs(const StackID &lhs, const StackID &rhs, Process &process) {
134137 if (!lhs_cfa_on_stack && rhs_cfa_on_stack)
135138 return HeapCFAComparisonResult::Older;
136139
137- const lldb::addr_t lhs_cfa = lhs.GetCallFrameAddress ();
138- const lldb::addr_t rhs_cfa = rhs.GetCallFrameAddress ();
140+ const lldb::addr_t lhs_cfa = lhs.GetCallFrameAddressWithoutMetadata ();
141+ const lldb::addr_t rhs_cfa = rhs.GetCallFrameAddressWithoutMetadata ();
139142 // If the cfas are the same, fallback to the usual scope comparison.
140143 if (lhs_cfa == rhs_cfa)
141144 return HeapCFAComparisonResult::NoOpinion;
@@ -170,9 +173,9 @@ bool StackID::IsYounger(const StackID &lhs, const StackID &rhs,
170173 break ;
171174 }
172175 // END SWIFT
173-
174- const lldb::addr_t lhs_cfa = lhs.GetCallFrameAddress ();
175- const lldb::addr_t rhs_cfa = rhs.GetCallFrameAddress ();
176+ //
177+ const lldb::addr_t lhs_cfa = lhs.GetCallFrameAddressWithoutMetadata ();
178+ const lldb::addr_t rhs_cfa = rhs.GetCallFrameAddressWithoutMetadata ();
176179
177180 // FIXME: We are assuming that the stacks grow downward in memory. That's not
178181 // necessary, but true on
0 commit comments