LLDB mainline
UnwindWasm.h
Go to the documentation of this file.
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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_PLUGINS_PROCESS_WASM_UNWINDWASM_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_WASM_UNWINDWASM_H
11
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.
21public:
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,
35 bool &behaves_like_zeroth_frame) override;
36
39
40private:
41 std::vector<lldb::addr_t> m_frames;
42 bool m_unwind_complete = false;
43
45 const UnwindWasm &operator=(const UnwindWasm &) = delete;
46};
47
48} // namespace wasm
49} // namespace lldb_private
50
51#endif
This base class provides an interface to stack frames.
Definition StackFrame.h:44
Unwind(Thread &thread)
Definition Unwind.h:21
UnwindWasm(lldb_private::Thread &thread)
Definition UnwindWasm.h:22
std::vector< lldb::addr_t > m_frames
Definition UnwindWasm.h:41
lldb::RegisterContextSP DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) override
bool DoGetFrameInfoAtIndex(uint32_t frame_idx, lldb::addr_t &cfa, lldb::addr_t &pc, bool &behaves_like_zeroth_frame) override
~UnwindWasm() override=default
UnwindWasm(const UnwindWasm &)
uint32_t DoGetFrameCount() override
const UnwindWasm & operator=(const UnwindWasm &)=delete
A class that represents a running process on the host machine.
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP