Zucchini: Create new "Disassembler Mock" architecture for patching algorithm |
||
Issue descriptionCurrently the end-to-end flow of Zucchini is mainly tested using actual executables, which are generated from known-good tool chains. To better stress-test Zucchini-gen and Zucchini-apply system, we'd like to create a "mock" architecture that can be easily created manually, to communicate examples and specify test cases. Some nice properties to have: - Everything is text-based, including reference bodies. - Multiple reference pools and types are present. Some early ideas: - Make this a regular text file, but '(...)' and '[...]' are used to specify references (at location). - There should be no special target label. - Perhaps '...' can simply specify line and column numbers (1-based by convention?) in a text file. - Can also use unary '+' and '-' to create relative address -> different type, same pool. - Might need to pad '0' to create const number of digits, to maintain the assumption that reference bodies of the same type have the same length. The mock will in fact be useful for debugging, if/when we want to add support for reference types with variable length.
,
May 23 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d2c5be5844c12d2585bde53ba891154ffed2ca62 commit d2c5be5844c12d2585bde53ba891154ffed2ca62 Author: Calder Kitagawa <ckitagawa@google.com> Date: Wed May 23 17:30:51 2018 [Zucchini] ZTF (text) disassembler A Zucchini text format (ZTF) disassembler for validating and debugging Zucchini using special text files. This is intended to be primarily used for easier validation of the core Zucchini algorithm. It is also useful for fuzzing reference projection as it is a lighter weight disassembler than other executable formats. References are encoded in an ASCII plain-text format to be human-readable and easier to debug. See the disassembler_ztf.h file for a complete outline of the file format. Which is referred to as Zucchini Text Format (ZTF) throughout the code. The design is meant to be highly flexible and non-redundant so a fair amount of templating/overloading is used. The overall design is: Shared: - ZtfConfig: To handle metadata for different types of references. - ZtfTranslator: Translate text references into offsets and back. Read: - ZtfParser: Find references in the file. - ZtfReferenceReader: Drive ZtfParser through the file and use it with ZtfTranslator to translate between offsets and references. Write: - ZtfWriter: The counterpart to parser for writing a reference to a location. - ZtfReferenceWriter: Compose ZtfWriter and ZtfTranslator together and write references to an image. Bug: 834904 Change-Id: Iec62c67eab6bd3e7e95b79798417035a4873360a Reviewed-on: https://chromium-review.googlesource.com/1056147 Commit-Queue: Calder Kitagawa <ckitagawa@google.com> Reviewed-by: Samuel Huang <huangs@chromium.org> Reviewed-by: Greg Thompson <grt@chromium.org> Cr-Commit-Position: refs/heads/master@{#561140} [modify] https://crrev.com/d2c5be5844c12d2585bde53ba891154ffed2ca62/components/zucchini/BUILD.gn [add] https://crrev.com/d2c5be5844c12d2585bde53ba891154ffed2ca62/components/zucchini/disassembler_ztf.cc [add] https://crrev.com/d2c5be5844c12d2585bde53ba891154ffed2ca62/components/zucchini/disassembler_ztf.h [add] https://crrev.com/d2c5be5844c12d2585bde53ba891154ffed2ca62/components/zucchini/disassembler_ztf_unittest.cc [modify] https://crrev.com/d2c5be5844c12d2585bde53ba891154ffed2ca62/components/zucchini/element_detection.cc [modify] https://crrev.com/d2c5be5844c12d2585bde53ba891154ffed2ca62/components/zucchini/image_utils.h [add] https://crrev.com/d2c5be5844c12d2585bde53ba891154ffed2ca62/components/zucchini/type_ztf.h
,
May 24 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by ckitagawa@google.com
, May 15 2018