3#include "backend/WebAssembly.hpp"
5#include <v8-inspector.h>
29 void sendResponse(
int, std::unique_ptr<v8_inspector::StringBuffer> message)
override;
30 void sendNotification(std::unique_ptr<v8_inspector::StringBuffer> message)
override;
40 std::unique_ptr<WebSocketServer::Connection>
conn_;
43 std::unique_ptr<v8_inspector::V8InspectorSession>
session_;
44 std::function<void(
void)>
code_;
58 void start(std::function<
void(
void)> code) {
59 code_ = std::move(code);
80void insist(
const v8::FunctionCallbackInfo<v8::Value> &info);
81void _throw(
const v8::FunctionCallbackInfo<v8::Value> &info);
82void print(
const v8::FunctionCallbackInfo<v8::Value> &info);
86template<
typename Index,
typename V8ValueT,
bool IsLower>
87void index_seek(
const v8::FunctionCallbackInfo<v8::Value> &info);
88template<
typename Index>
91v8::Local<v8::String>
mkstr(v8::Isolate &isolate,
const std::string &str);
92v8::Local<v8::WasmModuleObject>
instantiate(v8::Isolate &isolate, v8::Local<v8::Object> imports);
94v8::Local<v8::String>
to_json(v8::Isolate &isolate, v8::Local<v8::Value> val);
97void run_inspector(V8InspectorClientImpl &inspector, v8::Isolate &isolate, v8::Local<v8::Object> env);
void insist(const v8::FunctionCallbackInfo< v8::Value > &info)
void _throw(const v8::FunctionCallbackInfo< v8::Value > &info)
v8::Local< v8::Object > create_env(v8::Isolate &isolate, const m::MatchBase &plan)
v8::Local< v8::WasmModuleObject > instantiate(v8::Isolate &isolate, v8::Local< v8::Object > imports)
std::string create_js_debug_script(v8::Isolate &isolate, v8::Local< v8::Object > env, const WasmEngine::WasmContext &wasm_context)
void print_memory_consumption(const v8::FunctionCallbackInfo< v8::Value > &info)
void set_wasm_instance_raw_memory(const v8::FunctionCallbackInfo< v8::Value > &info)
v8::Local< v8::String > mkstr(v8::Isolate &isolate, const std::string &str)
void index_sequential_scan(const v8::FunctionCallbackInfo< v8::Value > &info)
void run_inspector(V8InspectorClientImpl &inspector, v8::Isolate &isolate, v8::Local< v8::Object > env)
void print(const v8::FunctionCallbackInfo< v8::Value > &info)
void index_seek(const v8::FunctionCallbackInfo< v8::Value > &info)
v8::Local< v8::String > to_json(v8::Isolate &isolate, v8::Local< v8::Value > val)
void read_result_set(const v8::FunctionCallbackInfo< v8::Value > &info)
A WasmContext holds associated information of a WebAssembly module instance.
std::unique_ptr< WebSocketServer::Connection > conn_
std::function< void(void)> code_
the code to execute in the debugger
void waitFrontendMessageOnPause()
void runMessageLoopOnPause(int) override
Synchronously consume all front end (CDT) debugging messages.
void quitMessageLoopOnPause() override
Called by V8 when no more inspector messages are pending.
V8InspectorClientImpl(const V8InspectorClientImpl &)=delete
void register_context(v8::Local< v8::Context > context)
Register the context object in the V8Inspector instance.
std::unique_ptr< WebSocketChannel > channel_
std::unique_ptr< v8_inspector::V8InspectorSession > session_
void on_message(std::string_view sv)
void start(std::function< void(void)> code)
void deregister_context(v8::Local< v8::Context > context)
Deregister the context object in the V8Inspector instance.
std::unique_ptr< v8_inspector::V8Inspector > inspector_
void sendResponse(int, std::unique_ptr< v8_inspector::StringBuffer > message) override
void sendNotification(std::unique_ptr< v8_inspector::StringBuffer > message) override
WebSocketServer::Connection & conn_
WebSocketChannel(v8::Isolate *isolate, WebSocketServer::Connection &conn)
WebSocketServer::Connection & connection() const
void flushProtocolNotifications() override