//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// \file /// CoreSpec holds the internal representation of the data that will be /// written into the corefile. Theads, register sets within threads, registers /// within register sets. Block of memory. Metadata about the CPU or binaries /// that were present. //===----------------------------------------------------------------------===// #ifndef YAML2MACHOCOREFILE_CORESPEC_H #define YAML2MACHOCOREFILE_CORESPEC_H #include #include #include #include struct RegisterNameAndValue { std::string name; uint64_t value; }; enum RegisterFlavor { GPR = 0, FPR, EXC }; struct RegisterSet { RegisterFlavor flavor; std::vector registers; }; struct Thread { std::vector regsets; }; enum MemoryType { UInt8 = 0, UInt32, UInt64 }; struct MemoryRegion { uint64_t addr; MemoryType type; uint32_t size; // One of the following formats. std::vector bytes; std::vector words; std::vector doublewords; }; struct AddressableBits { std::optional lowmem_bits; std::optional highmem_bits; }; struct Binary { std::string name; std::string uuid; bool value_is_slide; uint64_t value; }; struct CoreSpec { uint32_t cputype; uint32_t cpusubtype; int wordsize; std::vector threads; std::vector memory_regions; std::optional addressable_bits; std::vector binaries; CoreSpec() : cputype(0), cpusubtype(0), wordsize(0) {} }; CoreSpec from_yaml(char *buf, size_t len); #endif