blob: ff5e06d23d960e551f1b3f1fb9d7321a50a59385 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_WASM_UNWINDWASM_H
#define LLDB_SOURCE_PLUGINS_PROCESS_WASM_UNWINDWASM_H
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/Unwind.h"
#include <vector>
namespace lldb_private {
namespace wasm {
/// UnwindWasm manages stack unwinding for a WebAssembly process.
class UnwindWasm : public lldb_private::Unwind {
public:
UnwindWasm(lldb_private::Thread &thread) : Unwind(thread) {}
~UnwindWasm() override = default;
protected:
void DoClear() override {
m_frames.clear();
m_unwind_complete = false;
}
uint32_t DoGetFrameCount() override;
bool DoGetFrameInfoAtIndex(uint32_t frame_idx, lldb::addr_t &cfa,
lldb::addr_t &pc,
bool &behaves_like_zeroth_frame) override;
lldb::RegisterContextSP
DoCreateRegisterContextForFrame(lldb_private::StackFrame *frame) override;
private:
std::vector<lldb::addr_t> m_frames;
bool m_unwind_complete = false;
UnwindWasm(const UnwindWasm &);
const UnwindWasm &operator=(const UnwindWasm &) = delete;
};
} // namespace wasm
} // namespace lldb_private
#endif
|