LLDB  mainline
UnwindMacOSXFrameBackchain.h
Go to the documentation of this file.
1 //===-- UnwindMacOSXFrameBackchain.h ----------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef lldb_UnwindMacOSXFrameBackchain_h_
10 #define lldb_UnwindMacOSXFrameBackchain_h_
11 
12 #include <vector>
13 
14 #include "lldb/Target/Unwind.h"
15 #include "lldb/lldb-private.h"
16 
18 public:
20 
21  ~UnwindMacOSXFrameBackchain() override = default;
22 
23 protected:
24  void DoClear() override { m_cursors.clear(); }
25 
26  uint32_t DoGetFrameCount() override;
27 
28  bool DoGetFrameInfoAtIndex(uint32_t frame_idx, lldb::addr_t &cfa,
29  lldb::addr_t &pc) override;
30 
31  lldb::RegisterContextSP
33 
35 
36  struct Cursor {
37  lldb::addr_t pc; // Program counter
38  lldb::addr_t fp; // Frame pointer for us with backchain
39  };
40 
41 private:
42  std::vector<Cursor> m_cursors;
43 
44  size_t GetStackFrameData_i386(const lldb_private::ExecutionContext &exe_ctx);
45 
46  size_t
47  GetStackFrameData_x86_64(const lldb_private::ExecutionContext &exe_ctx);
48 
49  // For UnwindMacOSXFrameBackchain only
50  DISALLOW_COPY_AND_ASSIGN(UnwindMacOSXFrameBackchain);
51 };
52 
53 #endif // lldb_UnwindMacOSXFrameBackchain_h_
lldb::RegisterContextSP DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) override
UnwindMacOSXFrameBackchain(lldb_private::Thread &thread)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
bool DoGetFrameInfoAtIndex(uint32_t frame_idx, lldb::addr_t &cfa, lldb::addr_t &pc) override
uint64_t addr_t
Definition: lldb-types.h:83
~UnwindMacOSXFrameBackchain() override=default
This base class provides an interface to stack frames.
Definition: StackFrame.h:40