minidump2yaml.cpp 815 B

1234567891011121314151617181920212223
  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. #include "obj2yaml.h"
  9. #include "llvm/Object/Minidump.h"
  10. #include "llvm/ObjectYAML/MinidumpYAML.h"
  11. #include "llvm/Support/YAMLTraits.h"
  12. using namespace llvm;
  13. Error minidump2yaml(raw_ostream &Out, const object::MinidumpFile &Obj) {
  14. auto ExpectedObject = MinidumpYAML::Object::create(Obj);
  15. if (!ExpectedObject)
  16. return ExpectedObject.takeError();
  17. yaml::Output Output(Out);
  18. Output << *ExpectedObject;
  19. return llvm::Error::success();
  20. }