| 1 | //===- minidump2yaml.cpp - Minidump to yaml conversion tool -----*- C++ -*-===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "obj2yaml.h" |
| 10 | #include "llvm/Object/Minidump.h" |
| 11 | #include "llvm/ObjectYAML/MinidumpYAML.h" |
| 12 | #include "llvm/Support/YAMLTraits.h" |
| 13 | |
| 14 | using namespace llvm; |
| 15 | |
| 16 | Error minidump2yaml(raw_ostream &Out, const object::MinidumpFile &Obj) { |
| 17 | auto ExpectedObject = MinidumpYAML::Object::create(File: Obj); |
| 18 | if (!ExpectedObject) |
| 19 | return ExpectedObject.takeError(); |
| 20 | yaml::Output Output(Out); |
| 21 | Output << *ExpectedObject; |
| 22 | return llvm::Error::success(); |
| 23 | } |
| 24 |