1 //===-- UnwindMacOSXFrameBackchain.h ----------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef lldb_UnwindMacOSXFrameBackchain_h_
10 #define lldb_UnwindMacOSXFrameBackchain_h_
14 #include "lldb/Target/Unwind.h"
15 #include "lldb/lldb-private.h"
17 class UnwindMacOSXFrameBackchain : public lldb_private::Unwind {
19 UnwindMacOSXFrameBackchain(lldb_private::Thread &thread);
21 ~UnwindMacOSXFrameBackchain() override = default;
24 void DoClear() override { m_cursors.clear(); }
26 uint32_t DoGetFrameCount() override;
28 bool DoGetFrameInfoAtIndex(uint32_t frame_idx, lldb::addr_t &cfa,
30 bool &behaves_like_zeroth_frame) override;
32 lldb::RegisterContextSP
33 DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) override;
35 friend class RegisterContextMacOSXFrameBackchain;
38 lldb::addr_t pc; // Program counter
39 lldb::addr_t fp; // Frame pointer for us with backchain
43 std::vector<Cursor> m_cursors;
45 size_t GetStackFrameData_i386(const lldb_private::ExecutionContext &exe_ctx);
48 GetStackFrameData_x86_64(const lldb_private::ExecutionContext &exe_ctx);
50 // For UnwindMacOSXFrameBackchain only
51 DISALLOW_COPY_AND_ASSIGN(UnwindMacOSXFrameBackchain);
54 #endif // lldb_UnwindMacOSXFrameBackchain_h_