Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / Utility / HistoryUnwind.h
blobcb72b5d0a176486a1df0c8cb7ebdc49992c8ee6d
1 //===-- HistoryUnwind.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 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_HISTORYUNWIND_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_HISTORYUNWIND_H
12 #include <vector>
14 #include "lldb/Target/Unwind.h"
15 #include "lldb/lldb-private.h"
17 namespace lldb_private {
19 class HistoryUnwind : public lldb_private::Unwind {
20 public:
21 HistoryUnwind(Thread &thread, std::vector<lldb::addr_t> pcs,
22 bool pcs_are_call_addresses = false);
24 ~HistoryUnwind() override;
26 protected:
27 void DoClear() override;
29 lldb::RegisterContextSP
30 DoCreateRegisterContextForFrame(StackFrame *frame) override;
32 bool DoGetFrameInfoAtIndex(uint32_t frame_idx, lldb::addr_t &cfa,
33 lldb::addr_t &pc,
34 bool &behaves_like_zeroth_frame) override;
35 uint32_t DoGetFrameCount() override;
37 private:
38 std::vector<lldb::addr_t> m_pcs;
39 /// This boolean indicates that the PCs in the non-0 frames are call
40 /// addresses and not return addresses.
41 bool m_pcs_are_call_addresses;
44 } // namespace lldb_private
46 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_HISTORYUNWIND_H