brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · ff5e06d Raw
52 lines · c
1//===----------------------------------------------------------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_SOURCE_PLUGINS_PROCESS_WASM_UNWINDWASM_H10#define LLDB_SOURCE_PLUGINS_PROCESS_WASM_UNWINDWASM_H11 12#include "lldb/Target/RegisterContext.h"13#include "lldb/Target/Unwind.h"14#include <vector>15 16namespace lldb_private {17namespace wasm {18 19/// UnwindWasm manages stack unwinding for a WebAssembly process.20class UnwindWasm : public lldb_private::Unwind {21public:22  UnwindWasm(lldb_private::Thread &thread) : Unwind(thread) {}23  ~UnwindWasm() override = default;24 25protected:26  void DoClear() override {27    m_frames.clear();28    m_unwind_complete = false;29  }30 31  uint32_t DoGetFrameCount() override;32 33  bool DoGetFrameInfoAtIndex(uint32_t frame_idx, lldb::addr_t &cfa,34                             lldb::addr_t &pc,35                             bool &behaves_like_zeroth_frame) override;36 37  lldb::RegisterContextSP38  DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) override;39 40private:41  std::vector<lldb::addr_t> m_frames;42  bool m_unwind_complete = false;43 44  UnwindWasm(const UnwindWasm &);45  const UnwindWasm &operator=(const UnwindWasm &) = delete;46};47 48} // namespace wasm49} // namespace lldb_private50 51#endif52