3

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

mark
  • 59,016
  • 79
  • 296
  • 580

1 Answers1

1

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.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • I am trying to understand why my DTOs are not deserialized as I expect. This could be either failure during the serialization or during the deserialization. If I could make sure that the particular properties are in the protobuf stream, then I would deduce that the problem is during the deserialization. This is why I wanted to be able to visualize the protobuf stream. A viable alternative would be a verbose mode of operation, where protobuf-net logs everything it serializes. – mark Jun 08 '11 at 21:14
  • @mark - that sounds pretty invasive... it could be done, but maybe it would be easier to just describe the problem? (by comparison: I wouldn't expect XmlSerializer or DataContractSerializer to be so chatty) – Marc Gravell Jun 08 '11 at 21:18
  • http://stackoverflow.com/questions/6285755/help-needed-with-the-most-trivial-protobuf-net-example-4 – mark Jun 08 '11 at 21:57