1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef DISASSEMBLER_ACCUMULATORS_H 17 #define DISASSEMBLER_ACCUMULATORS_H 18 19 #include <map> 20 #include <string> 21 #include <vector> 22 23 #include "libpandafile/debug_info_extractor.h" 24 25 namespace panda::disasm { 26 using LabelTable = std::map<size_t, std::string>; 27 using IdList = std::vector<panda::panda_file::File::EntityId>; 28 29 struct MethodInfo { 30 std::string method_info; 31 32 std::vector<std::string> instructions_info; 33 34 panda_file::LineNumberTable line_number_table; 35 36 panda_file::ColumnNumberTable column_number_table; 37 38 panda_file::LocalVariableTable local_variable_table; 39 }; 40 41 struct RecordInfo { 42 std::string record_info; 43 44 std::vector<std::string> fields_info; 45 }; 46 47 struct ProgInfo { 48 std::map<std::string, RecordInfo> records_info; 49 std::map<std::string, MethodInfo> methods_info; 50 }; 51 52 using AnnotationList = std::vector<std::pair<std::string, std::string>>; 53 54 struct RecordAnnotations { 55 AnnotationList ann_list; 56 std::map<std::string, AnnotationList> field_annotations; 57 }; 58 59 struct ProgAnnotations { 60 std::map<std::string, AnnotationList> method_annotations; 61 std::map<std::string, RecordAnnotations> record_annotations; 62 }; 63 } // namespace panda::disasm 64 65 #endif // DISASSEMBLER_ACCUMULATORS_H 66