[llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG...
[llvm-complete.git] / tools / obj2yaml / minidump2yaml.cpp
blob50c883edb2713185b3a2d9227f81c9d095c481db
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 //===----------------------------------------------------------------------===//
9 #include "Error.h"
10 #include "obj2yaml.h"
11 #include "llvm/Object/Minidump.h"
12 #include "llvm/ObjectYAML/MinidumpYAML.h"
13 #include "llvm/Support/YAMLTraits.h"
15 using namespace llvm;
17 Error minidump2yaml(raw_ostream &Out, const object::MinidumpFile &Obj) {
18 auto ExpectedObject = MinidumpYAML::Object::create(Obj);
19 if (!ExpectedObject)
20 return ExpectedObject.takeError();
21 yaml::Output Output(Out);
22 Output << *ExpectedObject;
23 return llvm::Error::success();