protocolbuffers / protoscope

Protoscope is a simple, human-editable language for representing and emitting the Protobuf wire format.
Apache License 2.0
307 stars 36 forks source link

Implement schema support for disassembly #6

Closed mcy closed 2 years ago

mcy commented 2 years ago

This PR adds a number of new features to the disassembler, foremost the ability to consume a message descriptor that makes the disassembly heuristics much smarter. Changes include:

  1. Given a descriptor, correct disassembly of: a. ZigZag values. c. Unsigned values. b. Bools. c. Subnormal floats. d. Packed fields.
  2. Given a descriptor, remarks with field names and enum value names.
  3. Smarter collapse of braces during printing.
  4. Better alignment of disassembler remarks.
  5. Flags for showing the spec (showing it in -help is rude) and whether to show bitpatterns of floats (off by default now).
mcy commented 2 years ago

(I am probably going to attempt to break this into a sequence of three PRs that improve the printing and flag-parsing facilities of the library, followed by schema-awareness.)

mcy commented 2 years ago

This PR is now in a reviewable state.

Adawntoremember commented 9 months ago

(I am probably going to attempt to break this into a sequence of three PRs that improve the printing and flag-parsing facilities of the library, followed by schema-awareness.)