Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Visual Studio debug visualizer for a stream or byte array containing protobuf payload?

Does anybody knows of a VS debug visualizer for the protobuf content?

like image 249
mark Avatar asked Sep 13 '26 13:09

mark


1 Answers

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.

like image 51
Marc Gravell Avatar answered Sep 16 '26 13:09

Marc Gravell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!