================
@@ -0,0 +1,55 @@
+//===-- CoreSpec.h 
--------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef YAML2MACHOCOREFILE_CORESPEC_H
+#define YAML2MACHOCOREFILE_CORESPEC_H
+
+#include <cstdint>
+#include <string>
+#include <vector>
+
+struct RegisterNameAndValue {
+  std::string name;
+  uint64_t value;
+};
+
+enum RegisterFlavor { GPR = 0, FPR, EXC };
+
+struct RegisterSet {
+  RegisterFlavor flavor;
+  std::vector<RegisterNameAndValue> registers;
+};
+
+struct Thread {
+  std::vector<RegisterSet> regsets;
+};
+
+enum MemoryType { UInt8 = 0, UInt32, UInt64 };
+
+struct MemoryRegion {
+  uint64_t addr;
+  MemoryType type;
+  uint32_t size;
+  // One of the following formats.
+  std::vector<uint8_t> bytes;
+  std::vector<uint32_t> words;
+  std::vector<uint64_t> doublewords;
----------------
JDevlieghere wrote:

If they're mutually exclusive, you could do:
```suggestion
  using Bytes = std::vector<uint8_t>;
  using Words = std::vector<uint32_t>;
  using Doublewords = std::vector<uint64_t>;
  std::variant<Bytes, Words, Doublewords> data;
```
but this might complicate the YAML traits. We do this for protocol messages in 
DAP and MCP. 

https://github.com/llvm/llvm-project/pull/153911
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to