rdar://problem/10976649
Add SBFrame::IsEqual(const SBFrame &that) method and export it to the Python binding.
Alos add a test case test_frame_api_IsEqual() to TestFrames.py file.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152050 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBFrame.cpp b/source/API/SBFrame.cpp
index 8931e70..9f4709f 100644
--- a/source/API/SBFrame.cpp
+++ b/source/API/SBFrame.cpp
@@ -718,15 +718,23 @@
}
bool
+SBFrame::IsEqual (const SBFrame &that) const
+{
+ lldb::StackFrameSP this_sp = GetFrameSP();
+ lldb::StackFrameSP that_sp = that.GetFrameSP();
+ return (this_sp && that_sp && this_sp->GetStackID() == that_sp->GetStackID());
+}
+
+bool
SBFrame::operator == (const SBFrame &rhs) const
{
- return GetFrameSP().get() == rhs.GetFrameSP().get();
+ return IsEqual(rhs);
}
bool
SBFrame::operator != (const SBFrame &rhs) const
{
- return GetFrameSP().get() != rhs.GetFrameSP().get();
+ return !IsEqual(rhs);
}
SBThread