gpt4 book ai didi

c++ - v8远程调试c++

转载 作者:行者123 更新时间:2023-11-30 05:02:10 25 4
gpt4 key购买 nike

我使用旧 v8 版本的套接字连接进行远程调试。远程调试不适用于最新的 v8 版本。因为某些方法已从 v8 中弃用或删除。 v8-debug.h 文件对调试没有用。

// Schedule a debugger break to happen when JavaScript code is run // in the given isolate. V8_DEPRECATED("No longer supported", static void DebugBreak(Isolate* isolate));

// Remove scheduled debugger break in given isolate if it has not
// happened yet. V8_DEPRECATED("No longer supported", static void CancelDebugBreak(Isolate* isolate));

// Check if a debugger break is scheduled in the given isolate.
V8_DEPRECATED("No longer supported", static bool CheckDebugBreak(Isolate* isolate));

// This is now a no-op. V8_DEPRECATED("No longer supported", static void SetMessageHandler(Isolate* isolate, MessageHandler handler));

// This is now a no-op. V8_DEPRECATED("No longer supported", static void SendCommand(Isolate* isolate, const uint16_t* command, int length, ClientData* client_data = NULL));

我找不到解决此问题的指南。 v8-inspector 是否有任何最小的 c++ 调试示例?

最佳答案

您可能想查看我写的关于该主题的此类文章:https://medium.com/@hyperandroid/v8-inspector-from-an-embedder-standpoint-7f9c0472e2b7

旧的调试器代理已被弃用并在一段时间前从主代码库中删除,以支持检查器 API,因此您基本上需要从头开始重写所有内容。

集成的棘手部分是:

  • websockets 作为 chrome 开发工具和您正在运行的代码库之间的传输(在我的例子中,是一个嵌入了 v8 的 Android 应用程序)。
  • 适本地处理 InspectorClient 中提供的自定义 runMessageLoopInPausequitMessageLoopInPause 方法。

关于c++ - v8远程调试c++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50017568/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com