// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_ZUCCHINI_DISASSEMBLER_H_ #define COMPONENTS_ZUCCHINI_DISASSEMBLER_H_ #include <stddef.h> #include <memory> #include <string> #include <vector> #include "components/zucchini/buffer_view.h" #include "components/zucchini/image_utils.h" namespace zucchini { // A vacuous ReferenceReader that produces no references. class EmptyReferenceReader : public ReferenceReader { … }; // A vacuous EmptyReferenceWriter that does not write. class EmptyReferenceWriter : public ReferenceWriter { … }; // Disassembler needs to be declared before ReferenceGroup because the latter // contains member pointers based on the former, and we use a compiler flag, // -fcomplete-member-pointers, which enforces that member pointer base types are // complete. This flag helps prevent us from running into problems in the // Microsoft C++ ABI (see https://crbug.com/847724). class ReferenceGroup; // A Disassembler is used to encapsulate architecture specific operations, to: // - Describe types of references found in the architecture using traits. // - Extract references contained in an image file. // - Correct target for some references. class Disassembler { … }; // A ReferenceGroup is associated with a specific |type| and has convenience // methods to obtain readers and writers for that type. A ReferenceGroup does // not store references; it is a lightweight class that communicates with the // disassembler to operate on them. class ReferenceGroup { … }; } // namespace zucchini #endif // COMPONENTS_ZUCCHINI_DISASSEMBLER_H_