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,
29 lldb::addr_t &pc) override;
31 lldb::RegisterContextSP
32 DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) override;
34 friend class RegisterContextMacOSXFrameBackchain;
37 lldb::addr_t pc; // Program counter
38 lldb::addr_t fp; // Frame pointer for us with backchain
42 std::vector<Cursor> m_cursors;
44 size_t GetStackFrameData_i386(const lldb_private::ExecutionContext &exe_ctx);
47 GetStackFrameData_x86_64(const lldb_private::ExecutionContext &exe_ctx);
49 // For UnwindMacOSXFrameBackchain only
50 DISALLOW_COPY_AND_ASSIGN(UnwindMacOSXFrameBackchain);
53 #endif // lldb_UnwindMacOSXFrameBackchain_h_