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