[ObjectYAML] Add basic minidump generation support
authorPavel Labath <pavel@labath.sk>
Fri, 22 Mar 2019 14:47:26 +0000 (14:47 +0000)
committerPavel Labath <pavel@labath.sk>
Fri, 22 Mar 2019 14:47:26 +0000 (14:47 +0000)
commit69de7a955e8a344df77c78637ea5f76047ef30f0
treeee8404695927bf6a727bfebd450a9687cd70312b
parent2213dd61d623153c9671be880bd30d1d6bb0abaa
[ObjectYAML] Add basic minidump generation support

Summary:
This patch adds the ability to read a yaml form of a minidump file and
write it out as binary. Apart from the minidump header and the stream
directory, only three basic stream kinds are supported:
- Text: This kind is used for streams which contain textual data. This
  is typically the contents of a /proc file on linux (e.g.
  /proc/PID/maps). In this case, we just put the raw stream contents
  into the yaml.
- SystemInfo: This stream contains various bits of information about the
  host system in binary form. We expose the data in a structured form.
- Raw: This kind is used as a fallback when we don't have any special
  knowledge about the stream. In this case, we just print the stream
  contents in hex.

For this code to be really useful, more stream kinds will need to be
added (particularly for things like lists of memory regions and loaded
modules). However, these can be added incrementally.

Reviewers: jhenderson, zturner, clayborg, aprantl

Subscribers: mgorny, lemo, llvm-commits, lldb-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59482

llvm-svn: 356753
17 files changed:
llvm/include/llvm/ObjectYAML/MinidumpYAML.h [new file with mode: 0644]
llvm/include/llvm/ObjectYAML/ObjectYAML.h
llvm/lib/ObjectYAML/CMakeLists.txt
llvm/lib/ObjectYAML/MinidumpYAML.cpp [new file with mode: 0644]
llvm/lib/ObjectYAML/ObjectYAML.cpp
llvm/test/tools/yaml2obj/minidump-raw-stream-small-size.yaml [new file with mode: 0644]
llvm/test/tools/yaml2obj/minidump-systeminfo-other-long.yaml [new file with mode: 0644]
llvm/test/tools/yaml2obj/minidump-systeminfo-other-not-hex.yaml [new file with mode: 0644]
llvm/test/tools/yaml2obj/minidump-systeminfo-other-short.yaml [new file with mode: 0644]
llvm/test/tools/yaml2obj/minidump-systeminfo-x86-long.yaml [new file with mode: 0644]
llvm/test/tools/yaml2obj/minidump-systeminfo-x86-short.yaml [new file with mode: 0644]
llvm/tools/yaml2obj/CMakeLists.txt
llvm/tools/yaml2obj/yaml2minidump.cpp [new file with mode: 0644]
llvm/tools/yaml2obj/yaml2obj.cpp
llvm/tools/yaml2obj/yaml2obj.h
llvm/unittests/ObjectYAML/CMakeLists.txt
llvm/unittests/ObjectYAML/MinidumpYAMLTest.cpp [new file with mode: 0644]