是否有针对包含 protobuf 有效负载的流或字节数组的 Visual Studio 调试可视化工具?
有人知道 protobuf 内容的 VS 调试可视化工具吗?
Does anybody knows of a VS debug visualizer for the protobuf content?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我个人不知道,尽管wireshark 存在(如果有帮助的话)。
我还没有时间查看必要的 VS 扩展 API;另请注意,除非您有模式(作为
.proto
或通过类型模型),否则格式在内部是不明确的 - 例如,varint 可以是二进制补码或 zig-zag 编码(使用线路上没有区别),或者固定的 32 可以是 int、float 等。字符串可以是 UTF-8 字符串、压缩数组或子消息。等等。如果有人想实现这一点,可用的
ProtoReader
已经公开了处理核心编码所需的 API - 只是解释编码确实需要访问架构。另外,VS 可视化技巧!我可能会建议(除非您预计原始数据本身已损坏)一个更简单的选择是反序列化为对象,并在调试器中查看该对象。
I for one don't, although one exists for wireshark if that helps.
I haven't had time to look at the VS extension API necessary; also note that unless you have the schema (either as
.proto
, or via a type-model) the format is internally ambiguous - a varint could be twos-complement or zig-zag encoded for example (with no distinction on the wire), or a fixed32 could be an int, a float, etc. A string could be a UTF-8 string, a packed array, or a sub-message. And so on.If anyone wanted to implement this, the
ProtoReader
available already exposes the necessary API to handle the core encoding - it is simply that interpreting that encoding really needs access to the schema. Plus, VS visualizer skills!Might I suggest that (unless you expect the raw data itself is corrupt) a simpler option is to deserialize into an object, and view the object in the debugger.